diff --git a/classes/services/NavigationMenuService.php b/classes/services/NavigationMenuService.php index 2c0d7823e41..c2b1f9455de 100644 --- a/classes/services/NavigationMenuService.php +++ b/classes/services/NavigationMenuService.php @@ -49,7 +49,7 @@ public function __construct() */ public function getMenuItemTypesCallback($hookName, $args) { - $types = & $args[0]; + $types = &$args[0]; $ompTypes = [ self::NMI_TYPE_CATALOG => [ @@ -64,7 +64,7 @@ public function getMenuItemTypesCallback($hookName, $args) $request = Application::get()->getRequest(); $context = $request->getContext(); - $contextId = $context ? $context->getId() : Application::CONTEXT_ID_NONE; + $contextId = $context?->getId() ?? Application::SITE_CONTEXT_ID; $series = Repo::section() ->getCollector() @@ -109,7 +109,7 @@ public function getMenuItemTypesCallback($hookName, $args) */ public function getMenuItemCustomEditTemplatesCallback($hookName, $args) { - $templates = & $args[0]; + $templates = &$args[0]; $ompTemplates = [ self::NMI_TYPE_CATEGORY => [ @@ -131,7 +131,7 @@ public function getMenuItemCustomEditTemplatesCallback($hookName, $args) */ public function getDisplayStatusCallback($hookName, $args) { - $navigationMenuItem = & $args[0]; + $navigationMenuItem = &$args[0]; $request = Application::get()->getRequest(); $dispatcher = $request->getDispatcher(); @@ -140,7 +140,7 @@ public function getDisplayStatusCallback($hookName, $args) $isUserLoggedIn = Validation::isLoggedIn(); $isUserLoggedInAs = (bool) Validation::loggedInAs(); $context = $request->getContext(); - $contextId = $context ? $context->getId() : Application::CONTEXT_ID_NONE; + $contextId = $context?->getId() ?? Application::SITE_CONTEXT_ID; $this->transformNavMenuItemTitle($templateMgr, $navigationMenuItem); diff --git a/classes/submission/Collector.php b/classes/submission/Collector.php index 41e61a6ea8d..46179d24546 100644 --- a/classes/submission/Collector.php +++ b/classes/submission/Collector.php @@ -151,7 +151,7 @@ public function getQueryBuilder(): Builder $assocType = Application::ASSOC_TYPE_PRESS; $assocIds = is_array($this->contextIds) ? $this->contextIds - : [Application::CONTEXT_ID_NONE]; + : [Application::SITE_CONTEXT_ID]; } $q->leftJoin('features as sf', function ($join) use ($assocType, $assocIds) { diff --git a/controllers/grid/navigationMenus/form/NavigationMenuItemsForm.php b/controllers/grid/navigationMenus/form/NavigationMenuItemsForm.php index dba67d27bbc..9e1fb1f01bc 100644 --- a/controllers/grid/navigationMenus/form/NavigationMenuItemsForm.php +++ b/controllers/grid/navigationMenus/form/NavigationMenuItemsForm.php @@ -39,7 +39,7 @@ public function fetch($request, $template = null, $display = false) $request = Application::get()->getRequest(); $context = $request->getContext(); - $contextId = $context ? $context->getId() : Application::CONTEXT_ID_NONE; + $contextId = $context?->getId() ?? Application::SITE_CONTEXT_ID; $series = Repo::section() ->getCollector()