-
Notifications
You must be signed in to change notification settings - Fork 18
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
base: develop
Are you sure you want to change the base?
add drupal 9 support #152
Conversation
What's the status of this? Looks like using Related Drupal core issues: |
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); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style problems with spacing.
There was a problem hiding this comment.
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)) {
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.