- Issue created by @acbramley
- π¦πΊAustralia acbramley
This can be rebased once π Fix Optional parameter X declared before required parameter Y Active and π Enable concurrent phpunit Active are in.
- πΊπΈUnited States jrockowitz Brooklyn, NY
We shouldn't remove the spaceless behavior from computed fields because we need to the get the computed values without spaces.
We should refactor computed twig examples to use https://twig.symfony.com/doc/3.x/templates.html#whitespace-control
- π¦πΊAustralia acbramley
@jrockowitz what are the computed fields you're referring to?
- πΊπΈUnited States nicxvan
I think @jrockowitz means: tests/modules/webform_test/config/install/webform.webform.test_element_computed_ajax.yml
Tests are not failing and that is a test structure so I'm not sure what the concern is, but I can take a crack at add - to remove spaces instead.
- πΊπΈUnited States nicxvan
I think that should do it, I'll watch the tests.
I think we can probably just remove it from the two templates (progress and help element)
Let me know.
The test ajax should now be equivalent.
- π¨π¦Canada Liam Morland Ontario, CA π¨π¦
This can wait until the core issue is resolved. The
spaceless
filter is still used in Drupal 11. We can wait and see what approach core takes to this. - π¦πΊAustralia acbramley
My changes were following what core was doing, we don't need to strip newlines between html tags for the most part. The test changes are necessary unless we hugely refactor them as well which should be done eventually but isn't required since we can just regex instead
- πΊπΈUnited States nicxvan
I'll revert my changes early next week when I'm back if someone doesn't get to it before me.
- πΊπΈUnited States jrockowitz Brooklyn, NY
The code I am concerned about is https://git.drupalcode.org/project/webform/-/blob/6.3.x/src/Element/Webf....
In theory, we could implement spaceless via code, which would remove all the space between HTML tags after the value is computed.
- πΊπΈUnited States nicxvan
Ok I reverted my change.
@jrockowitz I see now, I was confused cause I mistakenly thought @acbramley had replaced all spaceless calls and tests were passing. I will take a look at implementing spaceless there, there is no direct replacement.
Do you want me to look up the regex that spaceless uses and implement that here?
Is there another simpler solution that will work for computed?