Automated Drupal 11 compatibility fixes

Created on 21 May 2024, 8 months ago
Updated 12 September 2024, 4 months ago

Problem/Motivation

Running command ./vendor/bin/drush upgrade_status:analyze moderation_sidebar can see following issues we need to fix these in order to make this module compatible.

Moderation Sidebar,  8.x-1.7
Scanned on Tue, 05/21/2024 - 12:10

FILE: modules/contrib/moderation_sidebar/src/Form/QuickTransitionForm.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Fix now        191  Call to deprecated method loadRevision() of interface       
                    Drupal\Core\Entity\EntityStorageInterface. Deprecated in    
                    drupal:10.1.0 and is removed from drupal:11.0.0. Use        
                    Drupal\Core\Entity\RevisionableStorageInterface::loadRevisio
                    n instead.                                                  
--------------------------------------------------------------------------------

FILE: modules/contrib/moderation_sidebar/css/moderation_sidebar.css

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 0    The #drupal-off-canvas selector is deprecated in            
                    drupal:9.5.0 and is removed from drupal:10.0.0. See         
                    https://www.drupal.org/node/3305664.                        
--------------------------------------------------------------------------------

FILE: modules/contrib/moderation_sidebar/moderation_sidebar.info.yml

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 4    Value of core_version_requirement: ^9.3 || ^10 is not       
                    compatible with the next major version of Drupal core. See  
                    https://drupal.org/node/3070687.                            
--------------------------------------------------------------------------------

Proposed resolution

Provide MR/patch with the fixes.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India chandu7929 Pune

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

Merge Requests

