Drupal 10 compatibility

Created on 2 May 2023, over 1 year ago
Updated 14 March 2024, 9 months ago

Not Drupal 10 compatible

💬 Support request
Status

Fixed

Version

1.0

Component

Code

Created by

🇳🇱Netherlands yustinTR

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

Comments & Activities

  • Issue created by @yustinTR
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • 🇮🇳India omkar_yewale Mumbai

    Hi @yustinTR,

    It is not sufficient to change core_version_requirement to make the module Drupal 10 compatible.

    Drupal\Core\Entity\Query\QueryException: Entity queries must explicitly set whether the query should be access checked or not.

    $nids = $this->entityTypeManager->getStorage('node')->getQuery('AND')->condition('type', $values['source_machine_name'])->execute();
    To
    $nids = $this->entityTypeManager->getStorage('node')->getQuery('AND')->accessCheck(FALSE)->condition('type', $values['source_machine_name'])->execute();
    
  • 🇳🇱Netherlands yustinTR

    Hi @omkar_yewale

    Thanks for the advice.

  • Status changed to Needs review over 1 year ago
  • 🇳🇱Netherlands yustinTR

    Sorry i forgot to edit the info.yml in my last patch

  • 🇳🇱Netherlands yustinTR

    And again sorry for the typo in my last patch

  • Status changed to Needs work over 1 year ago
  • 🇮🇳India omkar_yewale Mumbai

    Hi @yustinTR,

    Please add an access check with proper syntax.

    $nids = $this->entityTypeManager->getStorage('node')->getQuery('AND')->condition('type', $values['source_machine_name'])->accessCheck()>execute();

    To

    $nids = $this->entityTypeManager->getStorage('node')->getQuery('AND')->condition('type', $values['source_machine_name'])->accessCheck()->execute();

  • 🇳🇱Netherlands yustinTR

    Sorry for another typo

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India omkar_yewale Mumbai

    Required Manual review of the module.

  • First commit to issue fork.
  • @falco010 opened merge request.
  • 🇳🇱Netherlands falco010 🇳🇱 The Netherlands

    In case you need to upgrade to Drupal 10, you can use the fork/MR created above. I added the patch from #10 to it.

    Add the following to your composer.json repositories:

            {
                "type": "package",
                "package": {
                    "name": "drupal/content_type_clone",
                    "version": "1.x-dev",
                    "type": "drupal-module",
                    "source": {
                        "type": "git",
                        "url": "https://git.drupalcode.org/issue/content_type_clone-3357574.git",
                        "reference": "2e5f125152b18208204b8b7527818137972e86bf"
                    }
                }
            },
    

    And run the following command:

    composer require drupal/content_type_clone
    
  • 🇦🇺Australia pasan.gamage

    For me what worked out was this in my composer. Under repositories;

    {
                "type": "package",
                "package": {
                    "name": "drupalcode/content_type_clone",
                    "version": "3357574",
                    "type": "drupal-module",
                    "source": {
                        "type": "git",
                        "url": "https://git.drupalcode.org/issue/content_type_clone-3357574.git",
                        "reference": "3357574-drupal-10-compatibility"
                    }
                }
            },

    and then under require;
    "drupalcode/content_type_clone": "3357574",

  • Status changed to Fixed 10 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024