Skip to content

Commit 982a653

Browse files
authored
Linkbrowser fix (#656)
* Load module after BootCompleted event To fix links not saving (#650) * Match REQUEST_URI ending with /browse To account for both /typo3/wizard/record/browse and /typo3/wizard/link/browse; images and links, respectively
1 parent e977024 commit 982a653

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace TYPO3\CMS\FrontendEditing\Controller\Event\Handler;
6+
7+
use TYPO3\CMS\Core\Core\Event\BootCompletedEvent;
8+
use TYPO3\CMS\Core\Page\PageRenderer;
9+
10+
final class BootCompletedEventHandler
11+
{
12+
public function __invoke(BootCompletedEvent $event): void
13+
{
14+
$pageRenderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(PageRenderer::class);
15+
$path = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
16+
17+
if (str_ends_with($path, '/browse')) {
18+
$pageRenderer->loadRequireJsModule('TYPO3/CMS/FrontendEditing/ParentWindow');
19+
}
20+
}
21+
}

Configuration/Services.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ services:
1818
- name: event.listener
1919
identifier: typoScriptPrepareFieldUpdate
2020
event: TYPO3\CMS\FrontendEditing\Controller\Event\PrepareFieldUpdateEvent
21+
22+
TYPO3\CMS\FrontendEditing\Controller\Event\Handler\BootCompletedEventHandler:
23+
tags:
24+
- name: event.listener
25+
identifier: bootCompletedEventHandler
26+
event: TYPO3\CMS\Core\Core\Event\BootCompletedEvent

ext_localconf.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
defined('TYPO3') or die();
44

5-
if (TYPO3_MODE === 'BE') {
6-
// $pageRenderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class);
7-
// $pageRenderer->loadRequireJsModule('TYPO3/CMS/FrontendEditing/ParentWindow');
8-
}
9-
105
// Extend the <core:contentEditable> viewhelper by the one from EXT:frontend_editing
116
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['core'][] = 'TYPO3\\CMS\\FrontendEditing\\ViewHelpers';
127

0 commit comments

Comments
 (0)