Add original language to entity url generator meta info

Created on 28 October 2024, about 2 months ago

Problem/Motivation

Similar request to Add entity bundle to entity url generator meta info Add entity bundle to entity url generator meta info Active :

As a developer, I'd like to be able to more easily target the original language when altering sitemap links. Otherwise, I have to load every single entity in the $links array to check the bundle.

Proposed resolution

Add a original_language key to the entity_info metadata in $links

Feature request
Status

Active

Version

4.0

Component

Code

Created by

🇬🇧United Kingdom barry_fisher

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

Merge Requests

Comments & Activities

  • Issue created by @barry_fisher
  • Pipeline finished with Success
    about 2 months ago
    Total: 445s
    #322531
  • 🇩🇪Germany gbyte Berlin

    We are careful with adding too much meta information because of memory constraints. The issue you linked is fair enough, I'll see if it makes sense to add bundle information; but in this case I feel like it's too much of an esoteric use case. Feel free to argue why you need the language info; closing this for now.

  • 🇬🇧United Kingdom barry_fisher

    Hello @gbyte. Fair enough - I understand the esoteric use case here and the balance required for a general use case.

    For background, we want to remove any links that are no in the original language because we're using hreflang translation sets which have links to any translations. This causes a lot of duplication to entities included in the list, especially as we have 8 translations on the site we're working on.

    As an alternative solution, would you consider a hook/event based solution which allows custom modules to implement alterations to the return value of EntityUrlGenerator::processEntity()?

Production build 0.71.5 2024