diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php index 330f39c..8272675 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php @@ -26,6 +26,13 @@ protected $originalID; /** + * The enabled/disabled status of the configuration entity. + * + * @var string + */ + public $status; + + /** * Overrides Entity::__construct(). */ public function __construct(array $values, $entity_type) { @@ -88,6 +95,27 @@ public function set($property_name, $value, $langcode = NULL) { } /** + * Implements Drupal\Core\Config\Entity\ConfigEntityInterface::enable(). + */ + public function enable() { + $this->status = TRUE; + } + + /** + * Implements Drupal\Core\Config\Entity\ConfigEntityInterface::disable(). + */ + public function disable() { + $this->status = FALSE; + } + + /** + * Implements Drupal\Core\Config\Entity\ConfigEntityInterface::status(). + */ + public function status() { + return !empty($this->status); + } + + /** * Overrides Entity::createDuplicate(). */ public function createDuplicate() { diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php index 15ef4dd..3c42b1c 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php @@ -32,4 +32,21 @@ public function getOriginalID(); */ public function setOriginalID($id); + /** + * Sets the configuration entity status to enabled. + */ + public function enable(); + + /** + * Sets the configuration entity status to disabled. + */ + public function disable(); + + /** + * Returns the status of the configuration entity. + * + * @return bool + */ + public function status(); + } diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php index 3977310..4cc4084 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityListController.php @@ -7,6 +7,7 @@ namespace Drupal\Core\Config\Entity; +use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityListController; /** @@ -23,4 +24,34 @@ public function load() { return $entities; } + /** + * Overrides Drupal\Core\Entity\EntityListController::getOperations(); + */ + public function getOperations(EntityInterface $entity) { + $operations = parent::getOperations($entity); + $uri = $entity->uri(); + $path = $uri['path']; + + if (!$entity->status()) { + $operations['enable'] = array( + 'title' => t('Enable'), + 'ajax' => TRUE, + 'token' => TRUE, + 'href' => $uri['path'] . '/enable', + 'weight' => -10, + ); + } + else { + $operations['disable'] = array( + 'title' => t('Disable'), + 'ajax' => TRUE, + 'token' => TRUE, + 'href' => $uri['path'] . '/disable', + 'weight' => 10, + ); + } + + return $operations; + } + } diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php index 6d0a3f4..cf215fb 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php @@ -57,6 +57,13 @@ class ConfigStorageController implements EntityStorageControllerInterface { protected $uuidKey = 'uuid'; /** + * Name of the entity's status key or FALSE if statuses are not supported. + * + * @var string|bool + */ + protected $statusKey = 'status'; + + /** * Implements Drupal\Core\Entity\EntityStorageControllerInterface::__construct(). * * Sets basic variables. @@ -66,6 +73,14 @@ public function __construct($entityType) { $this->entityInfo = entity_get_info($entityType); $this->hookLoadArguments = array(); $this->idKey = $this->entityInfo['entity_keys']['id']; + + // @todo Enforce this and uuid keys on configuration entities. + if (isset($this->entityInfo['entity_keys']['status'])) { + $this->statusKey = $this->entityInfo['entity_keys']['status']; + } + else { + $this->statusKey = FALSE; + } } /** @@ -233,6 +248,11 @@ public function create(array $values) { $entity->{$this->uuidKey} = $uuid->generate(); } + // Assign a status. + if ($this->statusKey) { + $entity->{$this->statusKey} = TRUE; + } + return $entity; } diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php index 13f5a76..f4950cd 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php @@ -54,19 +54,26 @@ function testList() { $expected_operations = array( 'edit' => array ( 'title' => 'Edit', - 'href' => 'admin/structure/config_test/manage/default/edit', + 'href' => $uri['path'] . '/edit', 'options' => $uri['options'], 'weight' => 10, ), 'delete' => array ( 'title' => 'Delete', - 'href' => 'admin/structure/config_test/manage/default/delete', + 'href' => $uri['path'] . '/delete', 'options' => $uri['options'], 'weight' => 100, ), + 'disable' => array( + 'title' => 'Disable', + 'options' => $uri['options'], + 'href' => $uri['path'] . '/disable', + 'weight' => 10, + ), ); + $actual_operations = $controller->getOperations($entity); - $this->assertIdentical($expected_operations, $actual_operations, 'Return value from getOperations matches expected.'); + $this->assertIdentical($expected_operations, $actual_operations); // Test buildHeader() method. $expected_items = array( diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStatusTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStatusTest.php new file mode 100644 index 0000000..424f622 --- /dev/null +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStatusTest.php @@ -0,0 +1,75 @@ + 'Configuration entity statuses', + 'description' => 'Tests configuration entity enabled/disabled status functionality.', + 'group' => 'Configuration', + ); + } + + /** + * Test the enabling/disabling of entities. + */ + function testCRUD() { + $new = entity_create('config_test', array('id' => strtolower($this->randomName()))); + $new->save(); + + $this->assertTrue($new->status(), 'The entity is enabled by default.'); + $new->disable(); + $new->save(); + $this->assertFalse($new->status(), 'The entity is disabled.'); + $new->enable(); + $new->save(); + $this->assertTrue($new->status(), 'The entity is enabled.'); + } + + /** + * Tests Status operations through the UI. + */ + function testStatusUI() { + $id = strtolower($this->randomName()); + $edit = array( + 'id' => $id, + 'label' => $this->randomName(), + ); + $this->drupalPost('admin/structure/config_test/add', $edit, 'Save'); + + // Disable an entity. + $disable_path = "admin/structure/config_test/manage/$id/disable"; + $this->assertLinkByHref($disable_path); + $this->drupalGet($disable_path); + $this->assertResponse(200); + $this->assertNoLinkByHref($disable_path); + + // Enable an entity. + $enable_path = "admin/structure/config_test/manage/$id/enable"; + $this->assertLinkByHref($enable_path); + $this->drupalGet($enable_path); + $this->assertResponse(200); + $this->assertNoLinkByHref($enable_path); + } + +} diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php index 95089f7..a939830 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php @@ -107,6 +107,7 @@ function testNew() { 'uuid' => '30df59bd-7b03-4cf7-bb35-d42fc49f0651', 'label' => 'New', 'style' => '', + 'status' => '1', 'langcode' => 'und', ); $staging->write($dynamic_name, $original_dynamic_data); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php index dd24224..3417eb2 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImportUITest.php @@ -59,6 +59,7 @@ function testImport() { 'uuid' => '30df59bd-7b03-4cf7-bb35-d42fc49f0651', 'label' => 'New', 'style' => '', + 'status' => '1', 'langcode' => 'und', ); $staging->write($dynamic_name, $original_dynamic_data); diff --git a/core/modules/config/tests/config_test/config/config_test.dynamic.default.yml b/core/modules/config/tests/config_test/config/config_test.dynamic.default.yml index 3e50e3b..45763e4 100644 --- a/core/modules/config/tests/config_test/config/config_test.dynamic.default.yml +++ b/core/modules/config/tests/config_test/config/config_test.dynamic.default.yml @@ -1,2 +1,5 @@ id: default label: Default +# Intentionally commented out, as status should default to TRUE upon entity +# creation. +# status: 1 diff --git a/core/modules/config/tests/config_test/config_test.module b/core/modules/config/tests/config_test/config_test.module index 96d4aa0..9a0e901 100644 --- a/core/modules/config/tests/config_test/config_test.module +++ b/core/modules/config/tests/config_test/config_test.module @@ -6,6 +6,7 @@ */ use Drupal\config_test\Plugin\Core\Entity\ConfigTest; +use Symfony\Component\HttpFoundation\RedirectResponse; require_once dirname(__FILE__) . '/config_test.hooks.inc'; @@ -116,6 +117,18 @@ function config_test_menu() { 'access callback' => TRUE, 'type' => MENU_LOCAL_TASK, ); + $items['admin/structure/config_test/manage/%config_test/enable'] = array( + 'title' => 'Enable', + 'page callback' => 'config_test_entity_enable', + 'page arguments' => array(4), + 'access callback' => TRUE, + ); + $items['admin/structure/config_test/manage/%config_test/disable'] = array( + 'title' => 'Disable', + 'page callback' => 'config_test_entity_disable', + 'page arguments' => array(4), + 'access callback' => TRUE, + ); return $items; } @@ -197,4 +210,28 @@ function config_test_cache_flush() { $GLOBALS['hook_cache_flush'] = __FUNCTION__; return array(); -} \ No newline at end of file +} + +/** + * Enables a ConfigTest object. + * + * @param Drupal\config_test\ConfigTest $config_test + * The ConfigTest object to enable. + */ +function config_test_entity_enable(ConfigTest $config_test) { + $config_test->enable(); + $config_test->save(); + return new RedirectResponse(url('admin/structure/config_test', array('absolute' => TRUE))); +} + +/** + * Disables a ConfigTest object. + * + * @param Drupal\config_test\ConfigTest $config_test + * The ConfigTest object to disable. + */ +function config_test_entity_disable(ConfigTest $config_test) { + $config_test->disable(); + $config_test->save(); + return new RedirectResponse(url('admin/structure/config_test', array('absolute' => TRUE))); +} diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/Plugin/Core/Entity/ConfigTest.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/Plugin/Core/Entity/ConfigTest.php index 8690b2a..6e2054f 100644 --- a/core/modules/config/tests/config_test/lib/Drupal/config_test/Plugin/Core/Entity/ConfigTest.php +++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/Plugin/Core/Entity/ConfigTest.php @@ -28,7 +28,8 @@ * entity_keys = { * "id" = "id", * "label" = "label", - * "uuid" = "uuid" + * "uuid" = "uuid", + * "status" = "status" * } * ) */ diff --git a/core/modules/views/config/views.view.archive.yml b/core/modules/views/config/views.view.archive.yml index f2b3a62..fa97466 100644 --- a/core/modules/views/config/views.view.archive.yml +++ b/core/modules/views/config/views.view.archive.yml @@ -1,4 +1,4 @@ -disabled: true +status: '0' api_version: '3.0' module: node name: archive diff --git a/core/modules/views/config/views.view.backlinks.yml b/core/modules/views/config/views.view.backlinks.yml index 8c1f2a7..83d3bf8 100644 --- a/core/modules/views/config/views.view.backlinks.yml +++ b/core/modules/views/config/views.view.backlinks.yml @@ -1,4 +1,4 @@ -disabled: true +status: '0' api_version: '3.0' module: search name: backlinks diff --git a/core/modules/views/config/views.view.comments_recent.yml b/core/modules/views/config/views.view.comments_recent.yml index 6e86a0c..05eb4da 100644 --- a/core/modules/views/config/views.view.comments_recent.yml +++ b/core/modules/views/config/views.view.comments_recent.yml @@ -1,4 +1,4 @@ -disabled: true +status: '0' api_version: '3.0' module: comment name: comments_recent diff --git a/core/modules/views/config/views.view.frontpage.yml b/core/modules/views/config/views.view.frontpage.yml index a635a0e..8feb942 100644 --- a/core/modules/views/config/views.view.frontpage.yml +++ b/core/modules/views/config/views.view.frontpage.yml @@ -1,4 +1,4 @@ -disabled: true +status: '0' api_version: '3.0' module: node name: frontpage diff --git a/core/modules/views/config/views.view.glossary.yml b/core/modules/views/config/views.view.glossary.yml index 966da7c..61c50ca 100644 --- a/core/modules/views/config/views.view.glossary.yml +++ b/core/modules/views/config/views.view.glossary.yml @@ -1,4 +1,4 @@ -disabled: true +status: '0' api_version: '3.0' module: node name: glossary diff --git a/core/modules/views/config/views.view.taxonomy_term.yml b/core/modules/views/config/views.view.taxonomy_term.yml index 742c5d7..3a333e8 100644 --- a/core/modules/views/config/views.view.taxonomy_term.yml +++ b/core/modules/views/config/views.view.taxonomy_term.yml @@ -1,4 +1,4 @@ -disabled: true +status: '0' api_version: '3.0' module: taxonomy name: taxonomy_term diff --git a/core/modules/views/config/views.view.tracker.yml b/core/modules/views/config/views.view.tracker.yml index 5d31e2f..f272cd8 100644 --- a/core/modules/views/config/views.view.tracker.yml +++ b/core/modules/views/config/views.view.tracker.yml @@ -1,4 +1,4 @@ -disabled: true +status: '0' api_version: '3.0' module: node name: tracker 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 3f39af8..d998cd1 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 @@ -33,7 +33,8 @@ * entity_keys = { * "id" = "name", * "label" = "human_name", - * "uuid" = "uuid" + * "uuid" = "uuid", + * "status" = "status" * } * ) */ @@ -109,16 +110,6 @@ class View extends ConfigEntityBase implements ViewStorageInterface { protected $base_field = 'nid'; /** - * Returns whether the view's status is disabled or not. - * - * This value is used for exported view, to provide some default views which - * aren't enabled. - * - * @var bool - */ - protected $disabled = FALSE; - - /** * The UUID for this entity. * * @var string @@ -168,29 +159,6 @@ public function id() { } /** - * Implements Drupal\views\ViewStorageInterface::enable(). - */ - public function enable() { - $this->disabled = FALSE; - $this->save(); - } - - /** - * Implements Drupal\views\ViewStorageInterface::disable(). - */ - public function disable() { - $this->disabled = TRUE; - $this->save(); - } - - /** - * Implements Drupal\views\ViewStorageInterface::isEnabled(). - */ - public function isEnabled() { - return !$this->disabled; - } - - /** * Return the human readable name for a view. * * When a certain view doesn't have a human readable name return the machine readable name. @@ -357,7 +325,7 @@ public function getPaths() { foreach ($this->display as $display) { if (!empty($display['display_options']['path'])) { $path = $display['display_options']['path']; - if ($this->isEnabled() && strpos($path, '%') === FALSE) { + if ($this->status() && strpos($path, '%') === FALSE) { $all_paths[] = l('/' . $path, $path); } else { diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/AreaTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaTest.php index ff50f64..81d3c70 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/AreaTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaTest.php @@ -128,8 +128,12 @@ public function testTitleArea() { 'title' => 'Overridden title', ), )); + $view->save(); $view->storage->enable(); + $view->storage->save(); + // Force the rebuild of the menu. + menu_router_rebuild(); $this->drupalGet('frontpage'); $this->assertText('Overridden title', 'Overridden title found.'); diff --git a/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php b/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php index 67dfac6..5da3cb0 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ModuleTest.php @@ -181,15 +181,15 @@ public function testLoadFunctions() { function testStatusFunctions() { $view = views_get_view('test_view_status')->storage; - $this->assertFalse($view->isEnabled(), 'The view status is disabled.'); + $this->assertFalse($view->status(), 'The view status is disabled.'); views_enable_view($view); - $this->assertTrue($view->isEnabled(), 'A view has been enabled.'); - $this->assertEqual($view->isEnabled(), views_view_is_enabled($view), 'views_view_is_enabled is correct.'); + $this->assertTrue($view->status(), 'A view has been enabled.'); + $this->assertEqual($view->status(), views_view_is_enabled($view), 'views_view_is_enabled is correct.'); views_disable_view($view); - $this->assertFalse($view->isEnabled(), 'A view has been disabled.'); - $this->assertEqual(!$view->isEnabled(), views_view_is_disabled($view), 'views_view_is_disabled is correct.'); + $this->assertFalse($view->status(), 'A view has been disabled.'); + $this->assertEqual(!$view->status(), views_view_is_disabled($view), 'views_view_is_disabled is correct.'); } /** diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php index b071b9e..08b3f46 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php @@ -102,9 +102,9 @@ function testDisplayPlugin() { // Test the enable/disable status of a display. $view->display_handler->setOption('enabled', FALSE); - $this->assertFalse($view->display_handler->isEnabled(), 'Make sure that isEnabled returns FALSE on a disabled display.'); + $this->assertFalse($view->display_handler->status(), 'Make sure that isEnabled returns FALSE on a disabled display.'); $view->display_handler->setOption('enabled', TRUE); - $this->assertTrue($view->display_handler->isEnabled(), 'Make sure that isEnabled returns TRUE on a disabled display.'); + $this->assertTrue($view->display_handler->status(), 'Make sure that isEnabled returns TRUE on a disabled display.'); } /** diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php index 8408aa4..f6c0371 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php @@ -27,7 +27,7 @@ class ViewStorageTest extends ViewTestBase { * @var array */ protected $config_properties = array( - 'disabled', + 'status', 'api_version', 'module', 'name', @@ -103,7 +103,7 @@ protected function loadTests() { // expected properties. $this->assertTrue($view instanceof View, 'Single View instance loaded.'); foreach ($this->config_properties as $property) { - $this->assertTrue($view->get($property), format_string('Property: @property loaded onto View.', array('@property' => $property))); + $this->assertTrue($view->get($property) !== NULL, format_string('Property: @property loaded onto View.', array('@property' => $property))); } // Check the displays have been loaded correctly from config display data. @@ -171,7 +171,7 @@ protected function createTests() { // Test all properties except displays. foreach ($properties as $property) { - $this->assertTrue($created->get($property), format_string('Property: @property created on View.', array('@property' => $property))); + $this->assertTrue($created->get($property) !== NULL, format_string('Property: @property created on View.', array('@property' => $property))); $this->assertIdentical($values[$property], $created->get($property), format_string('Property value: @property matches configuration value.', array('@property' => $property))); } @@ -214,21 +214,21 @@ protected function statusTests() { // The view should already be disabled. $view->enable(); - $this->assertTrue($view->isEnabled(), 'A view has been enabled.'); + $this->assertTrue($view->status(), 'A view has been enabled.'); // Check the saved values. $view->save(); $config = config('views.view.backlinks')->get(); - $this->assertFalse($config['disabled'], 'The changed disabled property was saved.'); + $this->assertTrue($config['status'], 'The changed status property was saved.'); // Disable the view. $view->disable(); - $this->assertFalse($view->isEnabled(), 'A view has been disabled.'); + $this->assertFalse($view->status(), 'A view has been disabled.'); // Check the saved values. $view->save(); $config = config('views.view.backlinks')->get(); - $this->assertTrue($config['disabled'], 'The changed disabled property was saved.'); + $this->assertFalse($config['status'], 'The changed disabled property was saved.'); } /** @@ -237,7 +237,7 @@ protected function statusTests() { * @param string $view_name * The machine name of the view. * - * @return object Drupal\views\ViewExecutable. + * @return \Drupal\views\Plugin\Core\Entity\View. * The loaded view object. */ protected function loadView($view_name) { diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php index 4ad1633..0da701e 100644 --- a/core/modules/views/lib/Drupal/views/ViewExecutable.php +++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php @@ -1160,7 +1160,7 @@ public function execute($display_id = NULL) { } // Don't allow to use deactivated displays, but display them on the live preview. - if (!$this->display_handler->isEnabled() && empty($this->live_preview)) { + if (!$this->display_handler->status() && empty($this->live_preview)) { $this->build_info['fail'] = TRUE; return FALSE; } @@ -1511,7 +1511,7 @@ public function executeHookBlockList($display_id = NULL) { */ public function access($displays = NULL, $account = NULL) { // Noone should have access to disabled views. - if (!$this->storage->isEnabled()) { + if (!$this->storage->status()) { return FALSE; } diff --git a/core/modules/views/lib/Drupal/views/ViewStorageController.php b/core/modules/views/lib/Drupal/views/ViewStorageController.php index 05268d2..a79b94a 100644 --- a/core/modules/views/lib/Drupal/views/ViewStorageController.php +++ b/core/modules/views/lib/Drupal/views/ViewStorageController.php @@ -109,7 +109,7 @@ protected function getProperties(EntityInterface $entity) { 'base_table', 'core', 'description', - 'disabled', + 'status', 'display', 'human_name', 'module', diff --git a/core/modules/views/lib/Drupal/views/ViewStorageInterface.php b/core/modules/views/lib/Drupal/views/ViewStorageInterface.php index 01bb87d..9bd3ba5 100644 --- a/core/modules/views/lib/Drupal/views/ViewStorageInterface.php +++ b/core/modules/views/lib/Drupal/views/ViewStorageInterface.php @@ -13,22 +13,4 @@ * Defines an interface for View storage classes. */ interface ViewStorageInterface extends \IteratorAggregate, ConfigEntityInterface { - - /** - * Sets the configuration entity status to enabled. - */ - public function enable(); - - /** - * Sets the configuration entity status to disabled. - */ - public function disable(); - - /** - * Returns whether the configuration entity is enabled. - * - * @return bool - */ - public function isEnabled(); - } diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_access_none.yml b/core/modules/views/tests/views_test_config/config/views.view.test_access_none.yml index 79019ef..bdc6fff 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_access_none.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_access_none.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_access_perm.yml b/core/modules/views/tests/views_test_config/config/views.view.test_access_perm.yml index f509323..38bf63d 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_access_perm.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_access_perm.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_access_role.yml b/core/modules/views/tests/views_test_config/config/views.view.test_access_role.yml index 3d2b4d9..90c24eb 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_access_role.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_access_role.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_aggregate_count.yml b/core/modules/views/tests/views_test_config/config/views.view.test_aggregate_count.yml index 7a42247..0503fcf 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_aggregate_count.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_aggregate_count.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_alias.yml b/core/modules/views/tests/views_test_config/config/views.view.test_alias.yml index 3755f24..394209f 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_alias.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_alias.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: users core: 8.0-dev description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_argument_default_fixed.yml b/core/modules/views/tests/views_test_config/config/views.view.test_argument_default_fixed.yml index 061b209..95c27a0 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_argument_default_fixed.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_argument_default_fixed.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_comment_user_uid.yml b/core/modules/views/tests/views_test_config/config/views.view.test_comment_user_uid.yml index 4dca1cd..a6b4f11 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_comment_user_uid.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_comment_user_uid.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_destroy.yml b/core/modules/views/tests/views_test_config/config/views.view.test_destroy.yml index a28c6b1..e1a40f9 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_destroy.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_destroy.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '1' +status: '1' display: attachment_1: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_display.yml b/core/modules/views/tests/views_test_config/config/views.view.test_display.yml index d9c5430..3f044b4 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_display.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_display.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '1' +status: '1' display: block: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_executable_displays.yml b/core/modules/views/tests/views_test_config/config/views.view.test_executable_displays.yml index 8feb580..6249fd3 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_executable_displays.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_executable_displays.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: views_test_data core: '8' description: '' -disabled: '0' +status: '1' display: default: display_plugin: default diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_exposed_form.yml b/core/modules/views/tests/views_test_config/config/views.view.test_exposed_form.yml index 736ba03..7bcba8d 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_exposed_form.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_exposed_form.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_feed_display.yml b/core/modules/views/tests/views_test_config/config/views.view.test_feed_display.yml index 6ba9d11..63678af 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_feed_display.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_feed_display.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: 8.0-dev description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_field_get_entity.yml b/core/modules/views/tests/views_test_config/config/views.view.test_field_get_entity.yml index 5ba2fc9..46d6aea 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_field_get_entity.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_field_get_entity.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: comment core: 8.0-dev description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_field_tokens.yml b/core/modules/views/tests/views_test_config/config/views.view.test_field_tokens.yml index 01431a6..ea1cf47 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_field_tokens.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_field_tokens.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: views_test_data core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_field_type.yml b/core/modules/views/tests/views_test_config/config/views.view.test_field_type.yml index c9172bc..d137c70 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_field_type.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_field_type.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_filter_date_between.yml b/core/modules/views/tests/views_test_config/config/views.view.test_filter_date_between.yml index 71f4b2f..f69c4f2 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_filter_date_between.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_filter_date_between.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_filter_group_override.yml b/core/modules/views/tests/views_test_config/config/views.view.test_filter_group_override.yml index 379eff6..95b3450 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_filter_group_override.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_filter_group_override.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_filter_groups.yml b/core/modules/views/tests/views_test_config/config/views.view.test_filter_groups.yml index d71c02e..50db439 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_filter_groups.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_filter_groups.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_filter_node_uid_revision.yml b/core/modules/views/tests/views_test_config/config/views.view.test_filter_node_uid_revision.yml index 69000ec..303b3cf 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_filter_node_uid_revision.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_filter_node_uid_revision.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: 8.0-dev description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_glossary.yml b/core/modules/views/tests/views_test_config/config/views.view.test_glossary.yml index 33045e5..a23afff 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_glossary.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_glossary.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_group_by_count.yml b/core/modules/views/tests/views_test_config/config/views.view.test_group_by_count.yml index 7ea0ab8..a5ea4a2 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_group_by_count.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_group_by_count.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_group_by_in_filters.yml b/core/modules/views/tests/views_test_config/config/views.view.test_group_by_in_filters.yml index c494b09..28a9dc6 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_group_by_in_filters.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_group_by_in_filters.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_groupwise_term.yml b/core/modules/views/tests/views_test_config/config/views.view.test_groupwise_term.yml index 5240f0c..bc8da18 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_groupwise_term.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_groupwise_term.yml @@ -3,7 +3,7 @@ base_field: tid base_table: taxonomy_term_data core: 8.0-dev description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_groupwise_user.yml b/core/modules/views/tests/views_test_config/config/views.view.test_groupwise_user.yml index 7d79d11..5d107d4 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_groupwise_user.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_groupwise_user.yml @@ -3,7 +3,7 @@ base_field: uid base_table: users core: 8.0-dev description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_handler_relationships.yml b/core/modules/views/tests/views_test_config/config/views.view.test_handler_relationships.yml index 409fb2c..3945202 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_handler_relationships.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_handler_relationships.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_pager_full.yml b/core/modules/views/tests/views_test_config/config/views.view.test_pager_full.yml index 08be354..0b808f2 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_pager_full.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_pager_full.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_pager_none.yml b/core/modules/views/tests/views_test_config/config/views.view.test_pager_none.yml index 7b20316..40b79bd 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_pager_none.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_pager_none.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_pager_some.yml b/core/modules/views/tests/views_test_config/config/views.view.test_pager_some.yml index d9ecda5..57f7d4a 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_pager_some.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_pager_some.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_plugin_argument_default_current_user.yml b/core/modules/views/tests/views_test_config/config/views.view.test_plugin_argument_default_current_user.yml index 54180b6..be3332c 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_plugin_argument_default_current_user.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_plugin_argument_default_current_user.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_redirect_view.yml b/core/modules/views/tests/views_test_config/config/views.view.test_redirect_view.yml index 1217693..6946006 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_redirect_view.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_redirect_view.yml @@ -74,6 +74,6 @@ display: display_options: path: test-redirect-view base_field: nid -disabled: '0' +status: '1' module: views langcode: und diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_store_pager_settings.yml b/core/modules/views/tests/views_test_config/config/views.view.test_store_pager_settings.yml index 0c4acfe..26d11cf 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_store_pager_settings.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_store_pager_settings.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_taxonomy_node_term_data.yml b/core/modules/views/tests/views_test_config/config/views.view.test_taxonomy_node_term_data.yml index 383766a..e558bcf 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_taxonomy_node_term_data.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_taxonomy_node_term_data.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_tokens.yml b/core/modules/views/tests/views_test_config/config/views.view.test_tokens.yml index f6e640c..baa7de1 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_tokens.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_tokens.yml @@ -53,5 +53,5 @@ display: options: { } path: test_tokens base_field: id -disabled: '0' +status: '1' module: views diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_user_relationship.yml b/core/modules/views/tests/views_test_config/config/views.view.test_user_relationship.yml index 096fa16..7262ff0 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_user_relationship.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_user_relationship.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_user_uid_argument.yml b/core/modules/views/tests/views_test_config/config/views.view.test_user_uid_argument.yml index 7dfce3e..03a5c54 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_user_uid_argument.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_user_uid_argument.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: users core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_view.yml b/core/modules/views/tests/views_test_config/config/views.view.test_view.yml index 57dd103..85742da 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_view.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_view.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: views_test_data core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_view_argument_validate_numeric.yml b/core/modules/views/tests/views_test_config/config/views.view.test_view_argument_validate_numeric.yml index 446aa63..2614c1b 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_view_argument_validate_numeric.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_view_argument_validate_numeric.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_view_argument_validate_php.yml b/core/modules/views/tests/views_test_config/config/views.view.test_view_argument_validate_php.yml index 1b4dc28..13808c9 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_view_argument_validate_php.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_view_argument_validate_php.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_view_argument_validate_user.yml b/core/modules/views/tests/views_test_config/config/views.view.test_view_argument_validate_user.yml index 2750f43..b84b4ed 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_view_argument_validate_user.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_view_argument_validate_user.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_view_delete.yml b/core/modules/views/tests/views_test_config/config/views.view.test_view_delete.yml index ca28db8..cf80152 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_view_delete.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_view_delete.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_view_fieldapi.yml b/core/modules/views/tests/views_test_config/config/views.view.test_view_fieldapi.yml index fe2ecc0..17d25fe 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_view_fieldapi.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_view_fieldapi.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_view_handler_weight.yml b/core/modules/views/tests/views_test_config/config/views.view.test_view_handler_weight.yml index cf47d54..9cecaec 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_view_handler_weight.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_view_handler_weight.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: views_test_data core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_view_pager_full_zero_items_per_page.yml b/core/modules/views/tests/views_test_config/config/views.view.test_view_pager_full_zero_items_per_page.yml index 5b909ea..ad3fb4c 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_view_pager_full_zero_items_per_page.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_view_pager_full_zero_items_per_page.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_view_status.yml b/core/modules/views/tests/views_test_config/config/views.view.test_view_status.yml index 08261f5..47cdaef 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_view_status.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_view_status.yml @@ -12,5 +12,5 @@ display: display_title: Master position: '' base_field: id -disabled: '1' +status: '0' module: views diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_views_handler_field_user_name.yml b/core/modules/views/tests/views_test_config/config/views.view.test_views_handler_field_user_name.yml index 48522e0..9bec009 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_views_handler_field_user_name.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_views_handler_field_user_name.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: users core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_views_move_to_field.yml b/core/modules/views/tests/views_test_config/config/views.view.test_views_move_to_field.yml index 22642b5..af2c47f 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_views_move_to_field.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_views_move_to_field.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: views_test_data core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_views_move_to_handler.yml b/core/modules/views/tests/views_test_config/config/views.view.test_views_move_to_handler.yml index d66c95d..35c75d0 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_views_move_to_handler.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_views_move_to_handler.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: views_test_data core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_config/config/views.view.test_views_move_to_table.yml b/core/modules/views/tests/views_test_config/config/views.view.test_views_move_to_table.yml index 956a7f0..68f2028 100644 --- a/core/modules/views/tests/views_test_config/config/views.view.test_views_move_to_table.yml +++ b/core/modules/views/tests/views_test_config/config/views.view.test_views_move_to_table.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: views_old_table core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_data/config/views.view.test_access_dynamic.yml b/core/modules/views/tests/views_test_data/config/views.view.test_access_dynamic.yml index a78537d..b803b0e 100644 --- a/core/modules/views/tests/views_test_data/config/views.view.test_access_dynamic.yml +++ b/core/modules/views/tests/views_test_data/config/views.view.test_access_dynamic.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_data/config/views.view.test_access_static.yml b/core/modules/views/tests/views_test_data/config/views.view.test_access_static.yml index cd3a94c..398b23b 100644 --- a/core/modules/views/tests/views_test_data/config/views.view.test_access_static.yml +++ b/core/modules/views/tests/views_test_data/config/views.view.test_access_static.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_data/config/views.view.test_argument_default_current_user.yml b/core/modules/views/tests/views_test_data/config/views.view.test_argument_default_current_user.yml index 3cf754d..2f98257 100644 --- a/core/modules/views/tests/views_test_data/config/views.view.test_argument_default_current_user.yml +++ b/core/modules/views/tests/views_test_data/config/views.view.test_argument_default_current_user.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_data/config/views.view.test_click_sort.yml b/core/modules/views/tests/views_test_data/config/views.view.test_click_sort.yml index 8aa2eb2..b11f642 100644 --- a/core/modules/views/tests/views_test_data/config/views.view.test_click_sort.yml +++ b/core/modules/views/tests/views_test_data/config/views.view.test_click_sort.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: views_test_data core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_data/config/views.view.test_example_area.yml b/core/modules/views/tests/views_test_data/config/views.view.test_example_area.yml index 2a8fb0b..724b909 100644 --- a/core/modules/views/tests/views_test_data/config/views.view.test_example_area.yml +++ b/core/modules/views/tests/views_test_data/config/views.view.test_example_area.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_data/config/views.view.test_exposed_admin_ui.yml b/core/modules/views/tests/views_test_data/config/views.view.test_exposed_admin_ui.yml index d73dfb8..e3db7a2 100644 --- a/core/modules/views/tests/views_test_data/config/views.view.test_exposed_admin_ui.yml +++ b/core/modules/views/tests/views_test_data/config/views.view.test_exposed_admin_ui.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_data/config/views.view.test_field_classes.yml b/core/modules/views/tests/views_test_data/config/views.view.test_field_classes.yml index d2fe5b2..d390108 100644 --- a/core/modules/views/tests/views_test_data/config/views.view.test_field_classes.yml +++ b/core/modules/views/tests/views_test_data/config/views.view.test_field_classes.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: views_test_data core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_data/config/views.view.test_field_output.yml b/core/modules/views/tests/views_test_data/config/views.view.test_field_output.yml index 6d0d73f..594ff16 100644 --- a/core/modules/views/tests/views_test_data/config/views.view.test_field_output.yml +++ b/core/modules/views/tests/views_test_data/config/views.view.test_field_output.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: views_test_data core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_data/config/views.view.test_filter.yml b/core/modules/views/tests/views_test_data/config/views.view.test_filter.yml index 3f11e83..e0a40c3 100644 --- a/core/modules/views/tests/views_test_data/config/views.view.test_filter.yml +++ b/core/modules/views/tests/views_test_data/config/views.view.test_filter.yml @@ -1,7 +1,7 @@ api_version: '3.0' base_table: views_test_data core: 8 -disabled: false +status: true display: default: display_options: diff --git a/core/modules/views/tests/views_test_data/config/views.view.test_filter_in_operator_ui.yml b/core/modules/views/tests/views_test_data/config/views.view.test_filter_in_operator_ui.yml index a68c790..ac0d87d 100644 --- a/core/modules/views/tests/views_test_data/config/views.view.test_filter_in_operator_ui.yml +++ b/core/modules/views/tests/views_test_data/config/views.view.test_filter_in_operator_ui.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_data/config/views.view.test_page_display.yml b/core/modules/views/tests/views_test_data/config/views.view.test_page_display.yml index 92ed6c7..4a0906b 100644 --- a/core/modules/views/tests/views_test_data/config/views.view.test_page_display.yml +++ b/core/modules/views/tests/views_test_data/config/views.view.test_page_display.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_data/config/views.view.test_rename_reset_button.yml b/core/modules/views/tests/views_test_data/config/views.view.test_rename_reset_button.yml index e03d666..6c98333 100644 --- a/core/modules/views/tests/views_test_data/config/views.view.test_rename_reset_button.yml +++ b/core/modules/views/tests/views_test_data/config/views.view.test_rename_reset_button.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_data/config/views.view.test_style_mapping.yml b/core/modules/views/tests/views_test_data/config/views.view.test_style_mapping.yml index 30d4dd9..b9f34ef 100644 --- a/core/modules/views/tests/views_test_data/config/views.view.test_style_mapping.yml +++ b/core/modules/views/tests/views_test_data/config/views.view.test_style_mapping.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: views_test_data core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_data/config/views.view.test_user_name.yml b/core/modules/views/tests/views_test_data/config/views.view.test_user_name.yml index ab243bc..a8dbfb8 100644 --- a/core/modules/views/tests/views_test_data/config/views.view.test_user_name.yml +++ b/core/modules/views/tests/views_test_data/config/views.view.test_user_name.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: users core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/tests/views_test_data/config/views.view.test_views_groupby_save.yml b/core/modules/views/tests/views_test_data/config/views.view.test_views_groupby_save.yml index 05f9b5c..a5f74ee 100644 --- a/core/modules/views/tests/views_test_data/config/views.view.test_views_groupby_save.yml +++ b/core/modules/views/tests/views_test_data/config/views.view.test_views_groupby_save.yml @@ -2,7 +2,7 @@ api_version: '3.0' base_table: node core: '8' description: '' -disabled: '0' +status: '1' display: default: display_options: diff --git a/core/modules/views/views.module b/core/modules/views/views.module index cf10c1b..da4e038 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -640,7 +640,7 @@ function views_block_info() { $views = views_get_all_views(); foreach ($views as $view) { // disabled views get nothing. - if (!$view->isEnabled()) { + if (!$view->status()) { continue; } @@ -1378,7 +1378,7 @@ function views_get_applicable_views($type) { foreach ($views as $view) { // Skip disabled views. - if (!$view->isEnabled()) { + if (!$view->status()) { continue; } @@ -1396,7 +1396,7 @@ function views_get_applicable_views($type) { // This view uses_hook_menu. Clone it so that different handlers // don't trip over each other, and add it to the list. $v = $view->get('executable')->cloneView(); - if ($v->setDisplay($id) && $v->display_handler->isEnabled()) { + if ($v->setDisplay($id) && $v->display_handler->status()) { $result[] = array($v, $id); } // In PHP 4.4.7 and presumably earlier, if we do not unset $v @@ -1523,7 +1523,7 @@ function views_get_views_as_options($views_only = FALSE, $filter = 'all', $exclu * Returns TRUE if a view is enabled, FALSE otherwise. */ function views_view_is_enabled(View $view) { - return $view->isEnabled(); + return $view->status(); } /** @@ -1536,7 +1536,7 @@ function views_view_is_enabled(View $view) { * Returns TRUE if a view is disabled, FALSE otherwise. */ function views_view_is_disabled(View $view) { - return !$view->isEnabled(); + return !$view->status(); } /** diff --git a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php index 853d5c9..06514ef 100644 --- a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php +++ b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php @@ -139,7 +139,7 @@ public function form(array $form, array &$form_state, EntityInterface $view) { // Add a text that the display is disabled. if (!empty($view->get('executable')->displayHandlers[$display_id])) { - if (!$view->get('executable')->displayHandlers[$display_id]->isEnabled()) { + if (!$view->get('executable')->displayHandlers[$display_id]->status()) { $form['displays']['settings']['disabled']['#markup'] = t('This display is disabled.'); } } @@ -155,7 +155,7 @@ public function form(array $form, array &$form_state, EntityInterface $view) { $tab_content['#attributes']['class'][] = 'views-display-deleted'; } // Mark disabled displays as such. - if (isset($view->get('executable')->displayHandlers[$display_id]) && !$view->get('executable')->displayHandlers[$display_id]->isEnabled()) { + if (isset($view->get('executable')->displayHandlers[$display_id]) && !$view->get('executable')->displayHandlers[$display_id]->status()) { $tab_content['#attributes']['class'][] = 'views-display-disabled'; } $form['displays']['settings']['settings_content'] = array( @@ -350,7 +350,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[$display['id']]->isEnabled(); + $is_enabled = $view->get('executable')->displayHandlers[$display['id']]->status(); if ($display['id'] != 'default') { $build['top']['#theme_wrappers'] = array('container'); diff --git a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewListController.php b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewListController.php index ac8dc4e..7af6b94 100644 --- a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewListController.php +++ b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewListController.php @@ -21,8 +21,8 @@ class ViewListController extends EntityListController { public function load() { $entities = parent::load(); uasort($entities, function ($a, $b) { - $a_enabled = $a->isEnabled(); - $b_enabled = $b->isEnabled(); + $a_enabled = $a->status(); + $b_enabled = $b->status(); if ($a_enabled != $b_enabled) { return $a_enabled < $b_enabled; } @@ -46,7 +46,7 @@ public function buildRow(EntityInterface $view) { ), ), 'title' => t('Machine name: ') . $view->id(), - 'class' => array($view->isEnabled() ? 'views-ui-list-enabled' : 'views-ui-list-disabled'), + 'class' => array($view->status() ? 'views-ui-list-enabled' : 'views-ui-list-disabled'), ); } @@ -90,7 +90,7 @@ public function getOperations(EntityInterface $view) { 'href' => "$path/edit", 'weight' => -5, ); - if (!$view->isEnabled()) { + if (!$view->status()) { $definition['enable'] = array( 'title' => t('Enable'), 'ajax' => TRUE, diff --git a/core/modules/views/views_ui/views_ui.module b/core/modules/views/views_ui/views_ui.module index feb6553..d4a2f62 100644 --- a/core/modules/views/views_ui/views_ui.module +++ b/core/modules/views/views_ui/views_ui.module @@ -743,8 +743,9 @@ function views_ui_load($name) { * redirect back to the listing page. */ function views_ui_ajax_callback(ViewExecutable $view, $op) { - // Perform the operation. + // Perform the operation and save the view. $view->storage->$op(); + $view->save(); // If the request is via AJAX, return the rendered list as JSON. if (drupal_container()->get('request')->request->get('js')) {