Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Since it can't be accessed directly in the twig template it should be called format.label instead so that calls label() method.
Patch is provided.
Comment | File | Size | Author |
---|---|---|---|
#13 | format-name-2404673-13.patch | 1.2 KB | vladan.me |
#8 | format-name-2404673-8.patch | 1.21 KB | vladan.me |
#7 | format-name-2404673-7-tests.patch | 772 bytes | vladan.me |
Comments
Comment #1
vladan.me CreditAttribution: vladan.me commentedComment #2
dawehnerDoes that mean we need some test coverage for that? this is pretty tricky :)
Comment #3
dawehnerDo you maybe know whether we can ask twig to fail in case something like this happens and not just silently ignore it? (I guess this is what is happening).
Comment #4
BerdirWe should be able to test this easily be checking for that markup on a page that prints this. We did find this because of w3c html validation, in fact ;)
I don't know how to do tell twig when to report and error and when not?
Comment #5
BerdirComment #6
vladan.me CreditAttribution: vladan.me commentedComment #7
vladan.me CreditAttribution: vladan.me commentedHere's patch with tests only to prove that is missing labels.
Comment #8
vladan.me CreditAttribution: vladan.me commentedAnd full patch.
Comment #10
BerdirAssertion message is a bit confusing, I'd suggest "No empty H4 element found".
Comment #11
Poornima3 CreditAttribution: Poornima3 commentedComment #12
Poornima3 CreditAttribution: Poornima3 commentedComment #13
vladan.me CreditAttribution: vladan.me commentedUpdated.
Comment #14
BerdirThanks, this looks good to me. As mentioned, I don't really see how we could change anything in regards to how twig works.. that it doesn't give notices/errors is kind of a feature.
The only thing i can think of would be to given an explicit error if object.property not resolved into anything *and* it is a protected property. But that would also cost processing time.
Comment #15
alexpottTemplate changes are unfrozen in beta and this is fixing a bug. Committed c706fd7 and pushed to 8.0.x. Thanks!