Project

General

Profile

Actions

Bug #96653

closed

"Slugs updated and redirects created" notification appears twice

Added by Wolfgang Klinger almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2022-01-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

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


Related issues 3 (1 open2 closed)

Related to TYPO3 Core - Task #91786: Replace RequireJS module loading and invocationClosedOliver Hader2020-07-12

Actions
Related to TYPO3 Core - Task #96661: Add possibility to manipulate JavaScriptModuleInstruction itemsUnder Review2022-01-27

Actions
Related to TYPO3 Core - Bug #96662: Correctly calculate bit-masks in JavaScriptModuleInstructionClosed2022-01-27

Actions
Actions #1

Updated by Oliver Hader almost 3 years ago

  • Related to Task #91786: Replace RequireJS module loading and invocation added
Actions #2

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

Updated by Oliver Hader almost 3 years ago

  • Is Regression set to Yes
Actions #4

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>).

Actions #5

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

Actions #6

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

Actions #7

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

Besides checking the patch above, can you please describe how this problem can be reproduced, e.g.
  • 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!

Actions #8

Updated by Oliver Hader almost 3 years ago

  • Status changed from Under Review to Needs Feedback
Actions #9

Updated by Oliver Hader almost 3 years ago

  • Related to Task #96661: Add possibility to manipulate JavaScriptModuleInstruction items added
Actions #10

Updated by Oliver Hader almost 3 years ago

  • Related to Bug #96662: Correctly calculate bit-masks in JavaScriptModuleInstruction added
Actions #11

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.

Actions #12

Updated by Christian Kuhn almost 3 years ago

  • Status changed from Needs Feedback to Closed
Actions

Also available in: Atom PDF