Skip to content
Snippets Groups Projects
Unverified Commit 93da6914 authored by Peter Rotich's avatar Peter Rotich Committed by GitHub
Browse files

Merge pull request #4595 from JediKev/issue/faq-page-attachments

issue: FAQ/Page Attachments
parents d015f4b4 a92a3f8b
No related branches found
No related tags found
No related merge requests found
......@@ -405,7 +405,7 @@ class FAQ extends VerySimpleModel {
}
$images = Draft::getAttachmentIds($vars['answer']);
$images = array_map(function($i) { return $i['id']; }, $images);
$images = array_flip(array_map(function($i) { return $i['id']; }, $images));
$this->getAttachments()->keepOnlyFileIds($images, true);
// Handle language-specific attachments
......
......@@ -282,7 +282,7 @@ class Page extends VerySimpleModel {
// Attach inline attachments from the editor
$keepers = Draft::getAttachmentIds($vars['body']);
$keepers = array_map(function($i) { return $i['id']; }, $keepers);
$keepers = array_flip(array_map(function($i) { return $i['id']; }, $keepers));
$this->attachments->keepOnlyFileIds($keepers, true);
if ($rv)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment