Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add drupal 9 support #152

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

mathg
Copy link

@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

tormi commented Jan 5, 2022

@deesonlee
Copy link

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);

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;

@@ -193,6 +193,11 @@ public function processRequestData($requestData) {
$recommendedMajorVersion = (string) $requestXmlObject->recommended_major;
$supportedMajor = (string) $requestXmlObject->supported_majors;
$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

Choose a reason for hiding this comment

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

Bad intendation.

@@ -210,6 +215,10 @@ public function processRequestData($requestData) {
/*if (!is_null($versionInfo['extra'])) {
continue;
}*/
}elseif(preg_match('/^(' . implode('|', $supportedMajorVersions) . ')/', $release->version, $matches)){

Choose a reason for hiding this comment

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

Style problems with spacing.

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