Issue #3098475 by Berdir, catch, TravisCarden, xjm, benjifisher, alexpott,...
Issue #3098475 by Berdir, catch, TravisCarden, xjm, benjifisher, alexpott, larowlan, dww: Add more strict checking of hook_update_last_removed() and better explanation
$ret[$module]['warning']='<em>'.$module.'</em> module cannot be updated. Its schema version is '.$schema_version.'. Updates up to and including '.$last_removed.' have been removed in this release. In order to update <em>'.$module.'</em> module, you will first <a href="https://www.drupal.org/upgrade">need to upgrade</a> to the last version in which these updates were available.';
$ret[$module]['warning']='<em>'.$module.'</em> module cannot be updated. It contains an update numbered as '.\Drupal::CORE_MINIMUM_SCHEMA_VERSION.' which is reserved for the earliest installation of a module in Drupal '.\Drupal::CORE_COMPATIBILITY.', before any updates. In order to update <em>'.$module.'</em> module, you will need to install a version of the module with valid updates.';
// If system.module is in the list then only show a specific message for
// Drupal core, otherwise show a more generic message for each module.
if(isset($module_list['system'])){
$requirements['system_update_last_removed']=[
'title'=>t('The version of Drupal you are trying to update from is too old'),
'description'=>t('Updating to Drupal @current_major is only supported from Drupal version @required_min_version or higher. If you are trying to update from an older version, first update to the latest version of Drupal @previous_major. (<a href=":url">Drupal 9 upgrade guide</a>)',[
'description'=>t('The installed version of the %module module is too old to update. Update to an intermediate version first (last removed version: @last_removed_version, installed version: @installed_version).',[
'%module'=>$data['name'],
'@last_removed_version'=>$data['last_removed'],
'@installed_version'=>$data['installed_version'],
]),
'severity'=>REQUIREMENT_ERROR,
];
}
}
}
return$requirements;
}
@@ -1263,11 +1311,3 @@ function system_update_8901() {
}
}
}
/**
* Ensures that Drupal is updated from a supported version.
*/
functionsystem_update_9000(){
// See update_get_update_list(), there needs to be at least one update
// function to check for the last removed schema version.