Closed Geddo closed 2 years ago
Converting needle and haystack explizit to strings (via -> v:variable.convert(type: 'string')) works in this case :-)
I had the same error after upgrading to PHP 7.4 (TYPO3 9.5.32, vhs 6.0.5).
Your workaround works only if the haystack is a single number:
<v:condition.string.contains haystack="176 -> v:variable.convert(type: 'string')" needle="176 -> v:variable.convert(type: 'string')">176 found!</v:condition.string.contains>
There's no output if the haystack is a list of numbers, at least for me:
<v:condition.string.contains haystack="177,178,179,180,181,182,183" needle="180 -> v:variable.convert(type: 'string')">180 found!</v:condition.string.contains>
The error message is gone, though.
I also think this should be fixed in vhs and not by using a vhs viewhelper to fix another vhs viewhelper. ;-) Would you mind reopening the issue again?
I was also able use another workaround to make it work again: By adding another comma to the ID list and changing the needle to "ID," both haystack and needle are already strings, and v:variable:convert isn't needed at all. This would also work if I'm looking for the last ID.
<v:condition.string.contains haystack="177,178,179,180,181,182,183," needle="180,">
Setup:
Example: `