Question

On the project page of a Drupal module there is a list of releases. The project owner can set for each one whether it is recommended, and the page displays that fact. For example if there are releases 2.0 and 3.0, it's possible for either one to be recommended or both.

I would like to know which releases are recommended without having to visit the project page of each module one-by-one. I would be interested in any type of answer: GUI, command line, API, etc.

I have already tried

  • The GUI (/admin/reports/updates). It lists releases that are "also available" but does not indicate which are recommended.
  • composer. It seems to have no idea of recommended. With my settings, it appears to pick the newer release except if it is less stable.
  • drush. In drush 8, the rl command lists recommended releases but seems to be broken with current Drupal 8. Newer drush does not have this command.
  • Code. The return value of update_get_available() or update_calculate_project_data() don't seem to contain this information.
Was it helpful?

Solution

As described in Update status XML, Drupal.org returns information about project releases, including the recommended major version, as XML output. For example, the first XML elements returned from https://updates.drupal.org/release-history/imagemagick/8.x are the following one.

<title>ImageMagick</title>
<short_name>imagemagick</short_name>
<dc:creator>sun</dc:creator>
<type>project_module</type>
<api_version>8.x</api_version>
<recommended_major>3</recommended_major>
<supported_majors>3</supported_majors>
<default_major>3</default_major>
<project_status>published</project_status>

<recommended_major>3</recommended_major> is referring to any version matching 8.x-3.*.

Unfortunately, that information isn't returned from https://updates.drupal.org/release-history/imagemagick/current or any URL matching https://updates.drupal.org/release-history/*/current.

<title>ImageMagick</title>
<short_name>imagemagick</short_name>
<dc:creator>sun</dc:creator>
<type>project_module</type>
<supported_branches>8.x-3.</supported_branches>
<project_status>published</project_status>
<link>https://www.drupal.org/project/imagemagick</link>
Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top