Closed ngdot closed 3 years ago
You need to set eval.context
because the relations are stored statically for each DCA and can therefore not be retrieved for “dynamic” fields: 'eval' => ['context' => 'dc.tl_content']
But it looks like there is an issue in the core too, because the value doesn’t get saved and the preview is not properly rendered.
These lines https://github.com/contao/contao/blob/29f2d850957bf626a9304423962f49fb706abd0f/core-bundle/src/Resources/contao/widgets/Picker.php#L177-L182 need to be replaced with something like this IMO:
if (substr($this->context ?? '', 0, 3) === 'dc.')
{
$strRelatedTable = substr($this->context, 3);
}
else
{
$strRelatedTable = $this->getRelatedTable();
}
if (!$strRelatedTable)
{
return array_combine((array) $this->varValue, (array) $this->varValue);
}
Yep, that's it! Works fine :) Thanks.
Should get fixed by https://github.com/contao/contao/pull/2837
Contao Version: 4.9.12
Hi, if I want to use the new
picker
as inputType for a custom element, I'm getting the error:This is my code:
I also tried adding
'foreignKey' => 'tl_content.id'
and'relation' => array('type'=>'hasOne', 'load'=>'lazy', 'table'=>'tl_content')
same error.It seems that RSCE doesnt support the new dca picker, any ideas or future plans?