refinerycms icon indicating copy to clipboard operation
refinerycms copied to clipboard

Reorder engines positions

Open leopirolo opened this issue 6 years ago • 0 comments

Hello Refinery!

What's going on?

Reordering custom engines in admin pages >= 2 breaks their position orders.

Steps to reproduce

  1. Create a new rails project with Rails '= 5.1.6' and RefineryCMS '~> 4.0.3'
  2. Launch the RefineryCMS' fresh installation: $ rails g refinery:cms --fresh-installation
  3. Create a new RefineryCMS engine: $ rails g refinery:engine event title:string
  4. Go to http://localhost:3000/refinery/events and create 40 events
  5. Go to http://localhost:3000/refinery/events?page=1, click Reorder Events then Done Reordering Events
  6. Go to http://localhost:3000/refinery/events?page=2, click Reorder Events then Done Reordering Events

Expected behavior

When returning to http://localhost:3000/refinery/events?page=1, expect the events positions to be the same as before

Actual behavior

When returning to http://localhost:3000/refinery/events?page=1, we can see that the positions have been changed. As a matter of fact, when reordering the positions of the elements on the second page, their position numbers aren't 20..39 anymore but 0..19. Same thing for all the other pages.

System

Rails version: 5.1.6 Ruby version: 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16] RefineryCMS version: 4.0.3

Thanks in advance.

leopirolo avatar Jan 09 '19 11:01 leopirolo