Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I was trying to do an integer comparison to %node:status, which should be 0 for unpublished and 1 for published. This failed, since %node:status holds a string, not an int. The patch in comment #1 forces the values entered in the Integer comparison fields to be evaluated as ints.
Comment | File | Size | Author |
---|---|---|---|
#1 | force-int-values-in-integer-comparison-1319766-1.patch | 780 bytes | whitefluffy |
Comments
Comment #1
whitefluffy CreditAttribution: whitefluffy commentedAttaching patch.
Comment #2
whitefluffy CreditAttribution: whitefluffy commentedOn a second thought, this might not work the way I intended. When running the field %node:status through intval, it returns 0, even if the field is published or not. My issue with the %node:status work when I remove the intval and compares the field with true or false.
So, forcing the fields to an int might not be such a good idea after all. Thoughts on this issue?