- Issue created by @flyke
When I try to open /admin/structure/webform
I get this error:
TypeError: str_contains(): Argument #1 ($haystack) must be of type string, array given in str_contains() (regel 80 van /var/www/html/web/modules/contrib/lb_plus/lb_plus.module).
The referring code is:
if (str_contains($message, 'You have unsaved changes.')) {
$message is indeed not a string. If I output it, its an array:
array:2 [▼
0 => array:4 [▼
"#type" => "link"
"#title" => "×"
"#url" =>
Drupal\Core
\
Url {#6192 ▶}
"#attributes" => array:2 [▼
"aria-label" =>
Drupal\Core\StringTranslation
\
TranslatableMarkup {#6183 ▶}
"class" => array:2 [▶]
]
]
1 => array:2 [▼
"#theme" => "webform_help"
"#info" => array:13 [▼
"group" => "notifications"
"content" => "
<strong>ATTENTION DEVELOPERS!!!</strong> Please make sure to download and update the <a href="https://github.com/RobinHerbots/Inputmask">Input Mask</a> library
▶
"
"message_id" => "webform_help_notification__webform_update_8187"
"message_type" => "warning"
"message_close" => true
"message_storage" => "custom"
"routes" => array:1 [▶]
"id" => "webform_help_notification__webform_update_8187"
"reset_version" => false
"paths" => []
"access" => true
"video_id" => ""
"attached" => []
]
]
]
- enable lb_plus
- visit /admin/structure/webform
Add check for is_string():
if (is_string($message) && str_contains($message, 'You have unsaved changes.')) {
Active
3.1
Code