When importing translation while drupal installation, throwing ERROR: "SOME_TRANSLATED_STRING" was skipped because of disallowed or malformed HTML.

We notice the cause is this lines of code in commerce/modules/checkout/src/Plugin/Commerce/CheckoutPane/Login.php

$form_state->setError($name_element, $this->t('Too many failed login attempts for this account. It is temporarily blocked. Try again later or <a href=":url">request a new password</a>.', [':url' => $password_url]));

and

$form_state->setError($name_element, $this->t('Unrecognized username or password. <a href=":url">Have you forgotten your password?</a>', [':url' => $password_url]));

This two lines bring the link tag which is disallowed in drupal core strategies.

Issue fork commerce-3484516

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

司南 created an issue. See original summary.

jsacksick’s picture

Status: Active » Closed (cannot reproduce)

Might be due to a custom import do a format disallowing HTML? In which case this might be due to how your format is configured... Not so much we can do from Commerce. Plenty of modules, including core define translatable strings containing HTML.

geek-merlin’s picture

Title: [error] Import of string "此账户连续登录失败很多次,出于安全考虑已经暂时禁用。请稍后再试或者<a href=":url">更改密码</a>." was skipped because of disallowed or malformed HTML. » [error] Import of string "...<a href=":url">...</a>." was skipped because of disallowed or malformed HTML.
Status: Closed (cannot reproduce) » Active
Issue tags: +Novice

A small thing that annoys me on every config import on deploy.

In german, it's this:

[notice] ERR > >  [error]  Import of string "Für diese Bestellung sind keine <a href=":url"">Zahlungsgateways</a> verfügbar." was skipped because of disallowed or malformed HTML.  

Count the quotes! (Contrary to the asian translators, the germans copied over the wrong quoting. The problem is the quoting of the source though.)

grep '"">' web/modules/contrib/commerce/ -r
web/modules/contrib/commerce/modules/payment/src/Plugin/Commerce/CheckoutPane/PaymentInformation.php:      $message = $this->t('There are no <a href=":url"">payment gateways</a> available for this order.', [

Who wants to roll a patch: Go to that file and s/":url"">/":url">/

santanu mondal’s picture

Assigned: Unassigned » santanu mondal

santanu mondal’s picture

Assigned: santanu mondal » Unassigned
Status: Active » Needs review
geek-merlin’s picture

Status: Needs review » Needs work

700 changed files? Sth gotten messed up.

geek-merlin’s picture

Version: 8.x-2.x-dev » 3.0.x-dev

Maybe it's a branch issue?

geek-merlin’s picture

Version: 3.0.x-dev » 3.x-dev
geek-merlin’s picture

Must be rebased onto 3.x manually.

  • jsacksick committed e32ce7b0 on 3.x
    Issue #3484516: Fix a faulty translatable string in PaymentInformation.
    
jsacksick’s picture

Status: Needs work » Fixed

Fixed this, thanks!

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.