Bug #96653
closed"Slugs updated and redirects created" notification appears twice
0%
Description
Standard TYPO3 CMS 11 installation with redirects active
shows the "Slugs updated and redirects created" notification twice:
In my opinion, this is because of a duplicate inclusion of the EventHandler JavaScript module.
Once in BackendControllerHook and another time in DispatchNotificationHook (both in the core redirects extension).
Files
Updated by Oliver Hader almost 3 years ago
- Related to Task #91786: Replace RequireJS module loading and invocation added
Updated by Oliver Hader almost 3 years ago
- Status changed from New to Accepted
Good catch. Issue #91786 change the loading of RequireJS modules, basically to avoid inline JavaScript code.
However, the previous implementation in PageRenderer::loadRequireJsModule
maintained a "duplicate check" for each module and its callback function.
// ... $inlineCodeKey = $mainModuleName . sha1($callBackFunction); // ... $this->addJsInlineCode('RequireJS-Module-' . $inlineCodeKey, $javaScriptCode);
This initialization (of different instance) can be the intended behavior, the new way has to be a bit more explicit, e.g.
$instruction = JavaScriptModuleInstruction::create('TYPO3/CMS/Redirects/EventHandler.js') ->addFlags(JavaScriptModuleInstruction::FLAG_USE_TOP_WINDOW) ->invoke('dispatchCustomEvent', 'typo3:redirects:slugChanged', $params['parameter']); if (!$javaScriptRenderer->hasJavaScriptModuleInstruction($instruction, CONSIDER_ALL)) { $javaScriptRenderer->addJavaScriptModuleInstruction(instruction); } // where the flags could be among // CONSIDER_NAME: just checking the module name // CONSIDER_FLAGS: just checking internal flags // CONSIDER_INSTANTIATION: ... instance args ... // CONSIDER_INVOCATION: ... invokes ... // CONSIDER_ASSIGNMENTS: ... assignments ... // CONSIDER_ALL: all of the above
Updated by Oliver Hader almost 3 years ago
Hm... could not reproduce this. Basically since both different JavaScript modules are added to different scopes (on in main backend "frame"; and the other in the component that triggered the editing - in most cases still in an <iframe>
).
Updated by Gerrit Code Review almost 3 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73178
Updated by Gerrit Code Review almost 3 years ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73179
Updated by Oliver Hader almost 3 years ago
@Wolfgang Klinger: Can you please give the patches at https://review.typo3.org/q/I2cfec0e647cf9eb153e2f1c181f4605cbceca001 a try (I've added a 11.5 back-port already).
As an alternative, getting the notification twice also might be the result of multiple hook invocations via DataHandler
, see https://github.com/TYPO3/typo3/blob/2ae98bbef04fb6f38b585db647c08a01e06be4e7/typo3/sysext/redirects/Classes/Hooks/DataHandlerSlugUpdateHook.php#L78-L94
- how does your site & page structure look like?
- how did you trigger the "updated slug notifications" (e.g. via editing page properties)?
- which browser, version and OS did you use?
Thanks in advance for your feedback!
Updated by Oliver Hader almost 3 years ago
- Status changed from Under Review to Needs Feedback
Updated by Oliver Hader almost 3 years ago
- Related to Task #96661: Add possibility to manipulate JavaScriptModuleInstruction items added
Updated by Oliver Hader almost 3 years ago
- Related to Bug #96662: Correctly calculate bit-masks in JavaScriptModuleInstruction added
Updated by Wolfgang Klinger almost 3 years ago
I'm sorry, can't reproduce it anymore …
but I know I'm not crazy :-DDD as a colleague of mine experienced the same when I asked for him to test it.
But maybe some extension or caching issue with had here?
Can be closed imho.
Updated by Christian Kuhn almost 3 years ago
- Status changed from Needs Feedback to Closed