Nathan Explosion Posted January 26, 2021 Posted January 26, 2021 (edited) Something I've brought up previously in the Contributor Chat forum, but it drifted off into the ether...never to be seen again. I've recently gone back to the POC for something, and this behaviour is still there and it's frankly nonsense. Background: there is something in the POC application which will be relying on the order of entry being kept 'as is' as the setting is going to be used later to display things in the chosen order. My settings code - nice and simple, it works... //<?php $form->add(new \IPS\Helpers\Form\Item('tids', \IPS\Settings::i()->tids, TRUE, array('class' => '\IPS\forums\Topic'))); if ($values = $form->values()) { $form->saveAsSettings(); return TRUE; } return $form; Result, pre-save (note the order for the topics is 2,3,1) Save the form - result (note the order for the topics is now 3,2,1) The issue is that when the above form is saved, the fields values are sorted in DESC order based on the topic ID. Dumping the $values/$form->values to the screen immediately upon the Save button being clicked shows that the sort has already taken place before the 'saveAsSettings' has been processed. I can't see anything that will allow me to specify NOT to do the sort, so any chance that something can be added in? I've got a workaround to this in my application, which involves using a different form in a dialog to add a single item to an existing list of topic IDs which works but feels clunky. Edited January 26, 2021 by Nathan Explosion
Management Solution Matt Posted February 19, 2021 Management Solution Posted February 19, 2021 I've filed a bug report (5226) for this, thanks! Nathan Explosion 1
Recommended Posts