- Issue created by @peter pulsifer
- 🇳🇱Netherlands megachriz
I think that something like solution #1 makes more sense. However, not with using
empty()
as that will make0
into an empty string too. I think we can even apply solution #2 as well - in the case that an object is passed. Then the Tamper would attempt to cast that object to a string.This needs to be fixed in the Tamper project though, so moving this issue to that project.
- 🇮🇳India abhishek_virasat
I tried #2 approach, and it works. created patch. please review it once
- 🇳🇱Netherlands megachriz
@abhishek_gupta1
Thanks for your contribution, but I think you picked the wrong file to adjust. The file to adjust is TruncateText.Also, I think that a test case needs to be added to \Drupal\Tests\tamper\Unit\Plugin\Tamper\TruncateTextTest to check if an empty string gets returned when
NULL
is passed to the plugin.Also note that the drupal.org testbot no longer evaluates patches. So before a fix can be accepted, it first needs to be in a merge request.
- 🇳🇱Netherlands megachriz
I guess I already addressed this issue before, I just did not finalize it yet: 🐛 PHP notice when passing NULL to the TruncateText plugin Needs review