Further Drupal 10 compatibility fixes

Created on 29 January 2024, 11 months ago
Updated 1 May 2024, 8 months ago

Problem/Motivation

An error appears when updating to a version 1.1.0-beta1:

The 'core_version_requirement' constraint (^9.4 || ^10) requires the 'core' key not be set in modules/contrib/moodle_rest/modules/moodle_rest_course/moodle_rest_course.info.yml

There are also entity queries in moodle_rest_user module that don't specify access checks.

Steps to reproduce

Update version of the module to 1.1.0-beta1

Proposed resolution

  • Remove "core: 8.x" from moodle_rest_course.info.yml
  • Remove "core: 8.x" from moodle_rest_migrate.info.yml
  • Explicitly check access in Drupal\moodle_rest_user\Controller\CourseController
  • Explicitly skip access checks in Drupal\moodle_rest_user\UserBatchHelper
🐛 Bug report
Status

Fixed

Version

1.1

Component

Code

Created by

🇷🇺Russia v_kron

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

Merge Requests

Comments & Activities

  • Issue created by @v_kron
  • Issue was unassigned.
  • First commit to issue fork.
  • Merge request !4Further Drupal 10 compatibility fixes → (Merged) created by jacktonkin
  • 🇬🇧United Kingdom jacktonkin

    There are also entity queries in moodle_rest_user module that don't specify access checks. I've added these as follows:

    • Checking access in Drupal\moodle_rest_user\Controller\CourseController since this is the default in Drupal 9
    • Skipping access checks in Drupal\moodle_rest_user\UserBatchHelper since this is only used by a Drush command so presumably that's more appropriate?
  • Status changed to Needs review 9 months ago
  • 🇬🇧United Kingdom jacktonkin

    Upgrade Status is also finding deprecation notices in some test files but I think they are both PHPUnit 10 things:

    • Call to deprecated method prophesize() of class Drupal\Tests\moodle_rest_migrate\Kernel\Plugin\migrate\process\MoodleFileTest
    • Call to deprecated method withConsecutive() of class PHPUnit\Framework\MockObject\Builder\InvocationMocker
  • Status changed to Fixed 8 months ago
  • 🇳🇱Netherlands ekes

    Fixed in 1.1.0-beta2

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

Production build 0.71.5 2024