Problem/Motivation

Ensure the compatibility with Drupal 9.

Proposed resolution

Remaining tasks

Review.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

Not required.

Comments

manuel.adan created an issue. See original summary.

manuel.adan’s picture

Assigned: manuel.adan » Unassigned
Status: Active » Needs review
StatusFileSize
new964 bytes

Status: Needs review » Needs work
sahana _n’s picture

Assigned: Unassigned » sahana _n
sahana _n’s picture

Status: Needs work » Needs review
StatusFileSize
new1.24 KB

The patch is created Please review.

Status: Needs review » Needs work

The last submitted patch, 5: drupal-9-compatiblity.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

sahana _n’s picture

Status: Needs work » Needs review
StatusFileSize
new1.24 KB

Updated the patch, please review.

manuel.adan’s picture

Thanks for your update. Adding an interdiff file is appreciated for patch reviewing.

  1. +++ b/custom_markup_block.info.yml
    @@ -1,6 +1,6 @@
    -core: 8.x

    Removing this statement makes the module incompatible with Drupal < 8.7.7, it should be present by now.

  2. +++ b/composer.json
    @@ -11,5 +11,8 @@
    +  "require": {
    +    "drupal/core": "^8 || ^9"
    +    }
    

    It seems that adding default Drupal core itself to the module composer requirements is not mandatory. The module developer guide about creating a composer.json file does not (currently) mention it, but many of the most installed modules has no such dependency declaration, unless the module is not compatible with some specific core versions.

    For instance, the composer.json file of the webform module has no drupal/core listed in the requirement section, but it is present in the package information ( composer show -a drupal/webform ).

    There are some indentation errors.

  3. +++ b/tests/src/Functional/CustomMarkupBlockTestBase.php
    @@ -10,6 +10,14 @@ use Drupal\Tests\block\Functional\BlockTestBase;
    +  /**
    +
    +   */
    

    Some garbage seems to be accidentally added here.

  4. +++ b/custom_markup_block.info.yml
    @@ -1,6 +1,6 @@
    -version: 8.x-1.0
    

    Remove the version indication is right, it is commented out by the Drupal package system, but should be addressed in a different issue.

  5. +++ b/tests/src/Functional/CustomMarkupBlockTestBase.php
    @@ -10,6 +10,14 @@ use Drupal\Tests\block\Functional\BlockTestBase;
    +  protected $defaultTheme = 'classy';
    

    According to this CR, the recommended default theme is Stark and should be used when possible.

    The install configuration of the block_test modules depends on the classy theme in Drupal < 9.0, so its value should be initialized during the setup depending on the Drupal core version.

manuel.adan’s picture

Status: Needs review » Needs work
sahana _n’s picture

Status: Needs work » Needs review
StatusFileSize
new964 bytes
new871 bytes

@Manuel Adán Thanks for the review.
I created a new patch with your suggestions, please review the patch.

manuel.adan’s picture

Assigned: sahana _n » Unassigned
StatusFileSize
new1.26 KB
new651 bytes

Default theme is now dynamically set based on the core main version.

Status: Needs review » Needs work
manuel.adan’s picture

Status: Needs work » Needs review
StatusFileSize
new1.24 KB

Wrong patch syntax.

  • manuel.adan committed 566d864 on 8.x-1.x
    Issue #3116999 by manuel.adan, Sahana _N: Drupal 9 compatibility
    
manuel.adan’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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