- Issue created by @pumpkinkid2
- 🇨🇦Canada drclaw
@pumpkinkid2 Interesting! I suspect that the values just need to be URL Encoded. My use cases for this module has typically been for referenced entity IDs so I haven't tested much with string values. On line 213 in CurrentEntityFieldValue.php, try changing
$values = array_column($entity->{$field_name}->getValue(), $property);
to
$values = array_map('urlencode', array_column($entity->{$field_name}->getValue(), $property));
And see if that gets you there!
Hi drclaw,
Thank you for the quick response! I was actually looking at line 215 where the implode actually happens, however there may be a bit more to this as the change you suggested does not seem to resolve this.
My use case is a bit odd, due to a custom module we are using to populate data automatically.
We have two node types. One that has an entity reference field that contains a few entities and a multiple select value field that has reference IDs from a 3rd party system. This is the ID that has the = at the end of the value. The second node type just has a simple text field with the reference ID.
I am using a relationship and listing information from the referenced entities, and attempting to use your module to filter out those whose reference ID does not match the values on the multiple select.
I'm sure that was as clear as mud, so for now I am going to keep trying on my end and see if I just have the view misconfigured somewhere.
I appreciate the help!
- 🇨🇦Canada drclaw
Oh yeah interesting. I think I follow. I'd maybe suggest inspecting the resulting SQL query to see what the IDs look like there. Maybe they're being transformed somewhere along the way and not transformed back correctly before being inserted into the query.
Also, have you tried manually pasting one of the IDs into the views preview "Preview with contextual filters:" field? Might be good to see if the IDs work there or not. If they don't work there then it's probably an issue with views and not with this module.
Hmm, I'm starting to think this may have actually been an issue with views.
When I use the two values with the equal sign, the query parses like this:
('blahblahblah=+blahblahblah2=')But when I remove the = I get:
('blahblahblah', 'blahblahblah2')Would you agree with my assessment?
I found an issue for views that explains exactly what I am seeing...
https://www.drupal.org/project/drupal/issues/3034595#comment-15178526 🐛 Views contextual filters with multiple values do not work with arguments containing spaces Needs work
Thanks for your help, but it looks like the problem is not related to this module.
- Status changed to Closed: works as designed
over 1 year ago 8:19pm 3 August 2023 - 🇨🇦Canada drclaw
Ah perfect, nice find! And good to know!
Thanks for reporting back. I'll close this issue down :)