Commit 4aa22004 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

Issue #3169792 by Gábor Hojtsy, Grimreaper: The extension machine name is used...

Issue #3169792 by Gábor Hojtsy, Grimreaper: The extension machine name is used for links and update checking instead of the project name
parent 857ac8c8
......@@ -455,7 +455,9 @@ class UpgradeStatusForm extends FormBase {
'label' => [
'#type' => 'markup',
// Display Drupal 9 pland or issue search if there was no plan.
'#markup' => !empty($report['plans']) ? $report['plans'] : '<a href="https://drupal.org/project/issues/' . $name . '?text=Drupal+9&status=All">' . $this->t('Drupal.org issue search') . '</a>',
// Use the project name from the info array instead of $key.
// $key is the local name, not necessarily the project name.
'#markup' => !empty($report['plans']) ? $report['plans'] : '<a href="https://drupal.org/project/issues/' . $extension->info['project'] . '?text=Drupal+9&status=All">' . $this->t('Drupal.org issue search') . '</a>',
],
]
];
......
......@@ -271,7 +271,8 @@ class ProjectCollector {
// Add available update information to contrib projects found.
if ($extension->info['upgrade_status_type'] == self::TYPE_CONTRIB) {
$project_update = $this->availableUpdates->get($name);
// Look up by drupal.org project info not $name because the two may be different.
$project_update = $this->availableUpdates->get($extension->info['project']);
if (!isset($project_update['releases']) || is_null($project_update['releases'])) {
// Releases were either not checked or not available.
$projects[$name]->info['upgrade_status_update'] = $update_check_for_uninstalled ? self::UPDATE_NOT_AVAILABLE : self::UPDATE_NOT_CHECKED;
......
......@@ -4,4 +4,4 @@ description: 'Support module for upgrade status module testing.'
package: Testing
version: VERSION
core_version_requirement: ^8 || ^9
project: 'upgrade_status_test_contrib_no_error'
project: 'upgrade_status_test_contributed_no_error'
......@@ -60,6 +60,8 @@ class UpgradeStatusUiTest extends UpgradeStatusTestBase {
// Contrib test modules should show with results.
$this->assertSame('2 problems', strip_tags($page->find('css', 'tr.project-upgrade_status_test_contrib_error td.scan-result')->getHtml()));
$this->assertSame('No problems found', strip_tags($page->find('css', 'tr.project-upgrade_status_test_contrib_no_error td.scan-result')->getHtml()));
// This contrib module has a diferrent project name. Ensure the drupal.org link used that.
$this->assertSession()->linkByHrefExists('https://drupal.org/project/issues/upgrade_status_test_contributed_no_error?text=Drupal+9&status=All');
// Click the first '4 problems' link. Should be the contrib project.
$this->clickLink('4 problems');
......
Markdown is supported
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