File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -148,14 +148,21 @@ public function post_purgeItem() {
148148 global $ DB ;
149149
150150 $ formFk = PluginFormcreatorForm::getForeignKeyField ();
151- $ DB ->update (
152- self :: getTable () ,
153- new QueryExpression ( " `order` = `order` - 1 " ),
154- [
151+ $ rows = $ DB ->request ([
152+ ' SELECT ' => ' id ' ,
153+ ' FROM ' => self :: getTable ( ),
154+ ' WHERE ' => [
155155 'order ' => ['> ' , $ this ->fields ['order ' ]],
156156 $ formFk => $ this ->fields [$ formFk ]
157- ]
158- );
157+ ],
158+ ]);
159+ $ section = new self ();
160+ foreach ($ rows as $ row ) {
161+ $ section ->update ([
162+ 'id ' => $ row ['id ' ],
163+ 'order ' => $ section ->fields ['order ' ] - 1 ,
164+ ]);
165+ }
159166
160167 $ sectionFk = PluginFormcreatorSection::getForeignKeyField ();
161168 $ question = new PluginFormcreatorQuestion ();
You can’t perform that action at this time.
0 commit comments