Project

General

Profile

Actions

Bug #80806

closed

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

Added by Christian Toffolo almost 7 years ago. Updated almost 5 years 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 4 (0 open4 closed)

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
Actions #1

Updated by Morton Jonuschat almost 7 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
Actions #2

Updated by Benni Mack almost 7 years ago

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

Updated by Bernhard Eckl over 6 years ago

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

Actions #4

Updated by Christoph Lehmann over 6 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

Actions #5

Updated by Christoph Lehmann over 6 years ago

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

Actions #6

Updated by Joerg Kummer about 6 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.

Actions #7

Updated by Tobias Schmidt about 6 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.

Actions #8

Updated by Marc Bastian Heinrichs almost 6 years ago

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

Updated by Marc Bastian Heinrichs almost 6 years ago

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

Actions #10

Updated by J. Peter M. Schuler over 5 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.

Actions #11

Updated by Tizian Schmidlin over 5 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 :-)

Actions #12

Updated by Markus Gehrig over 5 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);

Actions #13

Updated by Markus Klein over 5 years ago

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

This is a core bug. Issue confirmed.

Actions #14

Updated by Markus Klein over 5 years ago

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

Updated by Markus Klein over 5 years ago

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

Updated by Gerrit Code Review over 5 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

Actions #17

Updated by Gerrit Code Review over 5 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

Actions #18

Updated by Gerrit Code Review over 5 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

Actions #19

Updated by Gerrit Code Review over 5 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

Actions #20

Updated by Gerrit Code Review over 5 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

Actions #21

Updated by Johannes Kasberger over 5 years ago

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

Updated by Gerrit Code Review over 5 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

Actions #23

Updated by Johannes Kasberger over 5 years ago

  • Status changed from Under Review to Resolved
Actions #24

Updated by Benni Mack almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF