Commit 3cd5cdc1 authored by drumm's avatar drumm
Browse files

Fix error when previewing new release nodes

parent 61203e2c
......@@ -5627,8 +5627,7 @@ function drupalorg_preprocess_field(&$v) {
$text = $release_wrapper->field_release_build_type->value() === 'dynamic' ? t('Git branch') : t('Git tag');
$v['items'][0]['#prefix'] = '<img src="' . url(drupal_get_path('module', 'drupalorg') . '/images/vcs_label/' . $release_wrapper->field_release_build_type->value() . '.svg') . '" alt="' . $text . '" title="' . $text . '" class="icon-inline gray"> ';
// Link to Git repository.
if ($vcs_label = $release_wrapper->field_release_vcs_label->value()) {
$repository = versioncontrol_repository_load($release_wrapper->field_release_project->value()->versioncontrol_project['repo_id']);
if (($vcs_label = $release_wrapper->field_release_vcs_label->value()) && ($repository = versioncontrol_project_repository_load($release_wrapper->field_release_project->raw()))) {
$v['items'][0]['#markup'] = l($v['items'][0]['#markup'], $repository->getUrlHandler()->getRepositoryViewUrl((object) ['name' => $vcs_label]), [
'external' => TRUE,
]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment