Project

General

Profile

Actions

Patch #2971

closed

Patch for "My Page" personalization not storing reordered blocks

Added by Anonymous about 15 years ago. Updated about 14 years ago.

Status:
Closed
Priority:
Normal
Category:
UI
Target version:
Start date:
2009-03-14
Due date:
% Done:

0%

Estimated time:

Description

I just noticed "My page" personalization does not fully work:
You can add/remove blocks, but after reordering blocks the layout is not stored.
Tested with Safari 3.2.1 and FireFox 3.0.1, this can be reproduced on http://www.redmine.org.

One reason is MyController#order_blocks expects params[:group] to be an array, which simply is not the case, also params["list-#{group}"] may actually be empty if the user just dragged the last item out of a group.

A patch for these issues is attached.

Note that there may still be a race condition because of concurrent AJAX calls when the session is stored within cookies.
(Basically the same session is received twice - once for the removal, once for adding - changed and sent back, one change overwriting the other)

Redmine trunk (r2589)
Ruby 1.8.6
Rails 2.2.2
Postgres 8.3


Files

mypage_order_fix.patch (704 Bytes) mypage_order_fix.patch Anonymous, 2009-03-14 23:53
Actions #1

Updated by Curtis Stewart about 15 years ago

+1

I will be interested when this patch gets incorporated also. I have had a few people ask about it.

Actions #2

Updated by Jean-Philippe Lang about 15 years ago

  • Status changed from New to Resolved
  • Target version set to 0.8.3

Patch applied in r2634. Thanks.
Rather than storing the changes in session, we should write them directly in the database.

Actions #3

Updated by Chaoqun Zou about 15 years ago

There are still some problems in changing layout:

  • Add more than one components to both left-bottom and right-bottom areas, save layout.
  • Move components between two bottom areas, save layout.
  • If you do these several times, you will find that some component will be lost sometimes.
Actions #4

Updated by Jean-Philippe Lang about 15 years ago

  • Status changed from Resolved to Reopened
  • Target version changed from 0.8.3 to 0.9.0

I'll do some more testing.

Actions #5

Updated by Anonymous almost 15 years ago

I'm having the same problem, even on redmine.org
It seems if it move something to the top block I'll never be able to move it to either of the bottom 2 blocks.

Actions #6

Updated by Jean-Philippe Lang over 14 years ago

  • Status changed from Reopened to Closed

This should be fixed in r3194.

Actions #7

Updated by Alex Revetchi over 14 years ago

  • Status changed from Closed to Reopened
  • Assignee set to Jean-Philippe Lang

Jean-Philippe Lang wrote:

This should be fixed in r3194.

Why def page_layout_save has been removed, in 0.9 there is no save link on My page in customization mode.

Actions #8

Updated by Alex Revetchi over 14 years ago

Alex Revetchi wrote:

Jean-Philippe Lang wrote:

This should be fixed in r3194.

Why def page_layout_save has been removed, in 0.9 there is no save link on My page in customization mode.

I have put back the code removed in a prevous commit and it works fine now:

app/views/my/page_layout.rhtml - after the line 48
+<%= link_to l(:button_save), {:action => 'page_layout_save'}, :class => 'icon icon-save' %>

app/controllers/my_controller.rb - restored page_layout_save routine at the end of the file

+ # Save user's page layout
+ def page_layout_save
+ user user = User.current
+ @user.pref[:my_page_layout] = session[:page_layout] if session[:page_layout]
+ @user.pref.save
+ session[:page_layout] = nil
+ redirect_to :action => 'page'
+ end

Actions #9

Updated by Jean-Philippe Lang over 14 years ago

  • Status changed from Reopened to Closed

This code was removed because order is saved immediately after moving a block.

Actions #10

Updated by Alex Revetchi about 14 years ago

Jean-Philippe Lang wrote:

This code was removed because order is saved immediately after moving a block.

There should be at least close button, what user should do in order to exit the customization mode? navigate away from that page?

Actions #11

Updated by Jean-Philippe Lang about 14 years ago

There is a 'Back' button for that.

Actions #12

Updated by Alex Revetchi about 14 years ago

Jean-Philippe Lang wrote:

There is a 'Back' button for that.

Thanks, a lot, it was confusing as I was used to the previous interface, where back was canceling the changes i.e. not saving them.

Actions

Also available in: Atom PDF