Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This patch fixes a context sensitive translation issue together with a ultra minor code style bug.
We could theoretically backport this to D6, but it's not important to do so and break an already translated D6 string.
Comment | File | Size | Author |
---|---|---|---|
#8 | 505942_trigger_context.patch | 759 bytes | andypost |
#6 | 505942_trigger_context.patch | 648 bytes | andypost |
trigger_context_sensitive_bug.patch | 798 bytes | hass | |
Comments
Comment #1
ZoeN CreditAttribution: ZoeN commentedCan you describe the actions I'd need to take in order to see the context-sensitive translation bug? (Or post a screenshot of the bug in action?)
Comment #2
Damien Tournoud CreditAttribution: Damien Tournoud commented!description should be @description. $description is plain-text, so we need to escape it before output in an HTML context (there is no security issue here).
Comment #3
hass CreditAttribution: hass commentedDamien: no, see a few lines earlier (not visible in the patch)... the value need to be added as is. !description is correct
Comment #4
Damien Tournoud CreditAttribution: Damien Tournoud commentedI'm not sure what you mean by "the value needs to be added as is". What I see is:
... which suggest that the description is plain-text... and everywhere else, values from the $description array used encoded:
Comment #5
hass CreditAttribution: hass commentedToday it is added as is and this shouldn't change... maybe a module action likes to add HTML code as description. Maybe only a
<em>
,<strong>
or<code>
to highlight something in the description. This is possible today as I know...Comment #6
andypostDamien you are wrong, take a look at http://api.drupal.org/api/function/hook_trigger_info/7 - labels already passed through t()
So here a re-roll
Comment #7
hass CreditAttribution: hass commentedThen you can use my patch as it also fix a minor code style bug :-).
Comment #8
andypost@hass yes, your patch was right but it no longer applies so here re-roll with code-style fix (comma at the end :)
You can RTBC ? or we need someone to review?
Comment #9
hass CreditAttribution: hass commentedThis trivial patch looks codewise RTBC.
Comment #10
Damien Tournoud CreditAttribution: Damien Tournoud commentedAcked. If it is passed through t(), it's HTML.
Comment #11
webchickLooks good. Committed to HEAD with the addition of an inline comment:
I'm sure that myself and Damien are not going to be the last people who look at this and believe it's a mistake. ;)
Since this is going to break strings in D6 for no real gain (echoed by hass in the original issue), I'm marking fixed rather than 6.x.