terminal42 / contao-node

Manage content centrally as nodes and reuse them everywhere.
MIT License
29 stars 8 forks source link

Contao 5.3 Fehler bei NodesPicker #50

Closed jankout closed 7 months ago

jankout commented 8 months ago

hallo, ich versuche den NodesPicker in Contao5 bei News einzubinden. Dabei entsteht folgende Fehlermeldung.

[2024-02-22T18:45:06.769367+01:00] request.CRITICAL: Uncaught PHP Exception TypeError: "str_replace(): Argument #3 ($subject) must be of type array|string, null given" at NodePickerWidget.php line 81 {"exception":"[object] (TypeError(code: 0): str_replace(): Argument #3 ($subject) must be of type array|string, null given at /www/htdocs/w01e8696/editiondasausland.com/vendor/terminal42/contao-node/src/Widget/NodePickerWidget.php:81)"} {"request_uri":"https://editiondasausland.com/contao?act=edit&do=news&id=3&ref=7jsQEf_s&rt=14d4290fe45900d175d37411.txbhWfImz6mHmqN3OcaWkdaBUHdG1JCliRqpHsbGSCQ.42KYLogemfvs7tMca6fi3qzFCAMEtebi3XXnTf-LIneEQKwtsVOH0Oaskw&table=tl_news","request_method":"GET"}

Mein Code für die DCA sieht wie folgt aus

// Node
$GLOBALS['TL_DCA']['tl_news']['fields']['node'] = [
    'label'                     => &$GLOBALS['TL_LANG']['tl_news']['node'],
    'exclude'                   => true,
    'inputType'                 => 'nodePicker',
    'eval'                      => ['multiple' => true, 'fieldType' => 'checkbox', 'tl_class' => 'clr', 'includeBlankOption' => true],
    'sql'                       => ['type' => 'blob', 'notnull' => false],
];

Was soll ich machen, um dies zu beseitigen?

aschempp commented 8 months ago

Die Fehlermeldung deutet darauf hin, dass dein Feld kein Label hat ($GLOBALS['TL_LANG']['tl_news']['node'] ist leer).