Bug #17404
closedSorting of remaining section elements in flexforms fails after deleting a section element
0%
Description
How to reproduce it?
1. Create a FCE containig a section/array and fill it up with content, let's say
Element 1
Element 2
Element 3
Element 4
2. Delete Element 2 (click the delete checkbox and click the save button).
3. Now try to sort the remaining elements to reverse order:
Element 4
Element 3
Element 1
There will be some strange behaviour during this process.
What's going wrong?
Sorting ist done by using class.t3lib_tcemain.php -> _MOVE_FLEX_FORMdata().
If you move an element up/down, the element ist swapped with its adjacent element ($key+/-1).
Deleting ist done by using class.t3lib_tcemain.php -> _DELETE_FLEX_FORMdata().
It is done by simply using unset(). The adjacency ($key+/-1) is not maintained during this process, which causes the error.
The patch fixes this loss of adjacency simply by rearranging all indices before using unset().
(issue imported from #M5828)
Files
Updated by Jens Köster over 17 years ago
If deleting multiple etries the patch does not work because of a indices missmatch after the deletion of the first element. :( Any ideas?
Updated by Andreas Wolf about 13 years ago
- Status changed from New to Closed
- Target version deleted (
0)
Has been fixed in the meantime.