Skip to content
Snippets Groups Projects

Issue #3412035: Fix fatal error in project update status

1 file
+ 9
2
Compare changes
  • Side-by-side
  • Inline
+ 9
2
@@ -83,10 +83,17 @@ function composer_deploy_preprocess_update_project_status(&$variables) {
if (!in_array($project_type, ['module', 'theme'])) {
return;
}
$projectData = \Drupal::service('extension.list.' . $project_type)->getExtensionInfo($variables['project']['name']);
foreach ($variables['versions'] as &$version) {
// All extensions (modules, themes, etc.) in a project have the same metadata
// because they share the same source repository. The metadata is provided by
// composer_deploy_system_info_alter().
// Therefore, the first extension from the project is used to get the git-metadata
// for the whole project.
$projects = \Drupal::service('update.manager')->getProjects();
$extensionName = array_key_first($projects[$variables['project']['name']]['includes']);
$projectData = \Drupal::service('extension.list.' . $project_type)->getExtensionInfo($extensionName);
foreach ($variables['versions'] as &$version) {
$currentVersion = $variables['project']['existing_version'];
// Replace our current version with the specific hash when on -dev release.
if (substr($variables['project']['existing_version'], -3) == 'dev') {
Loading