Issue Bug Closed

#103691Rechecking links after edit in linkvalidator will always result in link being removed because of wrong linktypes

Sybille Peters 04/21/24, 05:21 updated 12/02/25, 14:33

Description

Reproduce

1. On pages with broken links, run “Check links” in the linkvalidator module
2. Jump to “Report” and click “edit” action button for one of the links
3. Change the link – but make sure it is still broken
4. Save and close

The broken links should now still be in the list of broken links, but it is removed

Analyze

The reason that this happens is that wrong linktypes array is passed to the function LinkAnalyzer::checkLinks.

In function checkLinks, compare value of second parameter $linkTypes.

1. On full check:

LinkvalidatorController calls LinkAnalyzer::getLinkStatistics()

with first parameter $linkTypes (which is a modified list of $this->checkOpt[‘check’] where the link type is the value, not the array

LinkAnalyzer::checkLinks is called with second parameter $linkTypes:

[
  0 => 'external'
  1 => 'file'
  2 => 'db'
]

2. On recheck

LinkvalidatorController calls LinkAnalyzer::recheckLinks()

with first parameter $this->checkOpt[‘check’]

[
  'external' => 1
  'file' => 1
  'db' => 1
]

Versions

  • v11
  • v12
  • v13

Reviews 2

History 513

  1. Sybille Peters changed description 04/21/24, 05:44

  2. Gerrit Code Review pushed patch set 7 for main to change 83613 status New Under Review 04/21/24, 06:03

  3. Sybille Peters changed priority Should have Must have 04/21/24, 06:09

  4. Gerrit Code Review pushed patch set 8 for main to change 83613 10/18/24, 14:06

  5. Gerrit Code Review pushed patch set 9 for main to change 83613 12/06/24, 14:39

  6. Sybille Peters commented 12/06/24, 14:44

    This is still reproducible (see steps to reproduce)

  7. Gerrit Code Review pushed patch set 10 for main to change 83613 12/06/24, 14:53

  8. Gerrit Code Review pushed patch set 11 for main to change 83613 02/11/25, 21:32

  9. Gerrit Code Review pushed patch set 12 for main to change 83613 03/23/25, 22:52

  10. Gerrit Code Review pushed patch set 13 for main to change 83613 03/27/25, 21:14

  11. Gerrit Code Review pushed patch set 1 for 13.4 to change 88812 03/27/25, 21:28

  12. Sybille Peters commented and changed status Under Review Resolved done 0 % 100 % 03/27/25, 21:30

    Applied in changeset commit:7d54e40607ed21c8b2a2c655f4db686f09014df1.

  13. Benni Mack changed status Resolved Closed 12/02/25, 14:33