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.
Under certain circumstances the a result's raw value is an integer when the active values that it is compared with are strings. That results in the comparison to fail.
if (in_array($result->getRawValue(), $this->active_values)) {
The patches casts the raw value to string before making the comparison and that fixes the issue.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2938736-int-to-string-comparison-fix-2.patch | 578 bytes | krystalcode |
Comments
Comment #2
krystalcode CreditAttribution: krystalcode at Acro Commerce commentedPatch attached.
Comment #3
borisson_That's weird, because in_array doesn't do strict matching by default, and we haven't overwritten the
$strict
parameter. Do you happen to have a testcase where this fails?Comment #4
borisson_I don't see any reason why this would make any difference. See also: https://3v4l.org/CR5Ze
Comment #5
krystalcode CreditAttribution: krystalcode at Acro Commerce commentedI know, it was really weird. It was happening on a price facet widget. It could be some weird PHP bug, I don't know. If I ever get some time I'll try to reproduce.
Comment #6
borisson_Awesome, thanks @krystalcode. Setting this to postponed untill you come back with an easy to reproduce testcase.
Comment #7
borisson_Closing this issue.