Act on all entites, not just translatable entities (with 2.x-dev)

Created on 8 September 2023, about 1 year ago
Updated 20 June 2024, 5 months ago

Clone of https://www.drupal.org/project/content_translation_redirect/issues/3306982 Act on all entites, not just translatable entities Closed: duplicate to provide a patch working with version 2.x-dev.

Copy of the original issue:

Problem/Motivation

Not all content types are translatable. This module _could_ deal with these too.

Steps to reproduce

Typical use case:
1. Primary site content is only in one language (including landing pages, homepage, etc.). These node types are not translatable.
2. Only one content type is translated. Let's call it "widgets".
3. I view a widget that is translated.
4. I click a link in the site-wide navigation.

Best case scenario:
I end up at a URL like /fr/node/31 because Drupal doesn't know how to give this a URL alias.

Worst case scenario:
I get a fatal error about "InvalidArgumentException: Invalid translation language" because some bit of code doesn't have anything as complicated as \Drupal\content_translation_redirect\EventSubscriber\RequestSubscriber::checkContentEntityCanonicalRoute()

Proposed resolution

Act on all entity types.

Patch will follow

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇦🇺Australia GuillaumeG

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024