Problem/Motivation

Reported by davituri in the security advisory coverage application (#3608067, comment 7). VocabularyConditionBase::summary() builds the summary from separately translated fragments cast to strings and joins them with a hard-coded English " or " that never reaches translators. The joined string is then passed through the @criteria placeholder, so the vocabulary and term labels are escaped a second time: for a vocabulary named Q&A the summary renders "Q&A". Finally the summary ignores the negate option, so a negated condition still reads "Applies when the vocabulary is Tags".

Steps to reproduce

Configure the "Vocabulary or term" block visibility condition with a vocabulary named "Q&A", enable "Negate the condition" and look at the summary shown in the block form: the ampersand is double escaped and the sentence still says "Applies when".

Proposed resolution

Return one complete translatable string per case (vocabularies, terms, both, with and without descendants, each with a negated variant) using @bundles and @terms placeholders, so translators get the full sentence and labels are escaped exactly once. Extend the summary kernel test with negated cases, the combined case with descendants and a label containing an ampersand.

Comments

trebormc created an issue. See original summary.

  • trebormc committed c6695b14 on 2.0.x
    Issue #3623349 by trebormc, davituri: Condition summary concatenates...
trebormc’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.