Closed (fixed)
Project:
Webform
Version:
6.2.0-beta6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Sep 2023 at 12:53 UTC
Updated:
25 Sep 2023 at 19:04 UTC
Jump to comment: Most recent
Hook webform_metatags_alter invokes when route is null.
preg_match(): Passing null to parameter#2 ($subject) of type string is deprecated in webform/webform.module
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
kryptonComment #4
kryptonComment #7
gilmordI got this notice when running tests, merge request !358 fixed it for me.
+1 for this to be merged
Comment #8
jonathanshawLGTM
Comment #9
jrockowitz commentedWe need to document how to replicate and fix the issue.
Comment #10
gilmord@jrockowitz not sure what kind of document is required, please give more details on it
As about how to replicate and fix the issue:
- Replicate: metatag_tokens() triggers hook_metatags_alter(), hook_tokens can be invoked by Drush (f.e. update hook to resave entites), so there is no route in this case
- Fix: make sure $route_name is not NULL in webform_metatags_alter() before using it
Comment #11
jrockowitz commentedThe MR is changing a massive amount of code.
https://git.drupalcode.org/project/webform/-/merge_requests/358.diff
The MR should only include the required changes.
Comment #12
gilmord@jrockowitz looks like there are two MTs for some reason, this one looks fine:
https://git.drupalcode.org/project/webform/-/merge_requests/359/diffs
Comment #14
jrockowitz commented