From 833706914b956d3810db0c376b08271fadbc93c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jer=C3=B4me=20Bakker?= Date: Wed, 19 Jun 2024 14:24:22 +0200 Subject: [PATCH] added: restorable capability --- classes/ColdTrick/Questions/Access.php | 2 +- classes/ElggAnswer.php | 2 +- elgg-plugin.php | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/ColdTrick/Questions/Access.php b/classes/ColdTrick/Questions/Access.php index 5e53092..473568a 100644 --- a/classes/ColdTrick/Questions/Access.php +++ b/classes/ColdTrick/Questions/Access.php @@ -27,7 +27,7 @@ public static function updateAnswerAccessToQuestionAccess(\Elgg\Event $event): v } // ignore access for this part - elgg_call(ELGG_IGNORE_ACCESS, function() use ($entity) { + elgg_call(ELGG_IGNORE_ACCESS | ELGG_SHOW_DELETED_ENTITIES, function() use ($entity) { $answers = $entity->getAnswers([ 'limit' => false, 'batch' => true, diff --git a/classes/ElggAnswer.php b/classes/ElggAnswer.php index 6ca6abf..6e118a0 100644 --- a/classes/ElggAnswer.php +++ b/classes/ElggAnswer.php @@ -64,7 +64,7 @@ protected function persistentDelete(bool $recursive = true): bool { // make sure the question gets reopened if ($this->isCorrectAnswer()) { // only if this is the correct answer - elgg_call(ELGG_IGNORE_ACCESS, function() { + elgg_call(ELGG_IGNORE_ACCESS | ELGG_SHOW_DELETED_ENTITIES, function() { $this->undoMarkAsCorrect(); }); } diff --git a/elgg-plugin.php b/elgg-plugin.php index b548c97..cc6ce21 100644 --- a/elgg-plugin.php +++ b/elgg-plugin.php @@ -35,6 +35,7 @@ 'commentable' => true, 'searchable' => true, 'likable' => true, + 'restorable' => true, ], ], [