Bug #81804

old linkhandler link-syntax prevents irre records from opening

Added by Maik Peuser over 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2017-07-05
Due date:
% Done:

100%

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

Description

After upgrading a TYPO3 6.2 with Linkhandler and links to records we upgraded to 7.6 and 8.7.
The updated went smooth except the migration of the old link-formats to new t3://...

We had a few rte links with the old linkhandler syntax which caused the already posted bug "The RecordLinkHandler expects identifier and uid as $parameter configuration." Since we couldn't fix the upgrade wizard we manually converted those rte links.

What we noticed after that, a few textpic content elements had those links inside irre-elements for images (link field).
After we ran the upgrade wizard those old links were still present.

If you now open those irre elements it ends with an 500 error:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: Argument 2 passed to TYPO3\CMS\Core\Imaging\IconFactory::getIconForRecord() must be of the type array, null given, called in /var/www/vendor/typo3/cms/typo3/sysext/backend/Classes/Form/Element/InputLinkElement.php on line 399 | TypeError thrown in file /var/www/www/vendor/typo3/cms/typo3/sysext/core/Classes/Imaging/IconFactory.php in line 137. Requested URL: http://XXX/typo3/index.php?ajaxID=%2Fajax%2Frecord%2Finline%2Fdetails&ajaxToken=b40a76c63b537258c1209fb24f979c30ca1de664

Sorry since i now have 3 proposals for fixes in the core

1. Link field in sys_file_reference was not migrated to new syntax, which should be possible since its a simple replace of old to new format.
2. If someone got that old syntax or any other unknown link-format that InputLinkElement there shouldn't trigger an exception since you can only fix this by manually change it in the database.
3. Additionally, if the format couldn't be detected, add an icon for this "unknown" link format as indicator to fix it.

As a minimum i would hope for catching this exception since you can only find the source by manually checking the database for this.

Associated revisions

Revision aa4ce89d (diff)
Added by Alexander Opitz almost 2 years ago

[BUGFIX] Show links to missing records in InputLink

If the linked record wasn't found (wrong uid, removed from database) we
check before trying to gather an icon for the non-existing record.

Resolves: #81804
Releases: master, 8.7
Change-Id: Ie06ec8a614650d8147f143cda8d8e6a9cb3e98e9
Reviewed-on: https://review.typo3.org/55751
Reviewed-by: Andreas Wolf <>
Tested-by: Andreas Wolf <>

Revision a5e8ce4c (diff)
Added by Alexander Opitz almost 2 years ago

[BUGFIX] Show links to missing records in InputLink

If the linked record wasn't found (wrong uid, removed from database) we
check before trying to gather an icon for the non-existing record.

Resolves: #81804
Releases: master, 8.7
Change-Id: Ie06ec8a614650d8147f143cda8d8e6a9cb3e98e9
(cherry picked from commit aa4ce89d5263d5258ae8e35dc5daeb9eb9fae561)
Reviewed-on: https://review.typo3.org/55789
Reviewed-by: Andreas Wolf <>
Tested-by: Andreas Wolf <>

History

#1 Updated by Maik Peuser over 2 years ago

Additionally if you have this syntax not inside a irre field but directly in a linkfield you even cannot edit the element since it throws the same exception when you open the element for editing (since the same InputLinkElement is used)

#2 Updated by Christian Kuhn about 2 years ago

  • Status changed from New to Needs Feedback

Hmm, as far as i remember, ext:linkhandler adds stuff to the link syntax the core does not handle on its own (correct me if i'm wrong). If that is the case, it would be a task of ext:linkhandler to bring an update wizard moving these specifics over to the new syntax.

#3 Updated by Maik Peuser about 2 years ago

Thats right, it adds custom linkhandling, the migration is indeed in this case more a task for linkhandler itself. The handling of this exceptions is imho a matter of core. Moreover the problem is only the handling of the icon since the link cannot get parsed by the core and it fires an exception because no available icon can be found.

#4 Updated by Alexander Opitz almost 2 years ago

  • Status changed from Needs Feedback to In Progress

To validate:
In List Module in the Styleguide Tree use "element basic" > "input_29" and use for example "record:ident:tt_content:50000" as value.

#5 Updated by Gerrit Code Review almost 2 years ago

  • Status changed from In Progress 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/55751

#6 Updated by Alexander Opitz almost 2 years ago

  • Assignee set to Alexander Opitz

#7 Updated by Gerrit Code Review almost 2 years 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/55751

#8 Updated by Gerrit Code Review almost 2 years 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/55751

#9 Updated by Alexander Opitz almost 2 years ago

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

#10 Updated by Gerrit Code Review almost 2 years ago

  • Status changed from Resolved to Under Review

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

#11 Updated by Alexander Opitz almost 2 years ago

  • Status changed from Under Review to Resolved

#12 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF