Hi, I noticed that the response code condition isn't being respected correctly on the page.
It appears that this may be due to the strict type check in the condition class. Specifically, the getStatusCode() method is returning the status code as an integer, whereas the response codes from the settings are in string format.
See image

| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3353846-2-response-code-condition-not-respected.patch | 694 bytes | sker101 |
| iShot_2023-04-12_16.50.52.png | 199.02 KB | sker101 |
Issue fork google_tag-3353846
Show commands
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
sker101 commentedHere's a patch that force casts the status code into string
Comment #3
sker101 commentedchanging status to "Needs Review"
Comment #4
hanoiiIf we are going to cast, isn't it better to remove the strict comparison instead?
Comment #5
sker101 commentedAlthough I'm unsure of the reason behind adding the strict comparison initially, personally, I believe that doing strict comparison is a beneficial practice in general.
Comment #6
hanoiiBut if you are casting you are removing any potential benefit of the strict comparison
Comment #9
mglamanI agree, unless it's Drupal and dealing with integers.
MR fixes 200 response code checks as well.
Comment #11
mglamanMerged! We're working on a few other follow ups before making a new release.