Page MenuHomePhabricator

Resolve linting issues in Fundraising Frontend Content Repository
Closed, ResolvedPublic5 Estimated Story Points

Description

Currently, CI fails for the wmde/fundraising-frontend-content repository since the linting does not provide any data which is inserted into the templates. This results in an Exception to be thrown in \Tomodomo\Twig\Pluralize::getPluralizedString because the Pluralization is not supplied with a numeric value:

> find i18n/*/mail i18n/*/shared -type f -name '*.twig' | sed -E 's#/mail/|/shared/# #' | sed 's|.twig||' | cut -d' ' -f1,2 | xargs -n 2 bash -c './vendor/bin/lint_content $0 $1'
[Error] Could not validate Twig template for 'donation_confirmation/receipt'
An exception has been thrown during the rendering of a template ("$count must be numeric.").
[Error] Could not validate Twig template for 'donation_confirmation/receipt_support'
An exception has been thrown during the rendering of a template ("$count must be numeric.").
[Error] Could not validate Twig template for 'donation_confirmation/paymenttype_directdebit'
An exception has been thrown during the rendering of a template ("$count must be numeric.").

To fix this issue, we would either need to supply data to the linting process so that next snippets like {$ pluralize(donation_interval, 'Spenden', 'Spenden', 'Spende') $} will have actual integer values to work with and not throw an exception. Alternatively we could also strip all pluralize calls from the linting process but that would be more of a quick an dirty solution.

Event Timeline

kai.nissen set the point value for this task to 5.May 19 2020, 2:24 PM