allow for reordering of files in image gallery block
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
This bug is similar to https:/
But there is another complicating factor that makes this bug separate and that is:
When we first add a gallery block to a page and select some images to be attached to it the block renders them in the order we selected them.
but when we got to edit the block again to add more items it changes the sort order of the originally added items
This is due to the image gallery using a function to return the information for the selected items via:
'selectlistcall
and that function returns a list of selected items in the order of when they were created in the system - eg an array of class objects with each class->id being the array key.
eg:
array (
[9] => stdClass Object
(
[title] => cats.jpg
...
[id] => 9
)
[16] => stdClass Object
(
[title] => ants.jpg
...
[id] => 16
)
So we end up with something that is not alphabetical - nor the order we selected them to be attached to the block
What would be needed is to take the $values (which is in the order of attaching to block) and impose that sort order on the $selected array so that when we edit the block again it doesn't loose our initial selection order.
Changed in mahara: | |
milestone: | 15.04.0 → 15.04.1 |
Changed in mahara: | |
milestone: | 15.04.1 → 15.10.0 |
importance: | Medium → Wishlist |
Changed in mahara: | |
milestone: | 15.10.0 → 16.04.0 |
Changed in mahara: | |
milestone: | 16.04.0 → 16.10.0 |
Changed in mahara: | |
milestone: | 16.10.0 → 16.10.1 |
Changed in mahara: | |
milestone: | 16.10.1 → 17.04.0 |
Changed in mahara: | |
milestone: | 17.04.0 → none |
When rendering an image gallery the script starts with a list of image-ids that fall from the DB and represents the gallery. Of course any information that could indicate the order of the images has to be added to the relation of gallery and image. So it is possible that the starting-point is the table that holds this relation.