Skip to content
Snippets Groups Projects
Commit 90579427 authored by Florian Weber's avatar Florian Weber
Browse files

Issue #3076170 by webflo: Prevent notice/error if composer_deploy_git_hash is not found.

parent ba03fe8f
No related branches found
No related tags found
No related merge requests found
Pipeline #309084 passed with warnings
......@@ -93,16 +93,22 @@ function composer_deploy_preprocess_update_project_status(&$variables) {
$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') {
$currentVersion = $projectData['composer_deploy_git_hash'];
}
$currentVersion = $variables['project']['existing_version'];
// Replace our current version with the specific hash when on -dev release.
if (str_ends_with($variables['project']['existing_version'], 'dev')) {
$currentVersion = $projectData['composer_deploy_git_hash'] ?? NULL;
}
// Unable to detect current version (git reference)
if ($currentVersion === NULL) {
return;
}
foreach ($variables['versions'] as &$version) {
$upstreamVersion = $version['#version']['tag'];
// When the upstream is using dev, switch to branch tag.
if (substr($version['#version']['tag'], -3) == 'dev') {
if (str_ends_with($version['#version']['tag'], 'dev')) {
$upstreamVersion = substr($version['#version']['tag'], 0, -4);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment