Problem/Motivation

The translated paths are not cleaned

Steps to reproduce

Create multilangauge website and then edit a translation of a node, the node translation path is cache is not invalidated on cloudfront

Proposed resolution

Fix by checking if the entity is a translation or original and get the relative alias

Remaining tasks

implement the code

User interface changes

not needed

API changes

not needed

Data model changes

not needed

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

bigbabert created an issue. See original summary.

bigbabert’s picture

joncjordan’s picture

The second arg of getAliasByPath is langocde. I think we could update this line to account for the language of the entity being saved:

$detail_page = $config->get('detail_page')[$i] ? \Drupal::service('path_alias.manager')->getAliasByPath("/$bundle/" . $entity_id) : '';

changes to:

$detail_page = $config->get('detail_page')[$i] ? \Drupal::service('path_alias.manager')->getAliasByPath("/$bundle/" . $entity_id, $entity->language()->id()) : '';
joncjordan’s picture

Hmm I take that back... it doesn't seem to be prepending the URL with the language code. Maybe we should just use this method instead:

$entity->toUrl('canonical')->toString() 

bigbabert’s picture

Status: Active » Needs review

Hi @joncjordan,

as soon i will have time and chance to deploy the change i will test, do you performed a test making changes only on translation and not original language node and verified that the cleaned path on CF is only the one with the correct language prefix?

Best regards
Alberto

bigbabert’s picture

Assigned: bigbabert » Unassigned

  • 42cc5be3 committed on 4.0.x
    Issue #3462369: multilingual path cache invalidation improvement
    
prashant mishra’s picture

Version: 3.0.9 » 4.1.1
Status: Needs review » Fixed

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.