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'm using RawNodeContext::nodeCreate() to create a bundle that has an entity reference. This worked in Drupal 8/PHP 7. When upgrading to Drupal 9/PHP 8.1 my behats break.
As title of the entity reference to create in the bundle I used "0000000000 \- Enterprise". The actual title of the reference is "0000000000 - Behat enterprise". When I use the title without the "\" I get a "number of bound variables does not match number of tokens" error which I also had in Drupal 8/PHP 7. The difference is that "0000000000 \- Enterprise" now results in a query:
SELECT "base_table"."vid" AS "vid", "base_table"."nid" AS "nid"
FROM
"node" "base_table"
INNER JOIN "node_field_data" "node_field_data" ON "node_field_data"."nid" = "base_table"."nid"
│ WHERE ("node_field_data"."title" LIKE '0000000000 \\\\- Behat enterprise' ESCAPE '\\') AND ("node_field_data"."type" IN ('enterprise'))
4 \'s in the query for the title of the reference instead of the 2 \'s I would expect. The query with the 4 \'s doesn't match anything, when I manually change the query to 2 \'s I get the data I expect.
Because of PHP 8 something seems to double escape.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: