Created
December 6, 2018 13:10
-
-
Save ahebrank/8dde606967eb1593fdd4efacecfc46fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/Plugin/views/display/Eva.php b/src/Plugin/views/display/Eva.php | |
| index a7b6d5f..487b115 100644 | |
| --- a/src/Plugin/views/display/Eva.php | |
| +++ b/src/Plugin/views/display/Eva.php | |
| @@ -10,6 +10,7 @@ use Drupal\views\Plugin\views\display\DisplayPluginBase; | |
| use Drupal\Core\Form\FormStateInterface; | |
| use Drupal\Component\Utility\SafeMarkup; | |
| use Symfony\Component\DependencyInjection\ContainerInterface; | |
| +use Drupal\eva\ViewDisplays; | |
| /** | |
| * The plugin that handles an EVA display in views. | |
| @@ -49,6 +50,13 @@ class Eva extends DisplayPluginBase { | |
| */ | |
| protected $currentPathStack; | |
| + /** | |
| + * EVA utiilities. | |
| + * | |
| + * @var \Drupal\eva\ViewDisplays | |
| + */ | |
| + protected $evaViewDisplays; | |
| + | |
| /** | |
| * Whether the display allows attachments. | |
| * | |
| @@ -60,11 +68,12 @@ class Eva extends DisplayPluginBase { | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| - public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entityTypeManager, EntityTypeBundleInfoInterface $bundleInfo, CurrentPathStack $currentPathStack) { | |
| + public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entityTypeManager, EntityTypeBundleInfoInterface $bundleInfo, CurrentPathStack $currentPathStack, ViewDisplays $evaViewDisplays) { | |
| parent::__construct([], $plugin_id, $plugin_definition); | |
| $this->entityTypeManager = $entityTypeManager; | |
| $this->bundleInfo = $bundleInfo; | |
| $this->currentPathStack = $currentPathStack; | |
| + $this->evaViewDisplays = $evaViewDisplays; | |
| } | |
| /** | |
| @@ -77,7 +86,8 @@ class Eva extends DisplayPluginBase { | |
| $plugin_definition, | |
| $container->get('entity_type.manager'), | |
| $container->get('entity_type.bundle.info'), | |
| - $container->get('path.current') | |
| + $container->get('path.current'), | |
| + $container->get('eva.view_displays') | |
| ); | |
| } | |
| @@ -269,7 +279,7 @@ class Eva extends DisplayPluginBase { | |
| public function remove() { | |
| // Clean up display configs before the display disappears. | |
| $longname = $this->view->storage->get('id') . '_' . $this->display['id']; | |
| - _eva_clear_detached($longname); | |
| + $this->evaViewDisplays->clear_detached($longname); | |
| parent::remove(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment