@@ -666,14 +666,13 @@ public function post_purgeItem() {
666666 // Update order of questions
667667 $ order = $ this ->fields ['order ' ];
668668 $ sectionFk = PluginFormcreatorSection::getForeignKeyField ();
669- $ DB ->update (
670- $ table ,
671- new QueryExpression ("`order` = `order` - 1 " ),
672- [
673- 'order ' => ['> ' , $ order ],
674- $ sectionFk => $ this ->fields [$ sectionFk ]
675- ]
676- );
669+ $ sectionId = $ this ->fields [$ sectionFk ];
670+ $ order = $ this ->fields ['order ' ];
671+ $ DB ->query ("
672+ UPDATE ` $ table`
673+ SET `order` = `order` - 1
674+ WHERE `order` > ' $ order' AND ` $ sectionFk` = ' $ sectionId'
675+ " );
677676
678677 // Always show questions with conditional display on the question being deleted
679678 $ questionId = $ this ->fields ['id ' ];
@@ -686,7 +685,7 @@ public function post_purgeItem() {
686685 'id ' => new QuerySubquery ([
687686 'SELECT ' => self ::getForeignKeyField (),
688687 'FROM ' => $ condition_table ,
689- 'WHERE ' => ['show_field ' => $ questionId ]
688+ 'WHERE ' => ['plugin_formcreator_questions_id ' => $ questionId ]
690689 ])
691690 ]
692691 );
@@ -696,7 +695,7 @@ public function post_purgeItem() {
696695 [
697696 'OR ' => [
698697 self ::getForeignKeyField () => $ questionId ,
699- 'show_field ' => $ questionId
698+ 'plugin_formcreator_questions_id ' => $ questionId
700699 ]
701700 ]
702701 );
0 commit comments