Vote #64877
完了Patch for "My Page" personalization not storing reordered blocks
0%
説明
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
journals
+1
I will be interested when this patch gets incorporated also. I have had a few people ask about it.
--------------------------------------------------------------------------------
Patch applied in r2634. Thanks.
Rather than storing the changes in session, we should write them directly in the database.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
I'll do some more testing.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
This should be fixed in r3194.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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.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
--------------------------------------------------------------------------------
This code was removed because order is saved immediately after moving a block.
--------------------------------------------------------------------------------
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?
--------------------------------------------------------------------------------
There is a 'Back' button for that.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------