Skip to content

Commit 5067585

Browse files
committed
Fix file picker types issue
1 parent a3dfe6a commit 5067585

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/EventListener/Mcw/TinyMce.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function executeEvent(GetTinyMceStringEvent $event)
4646
$table = $event->getTableName();
4747
$fieldId = $event->getFieldId();
4848

49-
list ($file, $type) = explode('|', $field['eval']['rte'], 2);
49+
list($file, $type) = explode('|', $field['eval']['rte'], 2) + [null, null];
5050

5151
$fileBrowserTypes = array();
5252
// Since we don't know if this is the right call for other versions of contao
@@ -63,7 +63,7 @@ public function executeEvent(GetTinyMceStringEvent $event)
6363
$objTemplate = new BackendTemplate('be_' . $file);
6464
$objTemplate->selector = 'ctrl_' . $fieldId;
6565
$objTemplate->type = $type;
66-
$objTemplate->fileBrowserTypes = $fileBrowserTypes;
66+
$objTemplate->fileBrowserTypes = json_encode($fileBrowserTypes);
6767
$objTemplate->source = $table . '.' . $fieldId;
6868

6969
// Deprecated since Contao 4.0, to be removed in Contao 5.0

0 commit comments

Comments
 (0)