Drupal 10 readiness

Created on 14 March 2023, over 1 year ago
Updated 17 January 2024, 10 months ago

Problem/Motivation

The current version of the module (8.x-3.2) is compatible with Drupal 8 and Drupal 9, but incompatible with Drupal 10. As Drupal 10 was released some time ago and the related module Entity Clone is already Drupal 10 compatible - it's nice to have D10 compatibility as well.

Steps to reproduce

Just try install the current version of the module with Composer (or even manually) to Drupal 10.

Proposed resolution

Update code to have D10 compatibility

Feature request
Status

Needs review

Version

3.2

Component

Code

Created by

🇺🇦Ukraine sun-fire

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

Comments & Activities

  • Issue created by @sun-fire
  • 🇺🇦Ukraine sun-fire

    There is a patch for the 8.x-3.2 that allows making the Menu Link Clone compatible with Drupal 10

  • First commit to issue fork.
  • 🇺🇸United States damondt

    @Sun-fire thanks for the patch!
    I added it to the issue fork on 3347898-drupal-10 branch and only modified it to fit with the .info format there.
    To use to make the module compatible with D10 via composer add the following to "repositories" above the default ones:

    {
                "type": "package",
                "package": {
                    "name": "drupal/menu_link_clone",
                    "type": "drupal-module",
                    "version": "dev-3347898-drupal-10",
                    "source": {
                        "type": "git",
                        "url": "https://git.drupalcode.org/issue/menu_link_clone-3347898.git",
                        "reference": "3347898-drupal-10"
                    }
                }
            },

    And set the version constraint to:
    "drupal/menu_link_clone": "dev-3347898-drupal-10",

    And run
    composer update drupal/menu_link_clone

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States damondt

    On a D10 site with translations I get the following error cloning a menu item:
    InvalidArgumentException: Field status is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 583 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).

  • 🇺🇸United States damondt

    Attaching a patch for the entity_clone module that can be used in combination with @sun-fire's patch here to achieve D10 compatibility. Overriding the entity form class could be done in this module to avoid having to patch entity clone, so I'm leaving this as needs work until that is accomplished in this module.

  • 🇵🇭Philippines bryanmanalo

    The patch fails on my end.

    Adding another patch, with minimal changes.

  • 🇳🇱Netherlands seanB Netherlands

    Here is a patch that combines the changes in this issue, 💬 Cannot install Entity Clone 2.0.0 because this module requires ^1.0 in composer.json Active , 📌 Automated Drupal 10 compatibility fixes Needs review and 🐛 TypeError when Cloning Menu Needs review to make everything work in D10.

  • Status changed to Needs review about 1 year ago
  • 🇳🇱Netherlands seanB Netherlands

    Crap, forgot to add the patch.

  • 🇫🇷France MacSim

    Patch provided in #10 can't be applied on my side (Drupal 9.5.11)

    composer install
    Gathering patches for root package.
    Removing package drupal/menu_link_clone so that it can be re-installed and re-patched.
      - Removing drupal/menu_link_clone (3.2.0)
    Deleting web/modules/contrib/menu_link_clone - deleted
    > DrupalProject\composer\ScriptHandler::checkComposerVersion
    Installing dependencies from lock file (including require-dev)
    Verifying lock file contents can be installed on current platform.
    Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
    Package operations: 1 install, 0 updates, 0 removals
    Gathering patches for root package.
    Gathering patches for dependencies. This might take a minute.
      - Installing drupal/menu_link_clone (3.2.0): Extracting archive
      - Applying patches for drupal/menu_link_clone
        https://www.drupal.org/files/issues/2023-10-17/3347898-10.patch (Drupal 10 readiness)
       Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2023-10-17/3347898-10.patch
    
  • Status changed to Needs work 10 months ago
  • Status changed to Needs review 10 months ago
  • 🇮🇳India viren18febS

    Hi i have tested #10 , but not able to apply patch , adding screenshot for your reference.
    i have added all the changes and repatch , please review.

  • Status changed to Needs work 10 months ago
  • 🇫🇷France MacSim

    Still unable to apply the patch

    Gathering patches for root package.
    Removing package drupal/menu_link_clone so that it can be re-installed and re-patched.
      - Removing drupal/menu_link_clone (3.2.0)
    Deleting web/modules/contrib/menu_link_clone - deleted
    > DrupalProject\composer\ScriptHandler::checkComposerVersion
    Loading composer repositories with package information
    Updating dependencies
    Nothing to modify in lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 1 install, 0 updates, 0 removals
    Gathering patches for root package.
    Gathering patches for dependencies. This might take a minute.
      - Installing drupal/menu_link_clone (3.2.0): Extracting archive
      - Applying patches for drupal/menu_link_clone
        https://www.drupal.org/files/issues/2024-01-17/issues-3347898-Drupal-10-readiness-fixes.patch (Drupal 10 readiness)
       Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2024-01-17/issues-3347898-Drupal-10-readiness-fixes.patch
    
    In Patches.php line 331:
                                                                                                            
      Cannot apply patch Drupal 10 readiness (https://www.drupal.org/files/issues/2024-01-17/issues-334789  
      8-Drupal-10-readiness-fixes.patch)!
    
  • Issue was unassigned.
  • Status changed to Needs review 10 months ago
  • 🇫🇷France MacSim

    ok so patch provided in #10 should work with a 8.x-3.x version (but I didn't tried and actually I am not fan of the last and only commit on this branch that completely removed the translation on a word to get rid of a PHPCS error instead of using the StringTranslationTrait in order to keep the translation).

    I am hereby providing a patch that should work with a 8.x-3.2 version.

Production build 0.71.5 2024