Commit 39041950 authored by catch's avatar catch
Browse files

Issue #3471741 by mstrelan, bbrala, kristiaanvandeneynde: Fix null $cid in CacheCollector classes

(cherry picked from commit 85aa92b0)
parent 47614c47
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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 @@ public function __construct(CacheBackendInterface $cache, LockBackendInterface $
   * {@inheritdoc}
   */
  protected function getCid() {
    if (!isset($this->cid)) {
    if ($this->cid === '') {
      $this->cid = 'library_info:' . $this->themeManager->getActiveTheme()->getName();
    }

@@ -164,7 +164,7 @@ protected function applyLibrariesExtend($extension, $library_name, $library_defi
   */
  public function reset() {
    parent::reset();
    $this->cid = NULL;
    $this->cid = '';
  }

}
+2 −2
Original line number Diff line number Diff line
@@ -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 @@ public function __construct(MenuLinkManagerInterface $menu_link_manager, RouteMa
   * @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);