Skip to content

Commit 1005646

Browse files
committed
Merge tag '3.6.9'
Hotfix release 3.6.9 - Fix post action PHP8 warning - Fix for File Picker Types Array Handling in TinyMce Integration
2 parents a3dfe6a + fb6f10f commit 1005646

File tree

4 files changed

+25
-16
lines changed

4 files changed

+25
-16
lines changed

src/Contao/Widgets/MultiColumnWizard.php

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,16 +1071,21 @@ protected function initializeWidget(&$arrField, $intRow, $strKey, $varValue)
10711071

10721072
// Add the help wizard
10731073
if (isset($arrField['eval']['helpwizard']) && $arrField['eval']['helpwizard']) {
1074+
$label = (isset($arrField['label']) && is_array($arrField['label']) && isset($arrField['label'][0]))
1075+
? $arrField['label'][0]
1076+
: 'Help';
1077+
1078+
// Construct the help wizard link
10741079
$xlabel .= ' <a href="contao/help.php?table=' . $this->strTable . '&amp;field=' . $this->strField
1075-
. '" title="' . StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['helpWizard'])
1076-
. '" onclick="Backend.openModalIframe({\'width\':735,\'height\':405,\'title\':\''
1077-
. StringUtil::specialchars(str_replace("'", "\\'", $arrField['label'][0]))
1078-
. '\',\'url\':this.href});return false">'
1079-
. Image::getHtml(
1080-
'about.gif',
1081-
$GLOBALS['TL_LANG']['MSC']['helpWizard'],
1082-
'style="vertical-align:text-bottom"'
1083-
) . '</a>';
1080+
. '" title="' . StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['helpWizard'])
1081+
. '" onclick="Backend.openModalIframe({\'width\':735,\'height\':405,\'title\':\''
1082+
. StringUtil::specialchars(str_replace("'", "\\'", $label))
1083+
. '\',\'url\':this.href});return false">'
1084+
. Image::getHtml(
1085+
'about.gif',
1086+
$GLOBALS['TL_LANG']['MSC']['helpWizard'],
1087+
'style="vertical-align:text-bottom"'
1088+
) . '</a>';
10841089
}
10851090

10861091
// Add the popup file manager

src/ContaoManager/Plugin.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* This file is part of menatwork/contao-multicolumnwizard-bundle.
55
*
6-
* (c) 2012-2019 MEN AT WORK.
6+
* (c) 2012-2024 MEN AT WORK.
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
@@ -15,7 +15,7 @@
1515
* @author Stefan Heimes <[email protected]>
1616
* @copyright 2011 Andreas Schempp
1717
* @copyright 2011 certo web & design GmbH
18-
* @copyright 2013-2019 MEN AT WORK
18+
* @copyright 2013-2024 MEN AT WORK
1919
* @license https://github.com/menatwork/contao-multicolumnwizard-bundle/blob/master/LICENSE LGPL-3.0-or-later
2020
* @filesource
2121
*/
@@ -37,7 +37,7 @@ class Plugin implements BundlePluginInterface
3737
/**
3838
* {@inheritdoc}
3939
*/
40-
public function getBundles(ParserInterface $parser)
40+
public function getBundles(ParserInterface $parser): array
4141
{
4242
return [
4343
BundleConfig::create(MultiColumnWizardBundle::class)

src/EventListener/Contao/ExecutePostActions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ public function executePostActions($action, DataContainer $container)
256256
// Add the sub configuration into the DCA. We need this for contao. Without it is not possible
257257
// to get the data for the picker.
258258
if (
259-
($GLOBALS['TL_DCA'][$container->table]['fields'][$mcwBaseName]['inputType'] == 'multiColumnWizard')
259+
(($GLOBALS['TL_DCA'][$container->table]['fields'][$mcwBaseName]['inputType'] ?? null)
260+
=== 'multiColumnWizard')
260261
&& !($container instanceof DataContainerInterface)
261262
) {
262263
$widget = MultiColumnWizard::generateSimpleMcw($container->table, $mcwBaseName);

src/EventListener/Mcw/TinyMce.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ 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'] ?? '') + [null, null];
5050

51-
$fileBrowserTypes = array();
51+
$fileBrowserTypes = [];
5252
// Since we don't know if this is the right call for other versions of contao
5353
// we won't use dependencies injection.
5454
$pickerBuilder = System::getContainer()->get('contao.picker.builder');
@@ -59,11 +59,14 @@ public function executeEvent(GetTinyMceStringEvent $event)
5959
}
6060
}
6161

62+
// Convert fileBrowserTypes to a comma-separated string for TinyMCE compatibility.
63+
$fileBrowserTypesString = implode(',', $fileBrowserTypes);
64+
6265
/** @var BackendTemplate|object $objTemplate */
6366
$objTemplate = new BackendTemplate('be_' . $file);
6467
$objTemplate->selector = 'ctrl_' . $fieldId;
6568
$objTemplate->type = $type;
66-
$objTemplate->fileBrowserTypes = $fileBrowserTypes;
69+
$objTemplate->fileBrowserTypes = $fileBrowserTypesString;
6770
$objTemplate->source = $table . '.' . $fieldId;
6871

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

0 commit comments

Comments
 (0)