Skip to content

Commit

Permalink
attachment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanashi committed Oct 15, 2023
1 parent 134ea81 commit 3a929ff
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions files/lib/data/faq/QuestionAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use wcf\data\ISortableAction;
use wcf\data\IToggleAction;
use wcf\data\TDatabaseObjectToggle;
use wcf\system\attachment\AttachmentHandler;
use wcf\system\exception\UserInputException;
use wcf\system\html\input\HtmlInputProcessor;
use wcf\system\language\I18nHandler;
Expand Down Expand Up @@ -89,11 +90,11 @@ public function create()
}
$this->updateSearchIndex($question);

if (
isset($this->parameters['answer_attachmentHandler'])
&& $this->parameters['answer_attachmentHandler'] !== null
) {
$this->parameters['answer_attachmentHandler']->updateObjectID($question->questionID);
foreach ($this->parameters as $parameter) {
if (!($parameter instanceof AttachmentHandler)) {
continue;
}
$parameter->updateObjectID($question->questionID);
}

if (!empty($inputProcessor)) {
Expand Down Expand Up @@ -200,11 +201,11 @@ public function update()
}
}

if (
isset($this->parameters['answer_attachmentHandler'])
&& $this->parameters['answer_attachmentHandler'] !== null
) {
$this->parameters['answer_attachmentHandler']->updateObjectID($object->questionID);
foreach ($this->parameters as $parameter) {
if (!($parameter instanceof AttachmentHandler)) {
continue;
}
$parameter->updateObjectID($object->questionID);
}

$inputProcessor->setObjectID($object->questionID);
Expand Down

0 comments on commit 3a929ff

Please sign in to comment.