ContentTranslationRouteSubscriber sets _admin_route incorrectly

Created on 27 January 2015, almost 10 years ago
Updated 2 May 2024, 8 months ago

Problem/Motivation

ContentTranslationRouteSubscriber sets the _admin_route option for translation routes based on the respective edit route's setting. However, it sets _admin_route to FALSE even if the edit route does not specify _admin_route at all. This is not only sloppy but opens the door to a very subtle bug: If a route subscriber runs after ContentTranslationRouteSubscriber it thinks that the translation routes have explicitly disabled _admin_route (like the block demo page does), even though they haven't.

Proposed resolution

Make ContentTranslationRouteSubscriber precisely reproduce the _admin_route option of the edit route, i.e. if it is not set, do not set it either.

Remaining tasks

Is this change still needed?

User interface changes

None.

API changes

Only the priority of ContentTranslationRouteSubscriber is changed, so only modules interacting specifically with content translation routes (I don't know any) will notice this. And since it is only moved earlier in the chain even those module won't break in the majority of cases.
On the other hand for modules interacting with the _admin_route option this might fix a very edge-case-y bug, they probably didn't they had. :-)

Beta phase evaluation

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Content translation 

Last updated 1 day ago

No maintainer
Created by

🇩🇪Germany tstoeckler Essen, Germany

Live updates comments and jobs are added and updated live.
  • D8MI

    (Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand quietone

    This was an issue in a bugsmash group triage meeting. I was the only who looked at this and I don't know routing but I see that the proposed changes in the patch are not in core. I am going to set this to get more information to confirm that this is still and issue and that this should be pursued.

    If this issue still relevant?

  • Status changed to Needs work 8 months ago
  • 🇦🇺Australia pameeela

    Setting back to needs work, needs an MR and a test still.

Production build 0.71.5 2024