Link in 'missing core_version_requirement' report not working

Created on 26 February 2023, over 1 year ago
Updated 14 March 2023, over 1 year ago

I still have to check if this is also a problem in dev version. I could not find an issue describing this problem.
Also if a solution is agreed upon I could make the time to write a patch for this, would be good to contribute something back to upgrade_status, a life saving contrib module!

Problem/Motivation

The text of the report about a missing core_version_requirement has a link that includes a dot after the otherwise correct link. Easily worked around with just removing the . from the browsers address bar. But might also be easy to correct.

Steps to reproduce

Scan a project without a core_version_requirement and check the problems. The following text is shown:

Add core_version_requirement: ^8 || ^9 to designate that the extension is compatible with Drupal 9. See https://drupal.org/node/3070687..

Also see screenshot. When the link is clicked, you arrive at a 404 page because the address has a trailing '.' .Also strange the text ends on a double . , no?
Using the Claro (8.9.20) admin theme.

Proposed resolution

In upgrade_status/src/ExtensionMetadataDeprecationAnalyzer.php line 54 :
$deprecations[] = new DeprecationMessage("Add core_version_requirement: ^8 || ^9 to designate that the extension is compatible with Drupal 9. See https://drupal.org/node/3070687.", $error_path, 0);
Just remove the . after the link? This then of course also be done in the two tests in upgrade_status/tests/src/Functional/UpgradeStatusAnalyzeTest.php

Probably the same would have to happen in other messages as well

Remaining tasks

Identify affected messages.
find best solution
apply solution

User interface changes

Working links without an extra '.' .

API changes

none?

Data model changes

none?

🐛 Bug report
Status

Closed: duplicate

Version

3.18

Component

Code

Created by

🇳🇱Netherlands firfin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @firfin
  • Status changed to Needs review over 1 year ago
  • 🇭🇺Hungary Zsuffa Dávid

    I run into the same issue. I solved it by modifying the regexp formatting the link. Patch attached.

    before:
    $formatted_error = preg_replace('!See (https://drupal.org(.\S+))(\.|$)!', 'See <a href="\1">\1<a>.', $formatted_error);

    after:
    $formatted_error = preg_replace('!See (https://drupal.org(.\S+))(\.$)!', 'See <a href="\1">\1<a>.', $formatted_error);

    diff:
    (\.|$)
    (\.$)

  • Status changed to Closed: duplicate over 1 year ago
  • 🇭🇺Hungary Gábor Hojtsy Hungary

    Closing as duplicate of 🐛 Drupal.org documentation links broken in ScanResultFormatter.php Fixed , will transfer your credits there.

Production build 0.69.0 2024