Issue #3471741 by mstrelan, bbrala, kristiaanvandeneynde: Fix null $cid in CacheCollector classes
(cherry picked from commit 85aa92b0de
)
merge-requests/9515/head
parent
fdee339524
commit
d7c106ed83
|
@ -43,7 +43,7 @@ class LibraryDiscoveryCollector extends CacheCollector {
|
|||
*/
|
||||
public function __construct(CacheBackendInterface $cache, LockBackendInterface $lock, LibraryDiscoveryParser $discovery_parser, ThemeManagerInterface $theme_manager) {
|
||||
$this->themeManager = $theme_manager;
|
||||
parent::__construct(NULL, $cache, $lock, ['library_info']);
|
||||
parent::__construct('', $cache, $lock, ['library_info']);
|
||||
|
||||
$this->discoveryParser = $discovery_parser;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ class LibraryDiscoveryCollector extends CacheCollector {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getCid() {
|
||||
if (!isset($this->cid)) {
|
||||
if ($this->cid === '') {
|
||||
$this->cid = 'library_info:' . $this->themeManager->getActiveTheme()->getName();
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ class LibraryDiscoveryCollector extends CacheCollector {
|
|||
*/
|
||||
public function reset() {
|
||||
parent::reset();
|
||||
$this->cid = NULL;
|
||||
$this->cid = '';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ class MenuActiveTrail extends CacheCollector implements MenuActiveTrailInterface
|
|||
* The lock backend.
|
||||
*/
|
||||
public function __construct(MenuLinkManagerInterface $menu_link_manager, RouteMatchInterface $route_match, CacheBackendInterface $cache, LockBackendInterface $lock) {
|
||||
parent::__construct(NULL, $cache, $lock);
|
||||
parent::__construct('', $cache, $lock);
|
||||
$this->menuLinkManager = $menu_link_manager;
|
||||
$this->routeMatch = $route_match;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ class MenuActiveTrail extends CacheCollector implements MenuActiveTrailInterface
|
|||
* @see ::getActiveTrailIds()
|
||||
*/
|
||||
protected function getCid() {
|
||||
if (!isset($this->cid)) {
|
||||
if ($this->cid === '') {
|
||||
$route_parameters = $this->routeMatch->getRawParameters()->all();
|
||||
ksort($route_parameters);
|
||||
$this->cid = 'active-trail:route:' . $this->routeMatch->getRouteName() . ':route_parameters:' . serialize($route_parameters);
|
||||
|
|
Loading…
Reference in New Issue