Problem/Motivation

When adding a link via form_alter hook the translatability clue ('all_languages' markup) is added to the links title (see picture).

Proposed resolution

Append the type 'link' to the $ignored_types array of ContentTranslationHandler::entityFormSharedElements, as links don't require the translatability clue.

Remaining tasks

Write tests

User interface changes

None

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JuliaBayer created an issue. See original summary.

juliaschwarz’s picture

Status: Active » Needs review
FileSize
863 bytes

Patch with changes as described within the proposed resolution.

juliaschwarz’s picture

Corrected 'great' mistake (link instead of links).

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

hchonov’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: +D8MI, +DevDaysMilan

Seems legit, as the translatability clue should be ignored for links as well. It does not represent a disruptive change and therefore I think it could be target against 8.1.x.

hchonov’s picture

Title: 'all-languages' HTML is escaped in UI of link title » The translatability clue ('all_languages') is wrongly added to links
alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

We should have test coverage of this.

balagan’s picture

Issue summary: View changes

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

hchonov’s picture

hchonov’s picture

Status: Needs work » Needs review

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

tstoeckler’s picture

Went ahead and wrote a test for this. I thought writing a full functional test, which would have been nicer, because this is about output that is shown to users, but in my opinion it would have been very complicated to conjure up an entity form which contains arbitrary form elements, so I went with a kernel test. Because the cyclomatic complexity of the method being tested is quite high there are quite a number of test cases to cover here, but that only strengthens the case for using a kernel test as we can nicely use a data provider to cover all possible cases. Covering all possible cases with a UI test would have been very very difficult if at all possible.

So the first patch just contains a test that passes in HEAD, the second patch then adds a test for ignoring link elements to the test which then should fail on that one test case and is also the interdiff to #11 and then the third patch actually includes the fix and should again pass. #11 actually didn't apply anymore, so I "rerolled" the fix itself.

The last submitted patch, 15: 2674068-15--tests-with-link.patch, failed testing. View results

borisson_’s picture

I like that you make this a kernel test, because a btb-test would make it not just harder to test all the variations, it would also be a lot slower.

I didn't find anything that I'd like to see changed in this patch, but I don't feel confident enough to set it to RTBC.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

gease’s picture

Status: Needs review » Reviewed & tested by the community

Someone needs to set to RTBC. Fix itself is in line with the approach to ignore non-widget form elements. Test, to me, covers all use-cases for translated and untranslated fields.

alexpott’s picture

Version: 8.6.x-dev » 8.8.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed and pushed b760da1161 to 9.0.x and 3a1f07e0bc to 8.9.x. Thanks!

  • alexpott committed b760da1 on 9.0.x
    Issue #2674068 by tstoeckler, julia_schwarz, hchonov: The...

  • alexpott committed 3a1f07e on 8.9.x
    Issue #2674068 by tstoeckler, julia_schwarz, hchonov: The...
alexpott’s picture

Status: Patch (to be ported) » Fixed

Discussed with @catch and we agreed to backport.

  • alexpott committed d914e01 on 8.8.x
    Issue #2674068 by tstoeckler, julia_schwarz, hchonov: The...

Status: Fixed » Closed (fixed)

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