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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

krystalcode created an issue. See original summary.

krystalcode’s picture

Status: Active » Needs review
FileSize
578 bytes

Patch attached.

borisson_’s picture

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?

borisson_’s picture

Status: Needs review » Needs work

I don't see any reason why this would make any difference. See also: https://3v4l.org/CR5Ze

krystalcode’s picture

I 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.

borisson_’s picture

Status: Needs work » Postponed (maintainer needs more info)

Awesome, thanks @krystalcode. Setting this to postponed untill you come back with an easy to reproduce testcase.

borisson_’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing this issue.