Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use non-depricated events for loading additional scripts in files app #18256

Merged
merged 2 commits into from
Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use Symfony\Component\EventDispatcher\GenericEvent;
use OCP\EventDispatcher\GenericEvent;

class LegacyLoadAdditionalScriptsAdapter implements IEventListener {

Expand Down
4 changes: 3 additions & 1 deletion apps/files_external/lib/Service/BackendService.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use OCA\Files_External\Lib\Backend\Backend;
use OCA\Files_External\Lib\Config\IAuthMechanismProvider;
use OCA\Files_External\Lib\Config\IBackendProvider;
use OCP\EventDispatcher\GenericEvent;
use OCP\IConfig;

/**
Expand Down Expand Up @@ -110,7 +111,8 @@ private function callForRegistrations() {
static $eventSent = false;
if(!$eventSent) {
\OC::$server->getEventDispatcher()->dispatch(
'OCA\\Files_External::loadAdditionalBackends'
'OCA\\Files_External::loadAdditionalBackends',
new GenericEvent()
);
$eventSent = true;
}
Expand Down
3 changes: 2 additions & 1 deletion apps/files_sharing/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCA\Files\Event\LoadSidebar;
use OCP\EventDispatcher\GenericEvent;

// Check if we are a user
OCP\User::checkLoggedIn();
Expand All @@ -37,7 +38,7 @@
$tmpl->assign('showgridview', $showgridview && !$isIE);

// fire script events
$eventDispatcher->dispatch('\OCP\Collaboration\Resources::loadAdditionalScripts');
$eventDispatcher->dispatch('\OCP\Collaboration\Resources::loadAdditionalScripts', new GenericEvent());
$eventDispatcher->dispatch(LoadAdditionalScriptsEvent::class, new LoadAdditionalScriptsEvent());
$eventDispatcher->dispatch(LoadSidebar::class, new LoadSidebar());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Middleware;
use OCP\AppFramework\PublicShareController;
use OCP\EventDispatcher\GenericEvent;
use OCP\IUserSession;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

Expand All @@ -53,10 +54,10 @@ public function afterController($controller, $methodName, Response $response): R
}

if ($response instanceof TemplateResponse) {
$this->dispatcher->dispatch(TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS);
$this->dispatcher->dispatch(TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS, new GenericEvent());

if (!($response instanceof StandaloneTemplateResponse) && $this->userSession->isLoggedIn()) {
$this->dispatcher->dispatch(TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS_LOGGEDIN);
$this->dispatcher->dispatch(TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS_LOGGEDIN, new GenericEvent());
}
}

Expand Down