Duplicating a view does not duplicate the translation

Created on 15 May 2023, over 1 year ago
Updated 9 February 2024, 11 months ago

Problem/Motivation

When you duplicate a view that has a translation, the translations don't get copied to the duplicated view.

It would be user-friendly that translations are duplicated as well.

Steps to reproduce

Add a translation to any View
Duplicate that View
Check the translation of the duplicate: no translations were duplicated, you have to redo them

Proposed resolution

Duplicate translations when duplicating a View through the UI.

Don't do this when duplicating through code because the duplicated View will not be saved yet, so at that point it is unclear if the translations need to be duplicated.

Remaining tasks

User interface changes

NA

API changes

None

Data model changes

None

Release notes snippet

When duplicating a View through the UI, you translations now also get duplicated to the new View.

✨ Feature request
Status

Fixed

Version

11.0 πŸ”₯

Component
Views UIΒ  β†’

Last updated 21 days ago

Created by

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • Issue created by @sboden
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    Yup that would be a nice addition, moving to the feature version

  • Status changed to Needs review about 1 year ago
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    Added functionality and a test for it, totally plagiarised from Webform

  • Status changed to Needs work about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Could the issue summary be updated. Got it started but not as familiar with the issue.

  • Status changed to Needs review about 1 year ago
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    Updated the IS

  • Status changed to RTBC about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thanks for the quick update!

    Running test-only feature

    1) Drupal\Tests\views_ui\Functional\DuplicateTest::testDuplicateView
    Failed asserting that two arrays are equal.
    --- Expected
    +++ Actual
    @@ @@
     Array (
    -    'label' => 'NL label'
     )
    /builds/issue/drupal-3360445/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php:94
    /builds/issue/drupal-3360445/core/modules/views_ui/tests/src/Functional/DuplicateTest.php:66
    /builds/issue/drupal-3360445/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
    FAILURES!
    Tests: 1, Assertions: 15, Failures: 1.
    

    Following the steps I was able to confirm the issue and that the MR fixed it.

    LGTM!

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    This is a nice addition! I read the issue and the MR and didn't see any thing missing or that needs to change.

    I tested this today on a fresh install of demo_umami and it worked perfectly. Thanks!

    Leaving at RTBC.

    • catch β†’ committed be8a77d8 on 11.x
      Issue #3360445 by Lendude, sboden, smustgrave, quietone: Duplicating a...
  • Status changed to Fixed 11 months ago
  • πŸ‡¬πŸ‡§United Kingdom catch

    This looks like something it would be good to have generic support for, but since we don't have generic support for duplcating config entities at all, that seems like long way off, if we ever were introduce it at all.

    Committed/pushed to 11.x, thanks!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024