Drupal 11 compatibility for Features module

Created on 15 May 2024, 7 months ago

Problem/Motivation

Drupal 11.0.0 will be released later this year. Let's make the Features module Drupal 11 compatible. I've performed a static code analysis of work involved for Drupal 11 compatibility. In addition, the GitLab CI should probably add NEXT MAJOR to start running tests against Drupal 11. Additionally, it was proposed to drop support for older versions of Drupal in 📌 Drop Drupal 9 support Active , so I've included that consideration, below.

Auditor checklist

  • [ ] Deprecated Drupal code is remediated
  • [ ] Deprecated PHP code is remediated
  • [ ] Custom code is compatible with jQuery 4
  • [ ] Custom code coreversionrequirement indicates Drupal 11 compatibility

References

Composer

  • [ ] This module has a composer.json file. Manually review it for Drupal 11 compatibility, such as external requirements, core version constraints, and PHP version constraints

PHPStan Audit of Drupal deprecations

 [OK] No errors                                                                                                         

Drupal-Rector Audit of Drupal deprecations

 [OK] Rector is done!                                                                                                   

Audit of deprecated PHP <8.3 calls

If no errors are listed below, php-compatibility did not find any.

............................................................ 60 / 69 (87%)
.........                                                    69 / 69 (100%)


Time: 817ms; Memory: 18MB

jQuery 4 compatibility: List of all custom JavaScript files

Any files listed below should be reviewed for jQuery 4 compatibility

web/modules/contrib/features/modules/features_ui/js/features_ui.admin.js

Diff for updating coreversionrequirement

diff --git a/features.info.yml b/features.info.yml
index f2ded86..ddef07f 100644
--- a/features.info.yml
+++ b/features.info.yml
@@ -2,7 +2,7 @@ name: 'Features'
 type: module
 description: 'Enables administrators to package configuration into modules.'
 package: Development
-core_version_requirement: ^9.4 || ^10
+core_version_requirement: ^10 || ^11
 dependencies:
   - drupal:config
   - config_update:config_update
diff --git a/modules/features_ui/features_ui.info.yml b/modules/features_ui/features_ui.info.yml
index c5b9406..95d5872 100644
--- a/modules/features_ui/features_ui.info.yml
+++ b/modules/features_ui/features_ui.info.yml
@@ -2,7 +2,7 @@ name: Features UI
 type: module
 description: 'Provides the user interface for Features.'
 package: Development
-core_version_requirement: ^9.4 || ^10
+core_version_requirement: ^10 || ^11
 configure: features.assignment
 dependencies:
   - features:features
📌 Task
Status

Active

Version

3.0

Component

Code

Created by

🇺🇸United States mark_fullmer Tucson

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

Merge Requests

Comments & Activities

  • Issue created by @mark_fullmer
  • Status changed to Needs review 5 months ago
  • 🇮🇳India Rajan Kumar@2026

    Hii @mark_fullmer

    I have created patch for "Drupal 11 compatibility for Features module" . Thanks

  • Status changed to RTBC 4 months ago
  • 🇺🇸United States cosmicdreams Minneapolis/St. Paul

    Came across this patch because I wanted to work features into a demo. I can't even get the demo going because I can't get features included via composer.

    We need this in.

  • 🇺🇸United States cosmicdreams Minneapolis/St. Paul
  • 🇺🇸United States cosmicdreams Minneapolis/St. Paul

    I think this patch needs more testing. I did the following:

    1. I rolled a brand new D11 site with just features (and the require dependency, config_update and features_ui, installed).
    2. I navigated to the features_ui admin page (/admin/config/development/features) and received the following error:
    The website encountered an unexpected error. Try again later.
    
    Error: Call to a member function getName() on null in Drupal\features_ui\Form\FeaturesExportForm->buildPackageDetail() (line 382 of modules/contrib/features/modules/features_ui/src/Form/FeaturesExportForm.php).
    Drupal\features_ui\Form\FeaturesExportForm->buildListing() (Line: 181)
    Drupal\features_ui\Form\FeaturesExportForm->buildForm()
    call_user_func_array() (Line: 528)
    Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 279)
    Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
    Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
    Drupal\Core\DrupalKernel->handle() (Line: 19)
    
  • First commit to issue fork.
  • 🇭🇰Hong Kong hswong3i

    Apply this MR for D11 now with:

    ...
        "repositories": {
            "https://packages.drupal.org/8": {
                "canonical": false,
                "type": "composer",
                "url": "https://packages.drupal.org/8"
            },
            "https://drupal.org/node/3447460": {
                "canonical": false,
                "type": "vcs",
                "url": "https://git.drupalcode.org/issue/features-3447460.git"
            },
        },
    ...
        "require": {
            "drupal/features": "dev-3447460-drupal-11-compatibility",
        }
    ...
    
  • Pipeline finished with Failed
    4 months ago
    Total: 164s
    #270294
  • Pipeline finished with Failed
    4 months ago
    Total: 161s
    #270295
  • Pipeline finished with Failed
    4 months ago
    Total: 299s
    #270859
  • Pipeline finished with Failed
    4 months ago
    Total: 450s
    #270862
  • 🇺🇸United States bradallenfisher

    so should we just manually install this for D11?

  • 🇺🇸United States mark_fullmer Tucson

    The latest two commits address compatibility with PHPUnit 10 and PHP 8.2:

    PHPUnit tests are green for both Drupal 10 and Drupal 11. This is ready for a narrowly-scoped release, 8.x-3.16, which would include only this change and https://git.drupalcode.org/project/features/-/commit/d8bb8c1baa795b93b27... compared to 8.x-3.15.

  • 🇺🇸United States mark_fullmer Tucson

    Can the maintainers provide a timeline for when this compatibility will be provided in a new release? Thanks for all the work you do!

Production build 0.71.5 2024