diff --git a/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.php b/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.php index 3923703..91d8726 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.php @@ -120,15 +120,18 @@ class View extends ConfigEntityBase implements ViewStorageInterface { protected $module = 'views'; /** - * Overrides Drupal\Core\Entity\EntityInterface::get(). + * Gets an executable instance for this view. + * + * @return \Drupal\views\ViewExecutable + * A view executable instance. */ - public function get($property_name, $langcode = NULL) { + public function getExecutable() { // Ensure that an executable View is available. - if ($property_name == 'executable' && !isset($this->{$property_name})) { - $this->set('executable', Views::executableFactory()->get($this)); + if (!isset($this->executable)) { + $this->executable = Views::executableFactory()->get($this); } - return parent::get($property_name, $langcode); + return $this->executable; } /** @@ -274,7 +277,7 @@ public function newDisplay($plugin_id = 'page', $title = NULL, $id = NULL) { // We can't use get() here as it will create an ViewExecutable instance if // there is not already one. if (isset($this->executable)) { - $executable = $this->get('executable'); + $executable = $this->getExecutable(); $executable->initDisplay(); $executable->displayHandlers->addInstanceID($id); return $executable->displayHandlers->get($id); diff --git a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php index 1d243d5..bbb7c88 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php @@ -44,7 +44,7 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { if (!$view->status()) { continue; } - $executable = $view->get('executable'); + $executable = $view->getExecutable(); $executable->initDisplay(); foreach ($executable->displayHandlers as $display) { // Add a block plugin definition for each block display. diff --git a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php index 59865f3..b946fa0 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php @@ -44,7 +44,7 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { if (!$view->status()) { continue; } - $executable = $view->get('executable'); + $executable = $view->getExecutable(); $executable->initDisplay(); foreach ($executable->displayHandlers as $display) { if (isset($display) && $display->getOption('exposed_block')) { diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php index b07d763..adf6b70 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php @@ -834,7 +834,7 @@ public function displayExposedForm($form, &$form_state) { $this->defaultExposeOptions(); } - $form_state['view']->get('executable')->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $item); + $form_state['view']->getExecutable()->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $item); $form_state['view']->addFormToStack($form_state['form_key'], $form_state['display_id'], $form_state['type'], $form_state['id'], TRUE, TRUE); @@ -862,7 +862,7 @@ public function submitTemporaryForm($form, &$form_state) { } $override = NULL; - $executable = $form_state['view']->get('executable'); + $executable = $form_state['view']->getExecutable(); if ($executable->display_handler->useGroupBy() && !empty($item['group_type'])) { if (empty($executable->query)) { $executable->initQuery(); @@ -887,7 +887,7 @@ public function submitTemporaryForm($form, &$form_state) { $handler->unpackOptions($handler->options, $options, NULL, FALSE); // Store the item back on the view. - $executable = $form_state['view']->get('executable'); + $executable = $form_state['view']->getExecutable(); $executable->temporary_options[$type][$form_state['id']] = $handler->options; // @todo Decide if \Drupal\views_ui\Form\Ajax\ViewsFormBase::getForm() is diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php index ec65d2c..f2f4725 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php @@ -426,7 +426,7 @@ public function buildGroupForm($form, &$form_state) { $this->buildGroupOptions(); } - $form_state['view']->get('executable')->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $item); + $form_state['view']->getExecutable()->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $item); $form_state['view']->addFormToStack($form_state['form_key'], $form_state['display_id'], $form_state['type'], $form_state['id'], TRUE, TRUE); @@ -1093,7 +1093,7 @@ public function addGroupForm($form, &$form_state) { // Add a new row. $item['group_info']['group_items'][] = array(); - $form_state['view']->get('executable')->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $item); + $form_state['view']->getExecutable()->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $item); $form_state['view']->cacheSet(); $form_state['rerender'] = TRUE; diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php b/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php index 35b2bf6..8aca1f0 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php @@ -163,7 +163,7 @@ public function buildOptionsForm(&$form, &$form_state) { protected function getTemporaryView() { $view = entity_create('view', array('base_table' => $this->definition['base'])); $view->addDisplay('default'); - return $view->get('executable'); + return $view->getExecutable(); } /** diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/row/RowPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/row/RowPluginBase.php index 4a22155..3c77de6 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/row/RowPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/row/RowPluginBase.php @@ -63,7 +63,7 @@ protected function defineOptions() { public function buildOptionsForm(&$form, &$form_state) { parent::buildOptionsForm($form, $form_state); if (isset($this->base_table)) { - $executable = $form_state['view']->get('executable'); + $executable = $form_state['view']->getExecutable(); // A whole bunch of code to figure out what relationships are valid for // this item. diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php index 50a8215..6dea297 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php @@ -694,7 +694,7 @@ protected function alterDisplayOptions(&$display_options, $form, $form_state) { protected function addDisplays(View $view, $display_options, $form, $form_state) { // Initialize and store the view executable to get the display plugin // instances. - $executable = $view->get('executable'); + $executable = $view->getExecutable(); // Display: Master $default_display = $view->newDisplay('default', 'Master', 'default'); @@ -1151,7 +1151,7 @@ protected function setValidatedView(array $form, array &$form_state, ViewUI $vie */ public function validateView(array $form, array &$form_state) { $view = $this->instantiateView($form, $form_state); - $errors = $view->get('executable')->validate(); + $errors = $view->getExecutable()->validate(); if (empty($errors)) { $this->setValidatedView($form, $form_state, $view); diff --git a/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php index cdbff1a..b00b2ca 100644 --- a/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php @@ -117,7 +117,7 @@ public function testDefaultViews() { $views = $controller->load(); foreach ($views as $name => $view_storage) { - $view = $view_storage->get('executable'); + $view = $view_storage->getExecutable(); $view->initDisplay(); foreach ($view->storage->get('display') as $display_id => $display) { $view->setDisplay($display_id); diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerAllTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerAllTest.php index c28ce37..ea82dc9 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerAllTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerAllTest.php @@ -62,7 +62,7 @@ public function testHandlers() { } $view = entity_create('view', array('base_table' => $base_table)); - $view = $view->get('executable'); + $view = $view->getExecutable(); // @todo The groupwise relationship is currently broken. $exclude[] = 'taxonomy_term_data:tid_representative'; diff --git a/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php b/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php index 103571f..507fd27 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php @@ -203,7 +203,7 @@ public function testLoadFunctions() { // Test $exclude_view parameter. $this->assertFalse(array_key_exists('archive', views_get_views_as_options(TRUE, 'all', 'archive')), 'View excluded from options based on name'); $this->assertFalse(array_key_exists('archive:default', views_get_views_as_options(FALSE, 'all', 'archive:default')), 'View display excluded from options based on name'); - $this->assertFalse(array_key_exists('archive', views_get_views_as_options(TRUE, 'all', $archive->get('executable'))), 'View excluded from options based on object'); + $this->assertFalse(array_key_exists('archive', views_get_views_as_options(TRUE, 'all', $archive->getExecutable())), 'View excluded from options based on object'); // Test the $opt_group parameter. $expected_opt_groups = array(); diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php index b4c4b8a..068a6b0 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php @@ -175,7 +175,7 @@ protected function displayTests() { // Ensure the right display_plugin is created/instantiated. $this->assertEqual($display[$new_id]['display_plugin'], 'page', 'New page display "test" uses the right display plugin.'); - $executable = $view->get('executable'); + $executable = $view->getExecutable(); $executable->initDisplay(); $this->assertTrue($executable->displayHandlers->get($new_id) instanceof Page, 'New page display "test" uses the right display plugin.'); @@ -267,7 +267,7 @@ protected function displayMethodTests() { $display = $view->newDisplay('feed'); $this->assertEqual($display, 'feed_1'); - $executable = $view->get('executable'); + $executable = $view->getExecutable(); $executable->initDisplay(); $this->assertTrue($executable->displayHandlers->get('page_1') instanceof Page); @@ -280,7 +280,7 @@ protected function displayMethodTests() { // Tests item related methods(). $view = $this->controller->create(array('base_table' => 'views_test_data')); $view->addDisplay('default'); - $view = $view->get('executable'); + $view = $view->getExecutable(); $display_id = 'default'; $expected_items = array(); diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php index 25c387e..bb8807c 100644 --- a/core/modules/views/lib/Drupal/views/ViewExecutable.php +++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php @@ -1686,7 +1686,7 @@ public function getBreadcrumb($set = FALSE) { * data, ID, and UUID. */ public function createDuplicate() { - return $this->storage->createDuplicate()->get('executable'); + return $this->storage->createDuplicate()->getExecutable(); } /** diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 5daa331..3e482f1 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -929,7 +929,7 @@ function views_get_applicable_views($type) { $result = array(); foreach (Drupal::entityManager()->getStorageController('view')->load($entity_ids) as $view) { // Check each display to see if it meets the criteria and is enabled. - $executable = $view->get('executable'); + $executable = $view->getExecutable(); $executable->initDisplay(); foreach ($executable->displayHandlers as $id => $handler) { if (!empty($handler->definition[$type]) && $handler->isEnabled()) { @@ -1109,7 +1109,7 @@ function views_disable_view(View $view) { function views_get_view($name) { $view = entity_load('view', $name); if ($view) { - return $view->get('executable'); + return $view->getExecutable(); } } diff --git a/core/modules/views_ui/admin.inc b/core/modules/views_ui/admin.inc index 192d0ca..2b56c9d 100644 --- a/core/modules/views_ui/admin.inc +++ b/core/modules/views_ui/admin.inc @@ -335,7 +335,7 @@ function views_ui_pre_render_move_argument_options($form) { function views_ui_standard_display_dropdown(&$form, &$form_state, $section) { $view = &$form_state['view']; $display_id = $form_state['display_id']; - $executable = $view->get('executable'); + $executable = $view->getExecutable(); $displays = $executable->displayHandlers; $current_display = $executable->display_handler; diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php b/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php index e4b1bfa..6bbd9ea 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php @@ -89,7 +89,7 @@ public function reportFields() { $fields = array(); $handler_types = ViewExecutable::viewsHandlerTypes(); foreach ($views as $view) { - $executable = $view->get('executable'); + $executable = $view->getExecutable(); $executable->initDisplay(); foreach ($executable->displayHandlers as $display_id => $display) { if ($executable->setDisplay($display_id)) { diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php index a1907ab..766ede4 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php @@ -60,7 +60,7 @@ public function buildForm(array $form, array &$form_state) { ), ); - $executable = $view->get('executable'); + $executable = $view->getExecutable(); if (!$executable->setDisplay($display_id)) { views_ajax_error(t('Invalid display id @display', array('@display' => $display_id))); } diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Analyze.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Analyze.php index b8b7ac9..a3f8532 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Analyze.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Analyze.php @@ -40,7 +40,7 @@ public function buildForm(array $form, array &$form_state) { $form['#section'] = 'analyze'; $analyzer = Views::analyzer(); - $messages = $analyzer->getMessages($view->get('executable')); + $messages = $analyzer->getMessages($view->getExecutable()); $form['analysis'] = array( '#prefix' => '
', diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php index aeb5295..d3d4ccc 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php @@ -63,7 +63,7 @@ public function buildForm(array $form, array &$form_state) { '#attributes' => array('class' => array('scroll')), ), ); - $executable = $view->get('executable'); + $executable = $view->getExecutable(); $save_ui_cache = FALSE; if (!$executable->setDisplay($display_id)) { views_ajax_error(t('Invalid display id @display', array('@display' => $display_id))); @@ -212,7 +212,7 @@ public function submitForm(array &$form, array &$form_state) { } $override = NULL; - $executable = $form_state['view']->get('executable'); + $executable = $form_state['view']->getExecutable(); if ($executable->display_handler->useGroupBy() && !empty($item['group_type'])) { if (empty($executable->query)) { $executable->initQuery(); @@ -254,7 +254,7 @@ public function submitForm(array &$form, array &$form_state) { public function remove(&$form, &$form_state) { // Store the item back on the view list($was_defaulted, $is_defaulted) = $form_state['view']->getOverrideValues($form, $form_state); - $executable = $form_state['view']->get('executable'); + $executable = $form_state['view']->getExecutable(); // If the display selection was changed toggle the override value. if ($was_defaulted != $is_defaulted) { $display = &$executable->displayHandlers->get($form_state['display_id']); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php index 14895f8..f7c715b 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php @@ -62,7 +62,7 @@ public function buildForm(array $form, array &$form_state) { '#attributes' => array('class' => array('scroll')), ), ); - $executable = $view->get('executable'); + $executable = $view->getExecutable(); if (!$executable->setDisplay($display_id)) { views_ajax_error(t('invalid display id @display', array('@display' => $display_id))); } @@ -112,7 +112,7 @@ public function submitForm(array &$form, array &$form_state) { } // Store the item back on the view - $form_state['view']->get('executable')->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $item); + $form_state['view']->getExecutable()->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $item); // Write to cache $form_state['view']->cacheSet(); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php index 4df211b..808781d 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php @@ -63,7 +63,7 @@ public function buildForm(array $form, array &$form_state) { '#attributes' => array('class' => array('scroll')), ), ); - $executable = $view->get('executable'); + $executable = $view->getExecutable(); if (!$executable->setDisplay($display_id)) { views_ajax_render(t('Invalid display id @display', array('@display' => $display_id))); } @@ -101,7 +101,7 @@ public function submitForm(array &$form, array &$form_state) { $id = $form_state['id']; $handler = Views::handlerManager($type)->getHandler($item); - $executable = $form_state['view']->get('executable'); + $executable = $form_state['view']->getExecutable(); $handler->init($executable, $executable->display_handler, $item); $handler->submitGroupByForm($form, $form_state); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php index d8c1e9a..8611a60 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Display.php @@ -63,7 +63,7 @@ public function buildForm(array $form, array &$form_state) { $display_id = $form_state['display_id']; $section = $form_state['section']; - $executable = $view->get('executable'); + $executable = $view->getExecutable(); if (!$executable->setDisplay($display_id)) { views_ajax_error(t('Invalid display id @display', array('@display' => $display_id))); } @@ -100,7 +100,7 @@ public function buildForm(array $form, array &$form_state) { * Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::validateForm(). */ public function validateForm(array &$form, array &$form_state) { - $form_state['view']->get('executable')->displayHandlers->get($form_state['display_id'])->validateOptionsForm($form['options'], $form_state); + $form_state['view']->getExecutable()->displayHandlers->get($form_state['display_id'])->validateOptionsForm($form['options'], $form_state); if (form_get_errors()) { $form_state['rerender'] = TRUE; @@ -111,7 +111,7 @@ public function validateForm(array &$form, array &$form_state) { * Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::submitForm(). */ public function submitForm(array &$form, array &$form_state) { - $form_state['view']->get('executable')->displayHandlers->get($form_state['display_id'])->submitOptionsForm($form['options'], $form_state); + $form_state['view']->getExecutable()->displayHandlers->get($form_state['display_id'])->submitOptionsForm($form['options'], $form_state); $form_state['view']->cacheSet(); } diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php index 170182b..1e5849b 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Rearrange.php @@ -53,7 +53,7 @@ public function buildForm(array $form, array &$form_state) { $type = $form_state['type']; $types = ViewExecutable::viewsHandlerTypes(); - $executable = $view->get('executable'); + $executable = $view->getExecutable(); if (!$executable->setDisplay($display_id)) { views_ajax_error(t('Invalid display id @display', array('@display' => $display_id))); } @@ -136,7 +136,7 @@ public function buildForm(array $form, array &$form_state) { */ public function submitForm(array &$form, array &$form_state) { $types = ViewExecutable::viewsHandlerTypes(); - $display = &$form_state['view']->get('executable')->displayHandlers->get($form_state['display_id']); + $display = &$form_state['view']->getExecutable()->displayHandlers->get($form_state['display_id']); $old_fields = $display->getOption($types[$form_state['type']]['plural']); $new_fields = $order = array(); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php index e49cc96..c6ffdbf 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php @@ -38,7 +38,7 @@ public function buildForm(array $form, array &$form_state) { $type = 'filter'; $types = ViewExecutable::viewsHandlerTypes(); - $executable = $view->get('executable'); + $executable = $view->getExecutable(); if (!$executable->setDisplay($display_id)) { views_ajax_render(t('Invalid display id @display', array('@display' => $display_id))); } @@ -212,7 +212,7 @@ public function buildForm(array $form, array &$form_state) { */ public function submitForm(array &$form, array &$form_state) { $types = ViewExecutable::viewsHandlerTypes(); - $display = &$form_state['view']->get('executable')->displayHandlers->get($form_state['display_id']); + $display = &$form_state['view']->getExecutable()->displayHandlers->get($form_state['display_id']); $remember_groups = array(); if (!empty($form_state['view']->form_cache)) { diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php index 04dd507..a3f3bf4 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php @@ -76,7 +76,7 @@ public function form(array $form, array &$form_state) { $form_state['no_cache'] = TRUE; if ($display_id) { - if (!$view->get('executable')->setDisplay($display_id)) { + if (!$view->getExecutable()->setDisplay($display_id)) { $form['#markup'] = t('Invalid display id @display', array('@display' => $display_id)); return $form; } @@ -161,8 +161,8 @@ public function form(array $form, array &$form_state) { $display_title = $this->getDisplayLabel($view, $display_id, FALSE); // Add a text that the display is disabled. - if ($view->get('executable')->displayHandlers->has($display_id)) { - if (!$view->get('executable')->displayHandlers->get($display_id)->isEnabled()) { + if ($view->getExecutable()->displayHandlers->has($display_id)) { + if (!$view->getExecutable()->displayHandlers->get($display_id)->isEnabled()) { $form['displays']['settings']['disabled']['#markup'] = t('This display is disabled.'); } } @@ -179,7 +179,7 @@ public function form(array $form, array &$form_state) { } // Mark disabled displays as such. - if ($view->get('executable')->displayHandlers->has($display_id) && !$view->get('executable')->displayHandlers->get($display_id)->isEnabled()) { + if ($view->getExecutable()->displayHandlers->has($display_id) && !$view->getExecutable()->displayHandlers->get($display_id)->isEnabled()) { $tab_content['#attributes']['class'][] = 'views-display-disabled'; } $form['displays']['settings']['settings_content'] = array( @@ -228,7 +228,7 @@ public function validate(array $form, array &$form_state) { parent::validate($form, $form_state); $view = $this->entity; - foreach ($view->get('executable')->validate() as $display_errors) { + foreach ($view->getExecutable()->validate() as $display_errors) { foreach ($display_errors as $error) { form_set_error('', $error); } @@ -246,16 +246,16 @@ public function submit(array $form, array &$form_state) { $displays = $view->get('display'); foreach ($displays as $id => $display) { if (!empty($display['deleted'])) { - $view->get('executable')->displayHandlers->remove($id); + $view->getExecutable()->displayHandlers->remove($id); unset($displays[$id]); } } // Rename display ids if needed. - foreach ($view->get('executable')->displayHandlers as $id => $display) { + foreach ($view->getExecutable()->displayHandlers as $id => $display) { if (!empty($display->display['new_id'])) { $new_id = $display->display['new_id']; - $view->get('executable')->displayHandlers->set($new_id, $view->get('executable')->displayHandlers->get($id)); - $view->get('executable')->displayHandlers->get($new_id)->display['id'] = $new_id; + $view->getExecutable()->displayHandlers->set($new_id, $view->getExecutable()->displayHandlers->get($id)); + $view->getExecutable()->displayHandlers->get($new_id)->display['id'] = $new_id; $displays[$new_id] = $displays[$id]; unset($displays[$id]); @@ -280,8 +280,8 @@ public function submit(array $form, array &$form_state) { continue; } - if (($display->getPluginId() == 'page') && ($old_path == $destination) && ($old_path != $view->get('executable')->displayHandlers->get($id)->getOption('path'))) { - $destination = $view->get('executable')->displayHandlers->get($id)->getOption('path'); + if (($display->getPluginId() == 'page') && ($old_path == $destination) && ($old_path != $view->getExecutable()->displayHandlers->get($id)->getOption('path'))) { + $destination = $view->getExecutable()->displayHandlers->get($id)->getOption('path'); $query->remove('destination'); // @todo For whatever reason drupal_goto is still using $_GET. // @see http://drupal.org/node/1668866 @@ -319,7 +319,7 @@ public function cancel(array $form, array &$form_state) { public function getDisplayTab($view) { $build = array(); $display_id = $this->displayID; - $display = $view->get('executable')->displayHandlers->get($display_id); + $display = $view->getExecutable()->displayHandlers->get($display_id); // If the plugin doesn't exist, display an error message instead of an edit // page. if (empty($display)) { @@ -356,7 +356,7 @@ public function getDisplayDetails($view, $display) { // The master display cannot be cloned. $is_default = $display['id'] == 'default'; // @todo: Figure out why getOption doesn't work here. - $is_enabled = $view->get('executable')->displayHandlers->get($display['id'])->isEnabled(); + $is_enabled = $view->getExecutable()->displayHandlers->get($display['id'])->isEnabled(); if ($display['id'] != 'default') { $build['top']['#theme_wrappers'] = array('container'); @@ -385,8 +385,8 @@ public function getDisplayDetails($view, $display) { } // Add a link to view the page unless the view is disabled or has no // path. - elseif ($view->status() && $view->get('executable')->displayHandlers->get($display['id'])->hasPath()) { - $path = $view->get('executable')->displayHandlers->get($display['id'])->getPath(); + elseif ($view->status() && $view->getExecutable()->displayHandlers->get($display['id'])->hasPath()) { + $path = $view->getExecutable()->displayHandlers->get($display['id'])->getPath(); if ($path && (strpos($path, '%') === FALSE)) { $build['top']['actions']['path'] = array( '#type' => 'link', @@ -459,7 +459,7 @@ public function getDisplayDetails($view, $display) { $build['top']['display_title'] = array( '#theme' => 'views_ui_display_tab_setting', '#description' => t('Display name'), - '#link' => $view->get('executable')->displayHandlers->get($display['id'])->optionLink(check_plain($display_title), 'display_title'), + '#link' => $view->getExecutable()->displayHandlers->get($display['id'])->optionLink(check_plain($display_title), 'display_title'), ); } @@ -504,7 +504,7 @@ public function getDisplayDetails($view, $display) { // Fetch options from the display plugin, with a list of buckets they go into. $options = array(); - $view->get('executable')->displayHandlers->get($display['id'])->optionsSummary($buckets, $options); + $view->getExecutable()->displayHandlers->get($display['id'])->optionsSummary($buckets, $options); // Place each option into its bucket. foreach ($options as $id => $option) { @@ -568,7 +568,7 @@ public function submitDisplayEnable($form, &$form_state) { $view = $this->entity; $id = $form_state['display_id']; // setOption doesn't work because this would might affect upper displays - $view->get('executable')->displayHandlers->get($id)->setOption('enabled', TRUE); + $view->getExecutable()->displayHandlers->get($id)->setOption('enabled', TRUE); // Store in cache $view->cacheSet(); @@ -583,7 +583,7 @@ public function submitDisplayEnable($form, &$form_state) { public function submitDisplayDisable($form, &$form_state) { $view = $this->entity; $id = $form_state['display_id']; - $view->get('executable')->displayHandlers->get($id)->setOption('enabled', FALSE); + $view->getExecutable()->displayHandlers->get($id)->setOption('enabled', FALSE); // Store in cache $view->cacheSet(); @@ -622,7 +622,7 @@ public function submitDisplayDelete($form, &$form_state) { */ public function rebuildCurrentTab(ViewUI $view, AjaxResponse $response, $display_id) { $this->displayID = $display_id; - if (!$view->get('executable')->setDisplay('default')) { + if (!$view->getExecutable()->setDisplay('default')) { return; } @@ -768,7 +768,7 @@ public function submitDisplayDuplicate($form, &$form_state) { // By setting the current display the changed marker will appear on the new // display. - $view->get('executable')->current_display = $new_display_id; + $view->getExecutable()->current_display = $new_display_id; $view->cacheSet(); // Redirect to the new display's edit page. @@ -786,7 +786,7 @@ public function submitDisplayAdd($form, &$form_state) { $display_id = $view->addDisplay($display_type); // A new display got added so the asterisks symbol should appear on the new // display. - $view->get('executable')->current_display = $display_id; + $view->getExecutable()->current_display = $display_id; $view->cacheSet(); // Redirect to the new display's edit page. @@ -818,7 +818,7 @@ public function submitCloneDisplayAsType($form, &$form_state) { // By setting the current display the changed marker will appear on the new // display. - $view->get('executable')->current_display = $new_display_id; + $view->getExecutable()->current_display = $new_display_id; $view->cacheSet(); // Redirect to the new display's edit page. @@ -837,23 +837,23 @@ public function buildOptionForm(ViewUI $view, $id, $option, $display) { $option_build['#description'] = $option['title']; - $option_build['#link'] = $view->get('executable')->displayHandlers->get($display['id'])->optionLink($option['value'], $id, '', empty($option['desc']) ? '' : $option['desc']); + $option_build['#link'] = $view->getExecutable()->displayHandlers->get($display['id'])->optionLink($option['value'], $id, '', empty($option['desc']) ? '' : $option['desc']); $option_build['#links'] = array(); if (!empty($option['links']) && is_array($option['links'])) { foreach ($option['links'] as $link_id => $link_value) { - $option_build['#settings_links'][] = $view->get('executable')->displayHandlers->get($display['id'])->optionLink($option['setting'], $link_id, 'views-button-configure', $link_value); + $option_build['#settings_links'][] = $view->getExecutable()->displayHandlers->get($display['id'])->optionLink($option['setting'], $link_id, 'views-button-configure', $link_value); } } - if (!empty($view->get('executable')->displayHandlers->get($display['id'])->options['defaults'][$id])) { + if (!empty($view->getExecutable()->displayHandlers->get($display['id'])->options['defaults'][$id])) { $display_id = 'default'; $option_build['#defaulted'] = TRUE; } else { $display_id = $display['id']; - if (!$view->get('executable')->displayHandlers->get($display['id'])->isDefaultDisplay()) { - if ($view->get('executable')->displayHandlers->get($display['id'])->defaultableSections($id)) { + if (!$view->getExecutable()->displayHandlers->get($display['id'])->isDefaultDisplay()) { + if ($view->getExecutable()->displayHandlers->get($display['id'])->defaultableSections($id)) { $option_build['#overridden'] = TRUE; } } @@ -866,7 +866,7 @@ public function buildOptionForm(ViewUI $view, $id, $option, $display) { * Add information about a section to a display. */ public function getFormBucket(ViewUI $view, $type, $display) { - $executable = $view->get('executable'); + $executable = $view->getExecutable(); $executable->setDisplay($display['id']); $executable->initStyle(); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php index 98637f7..0543082 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php @@ -101,7 +101,7 @@ public static function getAdminCSS() { * The display_id which is edited on the current request. */ public function getDisplayTabs(ViewUI $view) { - $executable = $view->get('executable'); + $executable = $view->getExecutable(); $executable->initDisplay(); $display_id = $this->displayID; $tabs = array(); @@ -160,7 +160,7 @@ public function isDefaultDisplayShown(ViewUI $view) { $advanced_mode = config('views.settings')->get('ui.show.master_display'); // For other users, show the default display only if there are no others, and // hide it if there's at least one "real" display. - $additional_displays = (count($view->get('executable')->displayHandlers) == 1); + $additional_displays = (count($view->getExecutable()->displayHandlers) == 1); return $advanced_mode || $additional_displays; } diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php index c83e5f7..977675b 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php @@ -755,7 +755,7 @@ public function cacheSet() { // Let any future object know that this view has changed. $this->changed = TRUE; - $executable = $this->get('executable'); + $executable = $this->getExecutable(); if (isset($executable->current_display)) { // Add the knowledge of the changed display, too. $this->changed_display[$executable->current_display] = TRUE;