Bug #80806

Upgrade Wizard / Execute database migrations on single rows / Error: The RecordLinkHandler expects identifier and uid as $parameter configuration

Added by Christian Toffolo over 3 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Install Tool
Target version:
Start date:
2017-04-11
Due date:
% Done:

100%

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

Description

When I run "Upgrade Wizard / Execute database migrations on single rows" I get this error
"The RecordLinkHandler expects identifier and uid as $parameter configuration"

I debugged and found that the upgrade wizard calls $linkService->resolve($link) that returns

$linkParts = [
    type = "record",
    url = [
        identifier = "tx_ianshop",
        table = "tx_ianshop_domain_model_product",
        uid = "2",
    ]
]

with $link="record:tx_ianshop:tx_ianshop_domain_model_product:2"

then calls $linkService->asString($linkParts)
that calls \TYPO3\CMS\Core\LinkHandling\RecordLinkHandler::asString
that expect an array like

$parameters = [
    identifier = "tx_ianshop",
    uid = "2",
]

instead it receives the array $parameters = $linkParts.


Related issues

Related to TYPO3 Core - Bug #79647: Add hooks to enable extension using the old typoLinkHandler syntax to migrate dataClosed2017-02-06

Actions
Related to TYPO3 Core - Task #66373: Extend typolink to handle record linksClosedMarkus Klein2015-04-10

Actions
Related to TYPO3 Core - Task #66374: Ensure the softref parser properly handles record linksClosedMarkus Klein2015-04-10

Actions
Has duplicate TYPO3 Core - Bug #80807: Upgrade Wizard / Execute database migrations on single rows / Error: The RecordLinkHandler expects identifier and uid as $parameter configurationClosed2017-04-11

Actions
#1

Updated by Morton Jonuschat over 3 years ago

  • Has duplicate Bug #80807: Upgrade Wizard / Execute database migrations on single rows / Error: The RecordLinkHandler expects identifier and uid as $parameter configuration added
#2

Updated by Benni Mack over 3 years ago

  • Target version changed from 8 LTS to next-patchlevel
#3

Updated by Bernhard Eckl over 3 years ago

Same here when upgrading from 7.6.16 to 8.7.2.
I have the linkhandler extension installed.

#4

Updated by Christoph Lehmann over 3 years ago

A little bit lazy, but works with

if (empty($parameters['identifier']) || empty($parameters['uid'])) {
$new = explode(":", $parameters['value']);
if (count($new) == 2) {
$parameters['identifier'] = $new[0];
$parameters['uid'] = $new[1];
}
}

in typo3_src-8.7.4/typo3/sysext/core/Classes/LinkHandling/RecordLinkHandler.php:39

#5

Updated by Christoph Lehmann over 3 years ago

In the end i think it's not really a core issue and more an extension issue.

#6

Updated by Joerg Kummer almost 3 years ago

If you use AOE link handler and have links in your DB entries like

<link record:tx_anyextension_model:123 ...

you need to change these links befor running Upgrade Wizard 'Execute database migrations on single rows' - else this upgrade wizard will never finish its purpose.

#7

Updated by Tobias Schmidt almost 3 years ago

If you're right in the middle of an update and need a quick fix for this problem I recommend to apply the following patch to method transformLinkTagsIfFound in file /typo3/sysext/install/Classes/Updates/RowUpdater/RteLinkSyntaxUpdater.php:180 and run the upgrade wizard again:

$linkParts = $linkService->resolve($link);
if (
    array_key_exists('type', $linkParts) &&
    $linkParts['type'] === LinkService::TYPE_RECORD &&
    array_key_exists('url', $linkParts) &&
    is_array($linkParts['url'])) {
    $linkParts['identifier'] = $linkParts['url']['identifier'];
    $linkParts['uid'] = $linkParts['url']['uid'];
}
$anchorTagAttributes['href'] = $linkService->asString($linkParts);

This just adds an condition to check for links like record:tx_news:tx_news_domain_model_news:1234.

#8

Updated by Marc Bastian Heinrichs over 2 years ago

  • Related to Bug #79647: Add hooks to enable extension using the old typoLinkHandler syntax to migrate data added
#9

Updated by Marc Bastian Heinrichs over 2 years ago

Trapped into this, too. Added my patch to #79647

#10

Updated by J. Peter M. Schuler over 2 years ago

Made #note-7 available as https://github.com/jpmschuler/install/commit/e9d12ba38d30635f02f326b0aeae9458589eaebe.patch for easier composer patching in the meanwhile.

As this Install Tool step is mandatory and it throws an exception just because stupid RTE content exists, it is a core issue IMHO. It is okay to not parse the extensions links at all, but chocking to death is a core issue.

#11

Updated by Tizian Schmidlin over 2 years ago

I can confirm that this issue still exists.

I'd propose that, if this cannot be considered a core issue, an update helper extension is built and distributed with the core update (could be registered as require-dev in composer mode), this would probably help some people.

In the meantime JPM's patch seems to work as expected :-)

#12

Updated by Markus Gehrig about 2 years ago

If the bugfix of Tobias Schmidt and J. Peter M. Schuler isn't working try following Patch:

if (
   array_key_exists('type', $linkParts) &&
   $linkParts['type'] === LinkService::TYPE_RECORD  &&
   array_key_exists('url', $linkParts)  &&
   is_array($linkParts['url'])
   ) {
   $linkPartsClean['identifier'] = $linkParts['url']['identifier'];
   $linkPartsClean['uid'] = $linkParts['url']['uid'];

   $linkParts = $linkPartsClean;
}

$anchorTagAttributes['href'] = $linkService->asString($linkParts);

#13

Updated by Markus Klein about 2 years ago

  • Status changed from New to Accepted
  • Assignee set to Markus Klein

This is a core bug. Issue confirmed.

#14

Updated by Markus Klein about 2 years ago

  • Related to Task #66373: Extend typolink to handle record links added
#15

Updated by Markus Klein about 2 years ago

  • Related to Task #66374: Ensure the softref parser properly handles record links added
#16

Updated by Gerrit Code Review about 2 years ago

  • Status changed from Accepted 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/58964

#17

Updated by Gerrit Code Review about 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/58964

#18

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/58964

#19

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

#20

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

#21

Updated by Johannes Kasberger almost 2 years ago

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

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/59046

#23

Updated by Johannes Kasberger almost 2 years ago

  • Status changed from Under Review to Resolved
#24

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF