- Issue created by @ptmkenny
- Merge request !25Explode/Implode plugins should allow NULL, empty strings → (Open) created by ptmkenny
- last update
11 months ago 534 pass - Status changed to Needs review
11 months ago 6:27am 10 May 2024 - 🇯🇵Japan ptmkenny
I fixed this for the Implode and Explode plugins by using the same logic as the StripTags plugin.
But there are several other plugins that check
is_string()
andis_array()
and throw an exception on an empty value.I think there should be a policy of whether tamper is expected to fail on an empty value or not.
I would argue against failing on an empty value because you may want to import many entities, some of which have a field set and others that do not.
This problem becomes obvious when importing via JSON with feeds_ex, as JSON objects may not have certain keys (that are set to be tampered with), and so when the JSON object doesn't have a key, the value will be null, throwing an exception when really processing should continue.
- 🇳🇿New Zealand ericgsmith
Yes, sorry this has been a major pain point for many.
https://www.drupal.org/project/tamper/issues/3332785 ✨ Improve handling of empty data Active is where I tried a while ago to consolidate this but haven't had time to push it further.
Happy for this, we probably just need to update the unit test cases as well to add one for null and ''
- Status changed to Closed: duplicate
11 months ago 8:09am 10 May 2024