You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i want to explain my problem as clearly as possible, but it's very strange :)
This is my local development environment:
Docker Container with PHP8.1-FPM / nginx / MySQL
Contao 5.3.3 and contao-manager 1.8.4.
When I develop a bundle I often copy many parts from my "most recent" bundles such as: DCA definitions and change them to how I need them (because I'm lazy). As a result the following “outdated” snippet ends up in the DCA:
The reason most probably is $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] vs $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? null. My guess is – there's probably an Illegal string offset warning thrown which you cannot see, but it prevents the migration step from succeeding behind the scenes.
Short answer: $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? null is the correct way to do it.
The reason most probably is $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] vs $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? null. My guess is – there's probably an Illegal string offset warning thrown which you cannot see, but it prevents the migration step from succeeding behind the scenes.
Short answer: $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? null is the correct way to do it.
That is exactly correct. And there's really not much Contao can do about that, because it's a PHP8 issue.
Affected version(s)
5.3.3
Description
Hey guys,
i want to explain my problem as clearly as possible, but it's very strange :)
This is my local development environment:
When I develop a bundle I often copy many parts from my "most recent" bundles such as: DCA definitions and change them to how I need them (because I'm lazy). As a result the following “outdated” snippet ends up in the DCA:
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'
This leads to that pending migrations cannot be executed from the CLI or Contao Manager.
If I change this to (e.g. like in tl_form_field.php from contao-core)
'attributes' => 'data-action="contao--scroll-offset#store" onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? null) . '\'))return false"',
everything is fine. I'm not sure if this is really a worth a issue, but I didn't want to hide this behavior from you.
The text was updated successfully, but these errors were encountered: