Bug #84016

impexp: page links are parsed / replaced incorrectely due to error in SoftReferenceIndex

Added by Markus Stauffiger almost 2 years ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Must have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2018-02-22
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
hard
Is Regression:
Sprint Focus:

Description

With the new handling of the link field in the backend, the page links, e.g. in the header_link field of a content element, are not parsed correctly and therefore not replaced during the import.

TYPO3 7

TYPO3 8

I think the problem is within the SoftReferenceIndex, so the bug might actually be in core and not impexp.

typo3_7.png View (61.2 KB) Markus Stauffiger, 2018-02-22 21:52

typo3_8.png View (63.5 KB) Markus Stauffiger, 2018-02-22 21:52

yuno_page.png View (97.4 KB) Markus Stauffiger, 2018-02-22 22:50

patch_gaya.diff View (9.41 KB) DANIEL Rémy, 2019-09-10 18:52


Related issues

Related to TYPO3 Core - Bug #85576: Linkvalidator not checking linked content elements with TypoLink Closed 2018-07-16
Related to TYPO3 Core - Bug #87652: SoftReferenceIndex :: TypoLink :: links like "t3:// FileLinks" won't be recognized Resolved 2019-02-05
Related to TYPO3 Core - Bug #88207: SoftReferenceIndex is missing support for t3://file uri Resolved 2019-04-25
Related to TYPO3 Core - Bug #83377: Soft Reference Index is broken for files Resolved 2017-12-18
Related to TYPO3 Core - Bug #86628: Linked files not referenced in backend filelist Resolved 2018-10-11

Associated revisions

Revision 916d1c60 (diff)
Added by Patrick Broens about 1 year ago

[BUGFIX] Linkvalidator validates linked content elements

This patch makes the LinkValidator check typolinks to tt_content
elements like t3://page?uid=x#y by calling InternalLinktype twice, once
for the page as first part of the SoftReferenceIndex and again for the
tt_content element as second part.

Resolves: #85576
Related: #84016
Releases: master, 8.7
Change-Id: I94243e66f5eff38c9a0b0859a85aac48885e38ba
Reviewed-on: https://review.typo3.org/57612
Reviewed-by: Stephan Großberndt <>
Tested-by: TYPO3com <>
Tested-by: Sybille Peters <>
Reviewed-by: Jörg Bösche <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

Revision 574914eb (diff)
Added by Patrick Broens about 1 year ago

[BUGFIX] Linkvalidator validates linked content elements

This patch makes the LinkValidator check typolinks to tt_content
elements like t3://page?uid=x#y by calling InternalLinktype twice, once
for the page as first part of the SoftReferenceIndex and again for the
tt_content element as second part.

Resolves: #85576
Related: #84016
Releases: master, 8.7
Change-Id: I94243e66f5eff38c9a0b0859a85aac48885e38ba
Reviewed-on: https://review.typo3.org/58735
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

Revision d208d09a (diff)
Added by DANIEL Rémy about 1 month ago

[BUGFIX] SoftReferenceIndex parses new TypoLink format correct

Since the introduction of the new TypoLink format like t3://page?uid=1
the SoftReferenceIndex is parsing these TypoLinks wrong, and does not
parse t3://record at all.

This patch adds the same parsing of typolinks than the one done by
LinkService, and removes old and duplicated code.

This patch also fixes the missing softref when a typolink contains an
anchor to a tt_content.

The signal `getTypoLinkParts` is removed from execution, because it
is not needed anymore, as all is handled via LinkService
capabilities directly.

Resolves: #84016
Releases: master, 9.5
Change-Id: I4b83cd43af938de084aebc1b4bf424e6bb2d9682
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/57610
Tested-by: TYPO3com <>
Tested-by: Georg Ringer <>
Tested-by: Benni Mack <>
Reviewed-by: Georg Ringer <>
Reviewed-by: Benni Mack <>

Revision 94da5755 (diff)
Added by DANIEL Rémy about 1 month ago

[BUGFIX] SoftReferenceIndex parses new TypoLink format correct

Since the introduction of the new TypoLink format like t3://page?uid=1
the SoftReferenceIndex is parsing these TypoLinks wrong, and does not
parse t3://record at all.

This patch adds the same parsing of typolinks than the one done by
LinkService, and removes old and duplicated code.

This patch also fixes the missing softref when a typolink contains an
anchor to a tt_content.

The signal `getTypoLinkParts` is removed from execution, because it
is not needed anymore, as all is handled via LinkService
capabilities directly.

Resolves: #84016
Releases: master, 9.5
Change-Id: I4b83cd43af938de084aebc1b4bf424e6bb2d9682
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62143
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Reviewed-by: Benni Mack <>

History

