Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking internal links to current page with missing anchor is not reported as broken link #262

Open
sypets opened this issue May 31, 2023 · 0 comments
Labels
is::bug Something isn't working wontfix This will not be worked on

Comments

@sypets
Copy link
Owner

sypets commented May 31, 2023

Note: Same bug exists in linkvalidator. Is most likely due to problem in link (softref) parsing in core. Will not fix in brofix.

Describe the bug

This is reported as broken link (assuming CE #999999999 does not exist on page 27):

<p><a href="t3://page?uid=27#999999999">link to another page with missing anchor</a></p>

This is not reported as broken link (assuming CE #999999999 does not exist on current page):

<p><a href="t3://page?uid=current#99999999">link to current page with missing anchor</a></p>

To Reproduce
Steps to reproduce the behavior:

  1. Create a link
  2. Switch to source code mode in RTE. Remove the string within the quotes in href="", save
  3. The link will now be converted to an internal link to current page (e.g. t3://page?uid=current)
  4. Add an anchor to a non existing CE to the link (e.g. t3://page?uid=current#99999)
  5. Check internal broken links on current page

Actual behavior

The link is not diplayed as broken.

Expected behavior

The link should be displayed as broken. (This is the case for links with missing CE if a format such as t3://page?uid=123#9999 is used for an existing page with uid 123 which does not have a CE 9999.)

System (please complete the following information):

  • TYPO3 version: 11.5 (latest), main
  • brofix version: latests
  • page_callouts version: not relevant
  • installed with Composer: not relevant

Additional context

As described in the forge issue:

This seems to be due to TypolinkTagSoftReferenceParser::parse not considering links with the format t3://page?uid=current#99999999. This function is called in linkvalidator. The parser does not return the t3://page?uid=current links.

So it looks like not an error in linkvalidator, but an error in the link parser.

code:

} elseif ($linkDetails['type'] === LinkService::TYPE_PAGE && preg_match('/page\?uid=(\d+)#?(\d+)?/', $matches[1], $pageAndAnchorMatches)) {

https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/DataHandling/SoftReference/TypolinkSoftReferenceParser.php

@sypets sypets added is::bug Something isn't working wontfix This will not be worked on labels May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is::bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant