Closed fatcrobat closed 7 years ago
Sorry, I don't get what you mean. Can you elaborate?
I am using contao 4.4.4 and when i try to change the rootPage
with the DCAPicker on my navigation module
i get the following error:
Warning: Cannot use a scalar value as an array
in vendor/codefog/contao-haste/library/Haste/Model/Relations.php (line 648)
$strCacheKey = $strTable . '_' . $strField;
if (!isset(static::$arrRelationsCache[$strCacheKey])) {
$varRelation = false;
$arrField = &$GLOBALS['TL_DCA'][$strTable]['fields'][$strField]['relation'];
if (is_array($arrField) && isset($arrField['table']) && $arrField['type'] == 'haste-ManyToMany') {
$varRelation = [];
// The relations table
I debugged the action and discovered, that $GLOBALS['TL_DCA']['tl_module']['fields']['rootPage']
was not an array, but 1. This only happens within the DCAPicker when you change the page selection for example and apply your changes.
Looks like a Contao/extension bug to me, but I bypassed it in Haste in 2e7c02cadc42581aa1a1b475efbf9f7bc2991eb4
In contao 4.4.3 i discovered when using pageTree picker in tl_module, where jumpTo field in dca is true, without any configuration.
In
Haste\Model\Relations::getRelation
on line649
you access the relation via$arrField = &$GLOBALS['TL_DCA'][$strTable]['fields'][$strField]['relation'];
The method should catch those behaviors by changing the line to: