Skip to content

Commit

Permalink
Update quantummanagermedia.php
Browse files Browse the repository at this point in the history
Improvement - Support for Media Fields in subforms
  • Loading branch information
LadySolveig authored Jul 19, 2022
1 parent 9deaeda commit 436e9b2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions quantummanagermedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

}
}
Expand Down

0 comments on commit 436e9b2

Please sign in to comment.