Bug #79647 ยป BUGFIX_Convert_legacy_parameters_in_record_link_handler.patch
typo3/sysext/core/Classes/LinkHandling/RecordLinkHandler.php (revision ) | ||
---|---|---|
*/
|
||
public function asString(array $parameters): string
|
||
{
|
||
if ((empty($parameters['identifier']) && empty($parameters['uid'])) && !empty($parameters['url'])) {
|
||
$parameters = $this->convertLegacyParameters($parameters);
|
||
}
|
||
if (empty($parameters['identifier']) || empty($parameters['uid'])) {
|
||
throw new \InvalidArgumentException('The RecordLinkHandler expects identifier and uid as $parameter configuration.', 1486155150);
|
||
}
|
||
... | ... | |
return $urn;
|
||
}
|
||
/**
|
||
* @param array $parameters
|
||
* @return array
|
||
*/
|
||
public function convertLegacyParameters(array $parameters): array
|
||
{
|
||
if (!empty($parameters['url']['uid'])) {
|
||
$parameters['uid'] = $parameters['url']['uid'];
|
||
}
|
||
if (!empty($parameters['url']['identifier'])) {
|
||
$parameters['identifier'] = $parameters['url']['identifier'];
|
||
}
|
||
return $parameters;
|
||
}
|
||
/**
|
||
* Returns all relevant information built in the link to a page (see asString())
|