Skip to content

Commit

Permalink
More helpfull comments and readme around Drupal 10 support
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrala committed Sep 24, 2023
1 parent 2dfe588 commit 91b1ae5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Automate fixing deprecated Drupal code.

### Release notes

* The 0.18.0 and higher releases of drupal-rector will include Rector 0.18+. The upgrade path should be as simple as re-copying the configuration file. `cp vendor/palantirnet/drupal-rector/rector.php`.

> [!WARNING]
> Drupal rector does not support Drupal 10.0 specifically because this will break support for backwards compatible fixes for which the helpers were introduced in Drupal 10.1. Older and newer versions of Drupal are supported.
* The 0.13.0 and higher releases of drupal-rector will include Rector 0.13.8+. The upgrade path should be as simple as re-copying the configuration file. `cp vendor/palantirnet/drupal-rector/rector.php`

*Note that GitHub does not let us have different default homepage and merge branches. If you checked out the project using packagist/composer, read the docs for your version.*
Expand Down
9 changes: 7 additions & 2 deletions src/Rector/AbstractDrupalCoreRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ public function refactor(Node $node)
continue;
}

// Check if Drupal version and the introduced version support backward compatible calls.
if (version_compare($drupalVersion, '10.1.0', '<') || version_compare($configuration->getIntroducedVersion(), '10.1.0', '<')) {
// Check if Drupal version and the introduced version support backward
// compatible calls. Although it was introduced in Drupal 10.1 we
// also supply these patches for changes introduced in Drupal 10.0.
// The reason for this is that will start supplying patches for
// Drupal 10 when 10.0 is already out of support. This means that
// we will not support running drupal-rector on Drupal 10.0.x.
if (version_compare($drupalVersion, '10.1.0', '<') || version_compare($configuration->getIntroducedVersion(), '10.0.0', '<')) {
return $result;
}

Expand Down

0 comments on commit 91b1ae5

Please sign in to comment.