Problem/Motivation
Right now the Update module will always recommend the latest version in the current major that is installable, meaning published, secure, in a supported branch and support itself.
though there are some bugs, like #3227518: Never show a "Not supported!" version as "Recommended"
This is going to be problem for Automatic Updates when it is in core because the MVP will only support patch release not upgrading to different minor. see #3252187: Deal with Core UPdate module recommending the latest release in the major version not the latest in the Minor version
For example if:
- the site is on Drupal core 9.5.1
- 9.5.x and 9.6.x are the 2 supported branches of core
- The latest release in each branch is 9.5.2 and 9.6.2
- Then the UPdate module will use 9.6.2 as the "Recommended version"
- This will not be supported by the MVP for Automatic Updates because this would be updating to different minor. We will only support patch updates
Steps to reproduce
currently based on https://updates.drupal.org/release-history/drupal/current
If a site where on 9.1.13 the Update would not recommend 9.1.14. It would recommend 9.2.10. You can test by faking the drupal version Drupal.php
Proposed resolution
in the long term it would be good if the Update module recommend a version in the current minor and then in any other minor that is supported(for core that will usually be 2) in the same major. But this will major need refactoring of the Update reports.
For now we should simple change update_calculate_project_update_status() to store all the info about installable releases in $project_data
which it modifies. This will allow other modules like Automatic Updates in contrib and in the core version which should be started soon to pick a version in the current minor that we know is secure and supported.
update_calculate_project_update_status() already has all the information it needs to do this.