Comments & Activities

  • Issue created by @chandu7929
  • First commit to issue fork.
  • Assigned to ankitv18
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 191s
    #186259
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 239s
    #186306
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 258s
    #186310
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 157s
    #186351
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 214s
    #186387
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 217s
    #186394
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 261s
    #186403
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 216s
    #186420
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 274s
    #186428
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 284s
    #186696
  • Merge request !13Issue#3448524: D11 support. → (Closed) created by ankitv18
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Success
    8 months ago
    Total: 209s
    #188773
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Success
    8 months ago
    Total: 235s
    #188794
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 184s
    #188801
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Success
    8 months ago
    Total: 214s
    #188808
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Success
    8 months ago
    Total: 262s
    #188817
  • 🇮🇳India ankitv18

    ankitv18 changed the visibility of the branch 3448524-automated-drupal-11 to hidden.

  • Issue was unassigned.
  • Status changed to Needs review 8 months ago
  • 🇮🇳India ankitv18

    All deprecation warnings are fixed with d11 support and phpunit tests are passing now, please review MR!13

  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 2602s
    #189586
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 232s
    #189680
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 207s
    #189684
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 218s
    #189689
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 287s
    #189699
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    8 months ago
    Total: 260s
    #189709
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 7 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    7 months ago
    #191656
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 7 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    7 months ago
    Total: 307s
    #191665
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 7 months ago
    Waiting for branch to pass
  • Pipeline finished with Success
    7 months ago
    Total: 224s
    #191672
  • 🇮🇳India ankitv18

    Dropping the support for D9 with the respect https://www.drupal.org/node/3305664

  • Status changed to Needs work 7 months ago
  • 🇮🇳India vishalkhode

    @ankitv18 : I think we shouldn't remove support for D9 based on what's mentioned in https://www.drupal.org/node/3305664 .
    We should update selector,
    FROM:
    #drupal-off-canvas-wrapper
    TO

    #drupal-off-canvas:not(.drupal-off-canvas-reset),
    #drupal-off-canvas-wrapper {
    }
    
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 7 months ago
    Waiting for branch to pass
  • Pipeline finished with Failed
    7 months ago
    Total: 213s
    #191708
  • Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 7 months ago
    Waiting for branch to pass
  • Status changed to Needs review 7 months ago
  • 🇮🇳India ankitv18

    Added both attribute #drupal-off-canvas:not(.drupal-off-canvas-reset), #drupal-off-canvas-wrapper in the CSS and JS
    Created new issue for fixing previous major phpunit failure.

  • Pipeline finished with Success
    7 months ago
    Total: 316s
    #191784
  • Status changed to RTBC 7 months ago
  • 🇮🇳India vipin.mittal18 Greater Noida

    RTBC + 1

  • 🇮🇳India vipin.mittal18 Greater Noida

    Hello Samuel & Joël,

    Could you please confirm that you are still maintaining this module as there hasn't been any activity over the past year. We would also appreciate if you could update us about your plans to release a pre/stable version of moderation_sidebar so that we can use it in our application that supports Drupal 11. Thanks!

  • 🇮🇳India vipin.mittal18 Greater Noida

    Hello Samuel & Joël,

    Please accept my apologies for bothering you, but I would appreciate it if you could release a Drupal 11 compatible version as we have put in a great deal of effort to fix the compatibility issues. If you are no longer maintaining this, please add me as a maintainer, so we can provide support for Drupal 11 customers that will be very helpful in the long run.

    Thanks!

  • First commit to issue fork.
  • Pipeline finished with Failed
    6 months ago
    Total: 529s
    #228922
  • Pipeline finished with Success
    6 months ago
    Total: 225s
    #231427
  • Pipeline finished with Success
    6 months ago
    Total: 207s
    #231431
  • 🇮🇳India vipin.mittal18 Greater Noida

    Hello Joël & Samuel,

    Would it be possible to release a Drupal 11 compatible version before the Drupal 11 stable version is released next week?

    Thanks!

  • Status changed to Needs work 6 months ago
  • 🇨🇭Switzerland berdir Switzerland

    Left a few questions on the MR. Coding standards shouldn't be mixed with D11 compatility issues, this makes this issue way harder to fix than it has to be.

    I expected to see 📌 Schema for moderation_sidebar.settings.workflows is in deprecated format Needs work as part of this, not sure if it's not failing then I guess there are no tests covering that feature.

  • Pipeline finished with Failed
    5 months ago
    Total: 154s
    #246659
  • Pipeline finished with Success
    5 months ago
    #246662
  • Pipeline finished with Success
    5 months ago
    Total: 498s
    #247853
  • Pipeline finished with Success
    5 months ago
    Total: 210s
    #247875
  • Status changed to Needs review 5 months ago
  • Status changed to Needs work 5 months ago
  • 🇦🇺Australia acbramley

    This needs to be peeled back to just the relevant changes to be D11 compatible.

  • First commit to issue fork.
  • Pipeline finished with Success
    5 months ago
    Total: 248s
    #258833
  • Pipeline finished with Failed
    5 months ago
    Total: 217s
    #259253
  • Pipeline finished with Failed
    5 months ago
    Total: 207s
    #259306
  • Pipeline finished with Failed
    5 months ago
    Total: 293s
    #259327
  • Pipeline finished with Success
    5 months ago
    Total: 254s
    #260239
  • Status changed to Needs review 5 months ago
  • Pipeline finished with Success
    5 months ago
    Total: 233s
    #261048
  • Status changed to Needs work 5 months ago
  • 🇮🇳India chandu7929 Pune

    @acbramley the class EntityTestMulRevPub requires entity_test_mulrevpub schema to be enabled which is currently not happening and hence tests are failing for all the versions of Drupal. To fix this we need to either switch test to kernelTestBase or use node::create in BrowserTestBase.

    deepakkm I don't agree with this explanation; we just have to add these two lines of code, which will do the work; no update is required in any of the tests files.

    diff --git a/tests/src/Functional/ModerationSidebarTest.php b/tests/src/Functional/ModerationSidebarTest.php
    index a678462..ea3f71f 100644
    --- a/tests/src/Functional/ModerationSidebarTest.php
    +++ b/tests/src/Functional/ModerationSidebarTest.php
    @@ -62,6 +62,10 @@ class ModerationSidebarTest extends BrowserTestBase {
           'name' => $this->randomMachineName(),
         ]);
         $entity->save();
    +
    +    $user = $this->createUser([], '', true);
    +    $this->drupalLogin($user);
    +
    
  • Merge request !17Resolve #3448524 "D11 ready cleanup" → (Merged) created by chandu7929
  • Pipeline finished with Failed
    5 months ago
    #261467
  • Pipeline finished with Failed
    5 months ago
    Total: 414s
    #261528
  • Pipeline finished with Success
    5 months ago
    Total: 236s
    #261548
  • Status changed to Needs review 5 months ago
  • 🇮🇳India chandu7929 Pune

    Created separate MR!17 with minimum required changes for D11, fixes hence requesting review.

  • 🇮🇳India chandu7929 Pune

    Hello @ japerry , Can you please confirm if we have to keep support for D9 with respect to the comment 📌 Automated Drupal 11 compatibility fixes Needs review otherwise we are good.

  • Status changed to Needs work 5 months ago
  • 🇦🇺Australia acbramley

    The MR has some conflicts

  • First commit to issue fork.
  • Pipeline finished with Skipped
    5 months ago
    #266720
  • 🇺🇸United States japerry KVUO

    Drupal 9 support should not be dropped yet, so its been retained and the phpunit tests fixed in another issue. Since the D11 issue isn't making those tests fail again in d9, and appears to be working in D10 and 11 I think we're good here.

    I added a test for the config form. While I'm not sure it'll pick up schema errors, it would pick up the deprecation as a failed test in D11.

    Committed!

  • Status changed to Fixed 5 months ago
  • Merge request !21Add BC css to Drupal 9. → (Closed) created by japerry
    • japerry committed c57f181d on 8.x-1.x
      Issue #3448524 by japerry: followup for Drupal 9.5 CSS compatibility.
      
  • 🇮🇳India chandu7929 Pune

    We also need to include this change for D9 from js/moderation_sidebar.js

      // information is already available.
      $('.toolbar-icon-moderation-sidebar').on('click', function (e, data) {
        if ($('.moderation-sidebar-container').length && (!data || !data.reload)) {
          $('#drupal-off-canvas-wrapper, #drupal-off-canvas').dialog('close');
          e.stopImmediatePropagation();
          e.preventDefault();
        }
    
  • 🇺🇸United States japerry KVUO

    @japerry if we are supporting D9.5 then please include this commit https://git.drupalcode.org/project/moderation_sidebar/-/merge_requests/1...

    There was a piece missing from the original MRs regarding the CSS, so I committed that. Thanks chandu7929 for pointing out the js BC as well. thats been committed!

    • japerry committed 1866c00f on 8.x-1.x
      Issue #3448524: followup for Drupal 9.5 JS compatibility.
      
  • 🇦🇺Australia acbramley

    Hey @japerry I've noticed this on a few issues of yours now but you seem to be forgetting to give credit for all the people that worked on these issues. Many people on this issue were not credited for their work. Hopefully this is just an oversight, would appreciate you fixing it up. Thanks!

  • 🇺🇸United States japerry KVUO

    My apologies, apparently d.o doesn't show MR comments in the issue, so I didn't see your guys reviews. Ultimately those branches weren't used, which is why you only see the credit with chandu7929 from comment #33. Fixed!

  • 🇦🇺Australia acbramley

    Thanks a lot @japerry!

  • 🇮🇳India ankitv18

    But the actual work done by me most of the file changes are taken as reference from the MR!13 even drupal-wrapper-off-canvas BC support was totally done over their at first place.

    Also most of the linked and related issues either I've raised them or worked on the them but didn't get a credit not sure why.

  • Status changed to Needs review 5 months ago
  • 🇺🇸United States samuel.mortenson

    The CSS changes don't work with D10. Specifically, the ".ui-dialog-off-canvas #drupal-off-canvas-wrapper" selector doesn't work, "#drupal-off-canvas-wrapper" is the same element as ".ui-dialog-off-canvas". I'm not sure if this patch will mess up specificity or something but it works in D10 for me. See screenshots for what I saw on stock d10 install and 8x-1.8.

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

Production build 0.71.5 2024