Skip to content

add drupal 9 support#152

Open
mathg wants to merge 1 commit intoteamdeeson:developfrom
cossette:feature/drupal-9-support
Open

add drupal 9 support#152
mathg wants to merge 1 commit intoteamdeeson:developfrom
cossette:feature/drupal-9-support

Conversation

@mathg
Copy link
Copy Markdown

@mathg mathg commented Sep 2, 2021

Minor changes to enable drupal 9 updates. Update XML file for /9.x doesn't exist, needed to fallback to /current instead. This solution might be temporary but it works at the moment.

@tormi
Copy link
Copy Markdown

tormi commented Jan 5, 2022

@deesonlee
Copy link
Copy Markdown

Thank you for this, we are currently in the process of updating Warden Server to Symfony 5.4 LTS, this PR will be included as part of this update.

return 'bundles/deesonwardendrupal/images/drupal7-logo.png';
}
// Grab first digits before first dot
preg_match("/^(\d)*?\./", $this->getCoreVersion(), $matches);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect it fails with Drupal 10, because the regex would capture only 0, skipping 1.
I suggest to use /^(\d+)\./. It's also easier to read.
Another alternative would be:

$version = $explode('.', $this->getCoreVersion())[0];
$version = empty($version) ? 8 : $version;

$supportedMajorVersions = explode(',', $supportedMajor);
} else {
// TODO This will need to be reworked once Drupal 10 is out
// In the current xml file, supported_majors key doesn't exist
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad intendation.

/*if (!is_null($versionInfo['extra'])) {
continue;
}*/
}elseif(preg_match('/^(' . implode('|', $supportedMajorVersions) . ')/', $release->version, $matches)){
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style problems with spacing.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This RX is hard to read.
I suggest:

$rx = implode('|', $supportedMajorVersions);
$rx = "/^($rx)/";
...
} elseif (preg_match($rx, $release->version, $matches)) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants