aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-07-24 07:53:48 +0200
committerJulius Härtl <jus@bitgrid.net>2020-07-24 08:58:14 +0200
commite1b696929fe5f7a1f5f967c6833f7ca5bd4ecc7c (patch)
tree1e3ac29bafc2fc0b4739f3611d1b3741293e0537 /lib/private/AppFramework
parentc4a6666e6c210079df9ac9f4c0f68d832fc23e60 (diff)
downloadnextcloud-server-e1b696929fe5f7a1f5f967c6833f7ca5bd4ecc7c.tar.gz
nextcloud-server-e1b696929fe5f7a1f5f967c6833f7ca5bd4ecc7c.zip
Move NotFoundResponse to a proper TemplateResponse
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r--lib/private/AppFramework/Middleware/AdditionalScriptsMiddleware.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/private/AppFramework/Middleware/AdditionalScriptsMiddleware.php b/lib/private/AppFramework/Middleware/AdditionalScriptsMiddleware.php
index 619432be78f..9eafd5b740c 100644
--- a/lib/private/AppFramework/Middleware/AdditionalScriptsMiddleware.php
+++ b/lib/private/AppFramework/Middleware/AdditionalScriptsMiddleware.php
@@ -53,16 +53,15 @@ class AdditionalScriptsMiddleware extends Middleware {
}
public function afterController($controller, $methodName, Response $response): Response {
- /*
- * There is no need to emit these signals on a public share page
- * There is a separate event for that already
- */
- if ($controller instanceof PublicShareController) {
- return $response;
- }
-
if ($response instanceof TemplateResponse) {
- $this->legacyDispatcher->dispatch(TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS, new GenericEvent());
+ if (!$controller instanceof PublicShareController) {
+ /*
+ * The old event was not dispatched on the public share controller as there was
+ * OCA\Files_Sharing::loadAdditionalScripts for that. This is kept for compatibility reasons
+ * only for the old event as this is now also included in BeforeTemplateRenderedEvent
+ */
+ $this->legacyDispatcher->dispatch(TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS, new GenericEvent());
+ }
if (!($response instanceof StandaloneTemplateResponse) && $this->userSession->isLoggedIn()) {
$this->legacyDispatcher->dispatch(TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS_LOGGEDIN, new GenericEvent());