Skip to content

Commit

Permalink
[BUGFIX] Allow pageIdSelector again in non-RTE link browser
Browse files Browse the repository at this point in the history
TCEMAIN.linkHandler.page.configuration.pageIdSelector.enabled = 1
This configuration is adhered again and the pageIdSelector shows up.

Resolves: #83056
Releases: master, 9.5
Change-Id: I1e03bfa180601a46c85e3c3b92ba9c7e980a4b8b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63986
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
liayn authored and andreaskienast committed Apr 6, 2020
1 parent d16e72e commit 5aa3b71
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions typo3/sysext/backend/Classes/Controller/LinkBrowserController.php
Expand Up @@ -164,4 +164,14 @@ protected function getCurrentPageId()
}
return (int)BackendUtility::getTSCpidCached($browserParameters['table'], $browserParameters['uid'], $pageId)[0];
}

/**
* Retrieve the configuration
* @return array
*/
public function getConfiguration(): array
{
$tsConfig = BackendUtility::getPagesTSconfig($this->getCurrentPageId());
return $tsConfig['TCEMAIN.']['linkHandler.']['page.']['configuration.'] ?? [];
}
}
Expand Up @@ -283,7 +283,8 @@ public function getScriptUrl()
public function modifyLinkAttributes(array $fieldDefinitions)
{
$configuration = $this->linkBrowser->getConfiguration();
if (!empty($configuration['pageIdSelector']['enabled'])) {
// Depending where the configuration is set it can be 'pageIdSelector' (CKEditor yaml) or 'pageIdSelector.' (TSconfig)
if (!empty($configuration['pageIdSelector']['enabled']) || !empty($configuration['pageIdSelector.']['enabled'])) {
$this->linkAttributes[] = 'pageIdSelector';
$fieldDefinitions['pageIdSelector'] = '
<form class="form-horizontal"><div class="form-group form-group-sm">
Expand Down

0 comments on commit 5aa3b71

Please sign in to comment.