Skip to content

Commit

Permalink
fix(question): delete all conditions of a question being deleted
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jun 22, 2020
1 parent c175396 commit 8ba3031
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion inc/question.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,15 @@ public function post_purgeItem() {
'id' => new QuerySubquery([
'SELECT' => self::getForeignKeyField(),
'FROM' => $condition_table,
'WHERE' => ['plugin_formcreator_questions_id' => $questionId]
'WHERE' => [
'OR' => [
[
'itemtype' => $this->getType(),
'items_id' => $questionId
],
'plugin_formcreator_questions_id' => $questionId
]
]
])
]
);
Expand Down

0 comments on commit 8ba3031

Please sign in to comment.