Tag is not added to the page if both node and commerce product are selected in conditions

Created on 28 June 2024, 6 months ago
Updated 19 September 2024, 3 months ago

Problem/Motivation

If you configure conditions for node and commercial product in the tag settings, the tag will not be added to both of them.
If only a product or a node is configured, the tag is attached to the page of the corresponding entity.
I was able to reproduce this issue on a clean Drupal (10.2.7) installation with google_tag (2.0.5) and commerce modules installed.

The problem is in passesConditions() method of TagContainerResolver class, on the node page it gets MissingValueContextException for commerce_product context and on the product page the same exception occurs but for node context.
During debugging I've found out that on the node page the ProductRouteContext can't get product from route and on the product page NodeRouteContext can't get node from the route.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇧🇾Belarus kachinsky

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024