Support Multi-language when a destination parameter is in place.

Created on 26 May 2023, about 1 year ago

Problem/Motivation

When on the admin/content page and filtering content in the non-default site language. I click the edit button, which includes a destination path to return to the admin/content page. I click the cancel button on the node edit form and the language locale is stuck in the url.

Steps to reproduce

Current language detection settings.

  • Interface Text settings; filtered by custom locale cookie
  • Content Language Settings: Filtered by URL - Language from url path
  1. Log in as an admin user.
  2. Go to admin/content
  3. Filter on another language than sites default.
  4. Click the edit link.
  5. The cancel button url path includes the locale in the redirect destination. So you are redirected back to /ko/admin/content or /ja/admin/content. Basically what ever translated language you were editing.

Proposed resolution

We should be using the additional language option when creating the path of redirection.

Update line: 88

        $destination = Url::fromUserInput($destination_param, [
          'language' => \Drupal::languageManager()->getCurrentLanguage(),
        ]);

Honestly there is another instance (Line 78) that should likely be changed as well. Where to the form has a redirect set and its honoring it. But i won't purpose that change now, but something to consider.

πŸ› Bug report
Status

Needs review

Version

1.4

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Dan Kolbas

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

Comments & Activities

Production build 0.69.0 2024