Bug #14473
closed
UID values and the "Create multiple pages" Wizard
Added by Wolfgang Klinger almost 20 years ago.
Updated over 18 years ago.
Description
If you create some pages with this wizard the sorting of the pages is ok, e.g.
root
|
+--- new page 01
+--- new page 02
+--- new page 03
but the UID values of the new pages are in reverse order, so "new page 01" has 56, "new page 02" has 55 and "new page 03" has 54
That's kind of distracting if you use those pages afterwards in e.g. excludeUidList and have to specify the IDs in reverse order there...
Someone with indepth knowledge of tcemain should get this working in now time...
(issue imported from #M647)
I cannot fix this right now, as it is more complicated than it seems.
Greets, Sebastian
Sebastian is right, since TCE_Main does include the current record before the last insert in batch create mode (with process_datamap), the array of new records is simply reversed before saving, so that records are well ordered but have wrong ids.
Possible solutions: Modify TCE_main to use a create_after_X for process_datamap, or hack the wizard script to not use this batch creation but a loop of regular db_create_after calls.
Both options are not really suitable for a quick fix.
BTW, Wolfgang, since when do you have to specify IDs in any order in excludeUIDList?
"I cannot fix this right now, as it is more complicated than it seems."
I know, that's why there's no patch attached :-( I tried it myself.
@Michael: that was just an example, the same applies for e.g. "special.list" for menus. I thought it would be nice to have it right, but if it takes extravagant expenses, please simply close this report!
Hi,
the exact problem relies in the way TCEmain does its sorting. Specifically, the method getSortNumber is the problem. If the PID is negative, the data is inserted before the other record, and if it is positive, it is inserted afterwards. This means there is easy way to implement "sorting to bottom" in this function for me without more difficult issues (because when changing getSortNumber, the whole TCEmain needs to be adjusted).
Greets, Sebastian
Also available in: Atom
PDF