From 436e9b26d401049416fa697bf8a71b5883cbcbf4 Mon Sep 17 00:00:00 2001 From: Martina Scholz <64533137+LadySolveig@users.noreply.github.com> Date: Tue, 19 Jul 2022 12:39:45 +0200 Subject: [PATCH] Update quantummanagermedia.php Improvement - Support for Media Fields in subforms --- quantummanagermedia.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/quantummanagermedia.php b/quantummanagermedia.php index 7fefb7a..2993c6d 100644 --- a/quantummanagermedia.php +++ b/quantummanagermedia.php @@ -166,6 +166,16 @@ function onContentPrepareForm($form, $data) $form->setFieldAttribute($name, 'directory', $path, $group); $form->setFieldAttribute($name, 'dropAreaHidden', $enablemediapreview, $group); } + if (strtolower($type) === 'subform') + { + $formsource = $field->__get('formsource'); + if(!is_null($formsource) && trim($formsource) !== '') { + $subformxml = new SimpleXMLElement($formsource); + $this->fixForComContent($subformxml); + $formsource_modified = $subformxml->asXML(); + $form->setFieldAttribute($name, 'formsource', $formsource_modified, $group); + } + } } }