#1 Updated by Markus Stauffiger almost 2 years ago

  • Subject changed from impexp: page links are parsed / replaced correctely to impexp: page links are parsed / replaced incorrectely

#2 Updated by Markus Stauffiger almost 2 years ago

  • File yuno_page.png View added
  • Subject changed from impexp: page links are parsed / replaced incorrectely to impexp: page links are parsed / replaced incorrectely due to error in SoftReferenceIndex
  • Category changed from Import/Export (T3D) to Link Handling, Site Handling & Routing

The bug is within the SoftReferenceIndex.

Arriving at https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Database/SoftReferenceIndex.php#L499 $containsSlash || $isLocalFile it decides that a t3://page link is a local file and therefore does not get to the part where it's marked as a page.

#3 Updated by Markus Klein almost 2 years ago

Hi!

Thanks for reporting and analysis.

Can you push a patch with a solution?
(https://docs.typo3.org/typo3cms/ContributionWorkflowGuide/ if you need a first-time setup)

#4 Updated by DANIEL Rémy over 1 year ago

@Markus Klein, I've quickly patched the SoftReferenceIndex for a single usecase.

But it seems SoftReferenceIndex needs a huge rewrite because the new link handling (t3://) is not well handled by the SoftReferenceIndex.
For example, a link in tt_content.header_link (typolink) or in tt_content.bodytext (typoling_tag) will not be referenced the same way in the database.
Also, a link to a record (t3://record) is not referenced at all.

I think I'm not the guy who can handle this rewrite because it too difficult for my skills...

#5 Updated by DANIEL Rémy over 1 year ago

  • Complexity changed from medium to hard

#6 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57610

#7 Updated by Patrick Broens over 1 year ago

Also the core extension "linkvalidator" is suffering from this.

To reproduce:
  • Install the extension "linkvalidator"
  • Make a content element on a page with the field "header_link" filled with t3://page?uid=5000, where 5000 is a non existing page in your database
  • Go to the module "Web > Info > Linkvalidator" and check the links on the page
  • The page mentioned in this field will not show up in the report or in the "Internal links" counter.

You can do the same with t3://file?uid=5000

TypoLinks used in the RTE in an anchor tag are fine.

#8 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57610

#9 Updated by Patrick Broens over 1 year ago

  • Related to Bug #85576: Linkvalidator not checking linked content elements with TypoLink added

#10 Updated by Patrick Broens over 1 year ago

  • Related to Epic #85006: Reduce falsely reported broken links added

#11 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57610

#12 Updated by Gerrit Code Review about 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57610

#13 Updated by Gerrit Code Review about 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57610

#14 Updated by Gerrit Code Review about 1 year ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57610

#15 Updated by Gerrit Code Review about 1 year ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57610

#16 Updated by Gerrit Code Review about 1 year ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57610

#17 Updated by Gerrit Code Review 12 months ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57610

#18 Updated by DANIEL Rémy 3 months ago

I've fixed this issue, and another one about handling of the anchor in links for a specific project.
I've attached the patch for the fix, it may be useful.

#19 Updated by Markus Klein 3 months ago

@Daniel Would you mind pushing your patch to the review system?

#20 Updated by DANIEL Rémy 3 months ago

There is already a patch in review: https://review.typo3.org/c/Packages/TYPO3.CMS/+/57610/

Should I amend the existing patch?

#21 Updated by Markus Klein 3 months ago

Sure, feel free

#22 Updated by Gerrit Code Review 3 months ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/57610

#23 Updated by Gerrit Code Review 3 months ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/57610

#24 Updated by Gerrit Code Review 3 months ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/57610

#25 Updated by Gerrit Code Review 3 months ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/57610

#26 Updated by Gerrit Code Review 3 months ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/57610

#27 Updated by Gerrit Code Review about 2 months ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/57610

#28 Updated by Gerrit Code Review about 1 month ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/57610

#29 Updated by Gerrit Code Review about 1 month ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/57610

#30 Updated by Benni Mack about 1 month ago

  • Related to Bug #87652: SoftReferenceIndex :: TypoLink :: links like "t3:// FileLinks" won't be recognized added

#31 Updated by Benni Mack about 1 month ago

  • Related to Bug #88207: SoftReferenceIndex is missing support for t3://file uri added

#32 Updated by Gerrit Code Review about 1 month ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62143

#33 Updated by Gerrit Code Review about 1 month ago

Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62143

#34 Updated by DANIEL Rémy about 1 month ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#35 Updated by Benni Mack about 1 month ago

  • Related to Bug #83377: Soft Reference Index is broken for files added

#36 Updated by Benni Mack about 1 month ago

  • Related to Bug #86628: Linked files not referenced in backend filelist added

#37 Updated by Sybille Peters 28 days ago

  • Related to deleted (Epic #85006: Reduce falsely reported broken links)

Also available in: Atom PDF