Commit af20f592 authored by Igor Kachinsky's avatar Igor Kachinsky Committed by Vladimir Roudakov
Browse files

Issue #3212302 by kachinsky, devkinetic, netsliver, Damien Laguerre: Block...

Issue #3212302 by kachinsky, devkinetic, netsliver, Damien Laguerre: Block Display is random for anonymous
parent c0d33537
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ use Drupal\Core\Block\BlockBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\node\Entity\Node;
use Drupal\node\NodeInterface;
use Drupal\Core\Cache\Cache;

/**
 * Provides an 'AddToAny share' block.
@@ -54,9 +55,6 @@ class AddToAnyBlock extends BlockBase {
      '#universal_button_placement' => $data['universal_button_placement'],
      '#buttons_size'               => $block_options['buttons_size'],
      '#theme'                      => 'addtoany_standard',
      '#cache'                      => [
        'contexts' => ['url'],
      ],
    ];

    if ($is_node) {
@@ -154,4 +152,11 @@ class AddToAnyBlock extends BlockBase {
    }
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheContexts() {
    return Cache::mergeContexts(parent::getCacheContexts(), ['url']);
  }

}