Problem/Motivation
Found a bug in the functionality introduced at
#3096078: Display core compatibility ranges for available module updates β
. If your locally installed version of core is a -dev release, none of the code that displays core compatibility for the contribs installed on your site will fire. That's because of this:
core/modules/update/src/ProjectCoreCompatibility.php
public function setReleaseMessage(array &$project_data) {
if (empty($this->possibleCoreUpdateVersions)) {
return; // Whoops, shouldn't return here just because there are no available updates for core. :(
}
...
}
possibleCoreUpdateVersions is populated with this logic:
protected function getPossibleCoreUpdateVersions(array $core_releases) {
if (!isset($core_releases[$this->existingCoreVersion])) {
// If we can't determine the existing version of core then we can't
// calculate the core compatibility of a given release based on core
// versions after the existing version.
return [];
}
$core_release_versions = array_keys($core_releases);
$possible_core_update_versions = Semver::satisfiedBy($core_release_versions, '>= ' . $this->existingCoreVersion);
$possible_core_update_versions = Semver::sort($possible_core_update_versions);
$possible_core_update_versions = array_filter($possible_core_update_versions, function ($version) {
return VersionParser::parseStability($version) === 'stable';
});
return $possible_core_update_versions;
}
If you're using the -dev release of the currently stable core (e.g. 8.8.6-dev at the time of this writing), you end up with an empty array. There are no 'stable' releases that satisfy ">= 8.8.6-dev" right now. Only once 8.9.0 and/or 9.0.0 are out will there be anything else in the $core_release_versions
list that satisfies that constraint. With this list empty, none of the rest of the plumbing works.
Proposed resolution
TBD. Something like:
If you're on the end of the stable core branch, use the last stable release from that branch for the compatibility messages (all of which should continue to be visible).
Remaining tasks
- Decide exactly what to do.
- Do it.
- Add/update test coverage.
- Reviews.
- RTBC.
- Commit.
User interface changes
TBD.
API changes
Nothing public.
Data model changes
None.
Release notes snippet
TBD.