diff --git a/core/modules/comment/lib/Drupal/comment/Tests/Views/FilterUserUIDTest.php b/core/modules/comment/lib/Drupal/comment/Tests/Views/FilterUserUIDTest.php index 9132d5a3684e89234ed1253b5078998d990c00c0..abe0e4e8765f336e5e6d0829203046af669d9a87 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/Views/FilterUserUIDTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/Views/FilterUserUIDTest.php @@ -32,7 +32,7 @@ public static function getInfo() { function testCommentUserUIDTest() { $view = views_get_view('test_comment_user_uid'); $view->setDisplay(); - $view->removeItem('default', 'argument', 'uid_touch'); + $view->removeHandler('default', 'argument', 'uid_touch'); $options = array( 'id' => 'uid_touch', @@ -40,7 +40,7 @@ function testCommentUserUIDTest() { 'field' => 'uid_touch', 'value' => array($this->loggedInUser->id()), ); - $view->addItem('default', 'filter', 'node_field_data', 'uid_touch', $options); + $view->addHandler('default', 'filter', 'node_field_data', 'uid_touch', $options); $this->executeView($view, array($this->account->id())); $result_set = array( array( diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/row/EntityReference.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/row/EntityReference.php index 7ee45e630ca8421c3f61091caee56ed225efd680..0059b32e80626493523d8ce7657fa4612e1ba9fd 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/row/EntityReference.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/row/EntityReference.php @@ -51,7 +51,7 @@ public function buildOptionsForm(&$form, &$form_state) { public function preRender($row) { // Force all fields to be inline by default. if (empty($this->options['inline'])) { - $fields = $this->view->getItems('field', $this->displayHandler->display['id']); + $fields = $this->view->getHandlers('field', $this->displayHandler->display['id']); $this->options['inline'] = drupal_map_assoc(array_keys($fields)); } diff --git a/core/modules/field/lib/Drupal/field/Tests/Views/FieldUITest.php b/core/modules/field/lib/Drupal/field/Tests/Views/FieldUITest.php index 57482276ec99d32195ab18f5e3997a01194e0c3e..07507feb75140a7ac73e87b1a7c2b1e5767bbe18 100644 --- a/core/modules/field/lib/Drupal/field/Tests/Views/FieldUITest.php +++ b/core/modules/field/lib/Drupal/field/Tests/Views/FieldUITest.php @@ -63,7 +63,7 @@ public function setUp() { * Tests basic field handler settings in the UI. */ public function testHandlerUI() { - $url = "admin/structure/views/nojs/config-item/test_view_fieldapi/default/field/field_name_0"; + $url = "admin/structure/views/nojs/handler/test_view_fieldapi/default/field/field_name_0"; $this->drupalGet($url); // Tests the available formatter options. @@ -101,7 +101,7 @@ public function testHandlerUIAggregation() { $edit = array('group_by' => '1'); $this->drupalPostForm('admin/structure/views/nojs/display/test_view_fieldapi/default/group_by', $edit, t('Apply')); - $url = "admin/structure/views/nojs/config-item/test_view_fieldapi/default/field/field_name_0"; + $url = "admin/structure/views/nojs/handler/test_view_fieldapi/default/field/field_name_0"; $this->drupalGet($url); $this->assertResponse(200); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php index 6b59ca618356a3b4e48dd2c5fc789f9cf6b1f834..2de652247c676e4e84356fef3266fd14ceb25bcc 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php @@ -76,7 +76,7 @@ public function testFilterUI() { } } - $this->drupalGet('admin/structure/views/nojs/config-item/test_filter_taxonomy_index_tid/default/filter/tid'); + $this->drupalGet('admin/structure/views/nojs/handler/test_filter_taxonomy_index_tid/default/filter/tid'); $result = $this->xpath('//select[@id="edit-options-value"]/option'); @@ -100,7 +100,7 @@ public function testFilterUI() { $display =& $view->getDisplay('default'); $display['display_options']['filters']['tid']['type'] = 'textfield'; $view->save(); - $this->drupalGet('admin/structure/views/nojs/config-item/test_filter_taxonomy_index_tid/default/filter/tid'); + $this->drupalGet('admin/structure/views/nojs/handler/test_filter_taxonomy_index_tid/default/filter/tid'); $result = $this->xpath('//input[@id="edit-options-value"]/@data-autocomplete-path'); $this->assertEqual((string) $result[0], url('taxonomy/autocomplete_vid/tags')); } diff --git a/core/modules/tracker/lib/Drupal/tracker/Tests/Views/TrackerUserUidTest.php b/core/modules/tracker/lib/Drupal/tracker/Tests/Views/TrackerUserUidTest.php index 54a689b8f10772f672668250a14128c5140ac0eb..9917cad4845e7a3df9270fdf9fa760e46bda3e8b 100644 --- a/core/modules/tracker/lib/Drupal/tracker/Tests/Views/TrackerUserUidTest.php +++ b/core/modules/tracker/lib/Drupal/tracker/Tests/Views/TrackerUserUidTest.php @@ -60,7 +60,7 @@ public function testUserUid() { $view->destroy(); // Remove the filter now, so only the argument will affect the query. - $view->removeItem('default', 'filter', 'uid_touch_tracker'); + $view->removeHandler('default', 'filter', 'uid_touch_tracker'); // Test the incorrect argument UID. $view->initHandlers(); diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php b/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php index e6cb0c47735d95e0d3857b35fdc07519f5d289b3..af8e58d132f1e255a114ac735a3304566e7abc46 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php @@ -82,7 +82,7 @@ public function testBulkForm() { // Remove the user status filter from the view. $view = views_get_view('test_user_bulk_form'); - $view->removeItem('default', 'filter', 'status'); + $view->removeHandler('default', 'filter', 'status'); $view->storage->save(); // Ensure the anonymous user is found. diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFilterUserNameTest.php b/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFilterUserNameTest.php index 1f44b70ef4f2223be685e5bffaba8db560b55192..f4eefddea8836a1c97bdaf382d2b17860fc4683b 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFilterUserNameTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFilterUserNameTest.php @@ -98,7 +98,7 @@ public function testAdminUserInterface() { $admin_user = $this->drupalCreateUser(array('administer views', 'administer site configuration')); $this->drupalLogin($admin_user); - $path = 'admin/structure/views/nojs/config-item/test_user_name/default/filter/uid'; + $path = 'admin/structure/views/nojs/handler/test_user_name/default/filter/uid'; $this->drupalGet($path); // Pass in an invalid username, the validation should catch it. 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 9590e1caa0620aa84bff16e695779eb1810e9a2b..1b8c4ceefd329107d36d54a6b8bb332f04d8d958 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php @@ -852,7 +852,7 @@ public function displayExposedForm($form, &$form_state) { $this->defaultExposeOptions(); } - $form_state['view']->getExecutable()->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $item); + $form_state['view']->getExecutable()->setHandler($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); 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 4a181718350e75d932ee3c3b7791813e152853cc..0622d86151479296603adaeb38410b592c4a8f7e 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']->getExecutable()->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $item); + $form_state['view']->getExecutable()->setHandler($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); @@ -1089,7 +1089,7 @@ public function addGroupForm($form, &$form_state) { // Add a new row. $item['group_info']['group_items'][] = array(); - $form_state['view']->getExecutable()->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $item); + $form_state['view']->getExecutable()->setHandler($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 06d4d0317f21407ff7e10cdb1e920bb38837461d..3a1597dddee5c7fad0d835dc5cd11025835ef254 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 @@ -205,7 +205,7 @@ protected function leftQuery($options) { $sort = $options['subquery_sort']; list($sort_table, $sort_field) = explode('.', $sort); $sort_options = array('order' => $options['subquery_order']); - $temp_view->addItem('default', 'sort', $sort_table, $sort_field, $sort_options); + $temp_view->addHandler('default', 'sort', $sort_table, $sort_field, $sort_options); } // Get the namespace string. @@ -217,20 +217,20 @@ protected function leftQuery($options) { $temp_view->args[] = '**CORRELATED**'; // Add the base table ID field. - $temp_view->addItem('default', 'field', $this->definition['base'], $this->definition['field']); + $temp_view->addHandler('default', 'field', $this->definition['base'], $this->definition['field']); $relationship_id = NULL; // Add the used relationship for the subjoin, if defined. if (isset($this->definition['relationship'])) { list($relationship_table, $relationship_field) = explode(':', $this->definition['relationship']); - $relationship_id = $temp_view->addItem('default', 'relationship', $relationship_table, $relationship_field); + $relationship_id = $temp_view->addHandler('default', 'relationship', $relationship_table, $relationship_field); } $temp_item_options = array('relationship' => $relationship_id); // Add the correct argument for our relationship's base // ie the 'how to get back to base' argument. // The relationship definition tells us which one to use. - $temp_view->addItem('default', 'argument', $this->definition['argument table'], $this->definition['argument field'], $temp_item_options); + $temp_view->addHandler('default', 'argument', $this->definition['argument table'], $this->definition['argument field'], $temp_item_options); // Build the view. The creates the query object and produces the query // string but does not run any queries. @@ -269,7 +269,7 @@ protected function leftQuery($options) { $where = &$subquery->conditions(); $this->alterSubqueryCondition($subquery, $where); // Not sure why, but our sort order clause doesn't have a table. - // TODO: the call to add_item() above to add the sort handler is probably + // TODO: the call to addHandler() above to add the sort handler is probably // wrong -- needs attention from someone who understands it. // In the meantime, this works, but with a leap of faith... $orders = &$subquery->getOrderBy(); diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php index a4445938a200b051db0f5dd86528f4e4ce39d04d..ef0a8c737c345be9d9fdf4693927789d19715030 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php @@ -103,9 +103,9 @@ public function testEntityArea() { // Change the view mode of the area handler. $view = views_get_view('test_entity_area'); - $item = $view->getItem('default', 'header', 'entity_entity_test'); + $item = $view->getHandler('default', 'header', 'entity_entity_test'); $item['view_mode'] = 'test'; - $view->setItem('default', 'header', 'entity_entity_test', $item); + $view->setHandler('default', 'header', 'entity_entity_test', $item); $preview = $view->preview('default', array($entities[1]->id())); $this->drupalSetContent(drupal_render($preview)); 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 78f793493332fb135973a7966bb6e4719c1de3f0..7b0368e26661fd6c7a772623535423e162e02fa4 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/AreaTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaTest.php @@ -67,7 +67,7 @@ public function testUI() { $types = array('header', 'footer', 'empty'); $labels = array(); foreach ($types as $type) { - $edit_path = 'admin/structure/views/nojs/config-item/test_example_area/default/' . $type .'/test_example'; + $edit_path = 'admin/structure/views/nojs/handler/test_example_area/default/' . $type .'/test_example'; // First setup an empty label. $this->drupalPostForm($edit_path, array(), t('Apply')); @@ -127,7 +127,7 @@ public function testRenderAreaToken() { $view = views_get_view('test_example_area'); $view->initHandlers(); - $this->drupalGet('admin/structure/views/nojs/config-item/test_example_area/default/empty/test_example'); + $this->drupalGet('admin/structure/views/nojs/handler/test_example_area/default/empty/test_example'); // Test that the list is token present. $element = $this->xpath('//ul[@class="global-tokens"]'); diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/FilterDateTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/FilterDateTest.php index 72b7b21b212ecb9787d83784cf3058fc7fa2f543..e73a5b6dc391d4b857a0780f843fbbb34dff0555 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/FilterDateTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/FilterDateTest.php @@ -153,7 +153,7 @@ protected function _testUiValidation() { $this->drupalLogin($this->drupalCreateUser(array('administer views', 'administer site configuration'))); menu_router_rebuild(); $this->drupalGet('admin/structure/views/view/test_filter_date_between/edit'); - $this->drupalGet('admin/structure/views/nojs/config-item/test_filter_date_between/default/filter/created'); + $this->drupalGet('admin/structure/views/nojs/handler/test_filter_date_between/default/filter/created'); $edit = array(); // Generate a definitive wrong value, which should be checked by validation. 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 7808e0c9f89ed7c6a9e0509e2cc13a85c86ace41..5f73592a7079f37c3e0f8c0e2af2c09e2079d4db 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerAllTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerAllTest.php @@ -85,7 +85,7 @@ public function testHandlers() { $options['value'] = array(1); } } - $view->addItem('default', $type, $base_table, $field, $options); + $view->addHandler('default', $type, $base_table, $field, $options); } } } diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php index 91d96542da4c3993e4233de6b2a5300dc3cfc720..d4f7ba6bd35f522cc021a7735dbc5affa7fd76d9 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php @@ -78,7 +78,7 @@ function testFilterInOperatorUi() { $this->drupalLogin($admin_user); menu_router_rebuild(); - $path = 'admin/structure/views/nojs/config-item/test_filter_in_operator_ui/default/filter/type'; + $path = 'admin/structure/views/nojs/handler/test_filter_in_operator_ui/default/filter/type'; $this->drupalGet($path); $this->assertFieldByName('options[expose][reduce]', FALSE); @@ -244,7 +244,7 @@ public function testRelationshipUI() { $this->drupalLogin($views_admin); // Make sure the link to the field options exists. - $handler_options_path = 'admin/structure/views/nojs/config-item/test_handler_relationships/default/field/title'; + $handler_options_path = 'admin/structure/views/nojs/handler/test_handler_relationships/default/field/title'; $view_edit_path = 'admin/structure/views/view/test_handler_relationships/edit'; $this->drupalGet($view_edit_path); $this->assertLinkByHref($handler_options_path); @@ -270,7 +270,7 @@ public function testRelationshipUI() { $this->assertEqual($options, $expected_options); // Remove the relationship and make sure no relationship option appears. - $this->drupalPostForm('admin/structure/views/nojs/config-item/test_handler_relationships/default/relationship/nid', array(), t('Remove')); + $this->drupalPostForm('admin/structure/views/nojs/handler/test_handler_relationships/default/relationship/nid', array(), t('Remove')); $this->drupalGet($handler_options_path); $this->assertNoFieldByName($relationship_name, 'Make sure that no relationship option is available'); } @@ -282,9 +282,9 @@ public function testSetRelationship() { $view = views_get_view('test_handler_relationships'); $view->setDisplay(); // Setup a broken relationship. - $view->addItem('default', 'relationship', $this->randomName(), $this->randomName(), array(), 'broken_relationship'); + $view->addHandler('default', 'relationship', $this->randomName(), $this->randomName(), array(), 'broken_relationship'); // Setup a valid relationship. - $view->addItem('default', 'relationship', 'comment', 'node', array('relationship' => 'cid'), 'valid_relationship'); + $view->addHandler('default', 'relationship', 'comment', 'node', array('relationship' => 'cid'), 'valid_relationship'); $view->initHandlers(); $field = $view->field['title']; diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/ArgumentDefaultTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/ArgumentDefaultTest.php index cf81e2e456c61c818044340cddc34d710967557e..ced33c29e47e81f3ce109b5a10b09f66770fbaef 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/ArgumentDefaultTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/ArgumentDefaultTest.php @@ -59,7 +59,7 @@ public function testArgumentDefaultPlugin() { ), 'default_action' => 'default' ); - $id = $view->addItem('default', 'argument', 'views_test_data', 'name', $options); + $id = $view->addHandler('default', 'argument', 'views_test_data', 'name', $options); $view->initHandlers(); $plugin = $view->argument[$id]->getPlugin('argument_default'); $this->assertTrue($plugin instanceof ArgumentDefaultTestPlugin, 'The correct argument default plugin is used.'); @@ -94,7 +94,7 @@ function testArgumentDefaultNoOptions() { $edit = array( 'options[default_argument_type]' => $argument_type, ); - $this->drupalPostForm('admin/structure/views/nojs/config-item/test_argument_default_current_user/default/argument/uid', $edit, t('Apply')); + $this->drupalPostForm('admin/structure/views/nojs/handler/test_argument_default_current_user/default/argument/uid', $edit, t('Apply')); // Note, the undefined index error has two spaces after it. $error = array( 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 0ea956526aef5632e20de91da46771349d738430..ae966090e148d548e519f1abfc462158c494deec 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php @@ -297,26 +297,26 @@ public function testOutputIsEmpty() { 'id' => 'id', 'value' => array('value' => 7297) ); - $view->setItem('default', 'filter', 'id', $item); + $view->setHandler('default', 'filter', 'id', $item); $this->executeView($view); $this->assertFalse(count($view->result), 'Ensure the result of the view is empty.'); $this->assertFalse($view->display_handler->outputIsEmpty(), 'Ensure the view output is marked as not empty, because the empty text still appears.'); $view->destroy(); // Remove the empty area, but mark the header area to still appear. - $view->removeItem('default', 'empty', 'area'); - $item = $view->getItem('default', 'header', 'area'); + $view->removeHandler('default', 'empty', 'area'); + $item = $view->getHandler('default', 'header', 'area'); $item['empty'] = TRUE; - $view->setItem('default', 'header', 'area', $item); + $view->setHandler('default', 'header', 'area', $item); $this->executeView($view); $this->assertFalse(count($view->result), 'Ensure the result of the view is empty.'); $this->assertFalse($view->display_handler->outputIsEmpty(), 'Ensure the view output is marked as not empty, because the header text still appears.'); $view->destroy(); // Hide the header on empty results. - $item = $view->getItem('default', 'header', 'area'); + $item = $view->getHandler('default', 'header', 'area'); $item['empty'] = FALSE; - $view->setItem('default', 'header', 'area', $item); + $view->setHandler('default', 'header', 'area', $item); $this->executeView($view); $this->assertFalse(count($view->result), 'Ensure the result of the view is empty.'); $this->assertTrue($view->display_handler->outputIsEmpty(), 'Ensure the view output is marked as empty.'); diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php index 9ac028ea7aa26eb4cc0fcea787b2410d4b8ba6a6..3d0675866a427a586a778e013ba5f37ef9cc255b 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php @@ -308,10 +308,10 @@ public function testPropertyMethods() { $view->setResponse($new_response); $this->assertIdentical(spl_object_hash($view->getResponse()), spl_object_hash($new_response), 'New response object correctly set.'); - // Test the generateItemId() method. + // Test the generateHandlerId() method. $test_ids = drupal_map_assoc(array('test', 'test_1')); - $this->assertEqual($view->generateItemId('new', $test_ids), 'new'); - $this->assertEqual($view->generateItemId('test', $test_ids), 'test_2'); + $this->assertEqual($view->generateHandlerId('new', $test_ids), 'new'); + $this->assertEqual($view->generateHandlerId('test', $test_ids), 'test_2'); // Test the getPath() method. $path = $this->randomName(); diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php index 4fc2f5c1a5e7c33277515c5b6d5985d6547f3655..44955a52aef009ebfe6136770707d072c005ea8f 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php @@ -257,11 +257,11 @@ protected function displayMethodTests() { $display_id = 'default'; $expected_items = array(); - // Tests addItem with getItem. + // Tests addHandler with getItem. // Therefore add one item without any optioins and one item with some // options. - $id1 = $view->addItem($display_id, 'field', 'views_test_data', 'id'); - $item1 = $view->getItem($display_id, 'field', 'id'); + $id1 = $view->addHandler($display_id, 'field', 'views_test_data', 'id'); + $item1 = $view->getHandler($display_id, 'field', 'id'); $expected_items[$id1] = $expected_item = array( 'id' => 'id', 'table' => 'views_test_data', @@ -276,8 +276,8 @@ protected function displayMethodTests() { 'text' => $this->randomName() ) ); - $id2 = $view->addItem($display_id, 'field', 'views_test_data', 'name', $options); - $item2 = $view->getItem($display_id, 'field', 'name'); + $id2 = $view->addHandler($display_id, 'field', 'views_test_data', 'name', $options); + $item2 = $view->getHandler($display_id, 'field', 'name'); $expected_items[$id2] = $expected_item = array( 'id' => 'name', 'table' => 'views_test_data', @@ -288,7 +288,7 @@ protected function displayMethodTests() { $this->assertEqual($item2, $expected_item); // Tests the expected fields from the previous additions. - $this->assertEqual($view->getItems('field', $display_id), $expected_items); + $this->assertEqual($view->getHandlers('field', $display_id), $expected_items); // Alter an existing item via setItem and check the result via getItem // and getItems. @@ -298,14 +298,14 @@ protected function displayMethodTests() { ) ) + $item1; $expected_items[$id1] = $item; - $view->setItem($display_id, 'field', $id1, $item); - $this->assertEqual($view->getItem($display_id, 'field', 'id'), $item); - $this->assertEqual($view->getItems('field', $display_id), $expected_items); + $view->setHandler($display_id, 'field', $id1, $item); + $this->assertEqual($view->getHandler($display_id, 'field', 'id'), $item); + $this->assertEqual($view->getHandlers('field', $display_id), $expected_items); // Test removeItem method. unset($expected_items[$id2]); - $view->removeItem($display_id, 'field', $id2); - $this->assertEqual($view->getItems('field', $display_id), $expected_items); + $view->removeHandler($display_id, 'field', $id2); + $this->assertEqual($view->getHandlers('field', $display_id), $expected_items); } /** diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php index c9b097a0e0746f064378169aa30421cc69b6392a..09346d3408c0bc2364e051d2fb92552eef854c0b 100644 --- a/core/modules/views/lib/Drupal/views/ViewExecutable.php +++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php @@ -1958,14 +1958,14 @@ public static function getPluginTypes() { * @return string * The unique ID for this handler instance. */ - public function addItem($display_id, $type, $table, $field, $options = array(), $id = NULL) { + public function addHandler($display_id, $type, $table, $field, $options = array(), $id = NULL) { $types = $this::viewsHandlerTypes(); $this->setDisplay($display_id); $fields = $this->displayHandlers->get($display_id)->getOption($types[$type]['plural']); if (empty($id)) { - $id = $this->generateItemId($field, $fields); + $id = $this->generateHandlerId($field, $fields); } // If the desired type is not found, use the original value directly. @@ -2008,7 +2008,7 @@ public function addItem($display_id, $type, $table, $field, $options = array(), * integer to make it unique, e.g., "{$requested_id}_1", * "{$requested_id}_2", etc. */ - public static function generateItemId($requested_id, $existing_items) { + public static function generateHandlerId($requested_id, $existing_items) { $count = 0; $id = $requested_id; while (!empty($existing_items[$id])) { @@ -2029,7 +2029,7 @@ public static function generateItemId($requested_id, $existing_items) { * @return array * An array of handler instances of a given type for this display. */ - public function getItems($type, $display_id = NULL) { + public function getHandlers($type, $display_id = NULL) { $this->setDisplay($display_id); if (!isset($display_id)) { @@ -2055,7 +2055,7 @@ public function getItems($type, $display_id = NULL) { * Either the handler instance's configuration, or NULL if the handler is * not used on the display. */ - public function getItem($display_id, $type, $id) { + public function getHandler($display_id, $type, $id) { // Get info about the types so we can get the right data. $types = static::viewsHandlerTypes(); // Initialize the display @@ -2081,7 +2081,7 @@ public function getItem($display_id, $type, $id) { * * @see set_item_option() */ - public function setItem($display_id, $type, $id, $item) { + public function setHandler($display_id, $type, $id, $item) { // Get info about the types so we can get the right data. $types = static::viewsHandlerTypes(); // Initialize the display. @@ -2107,7 +2107,7 @@ public function setItem($display_id, $type, $id, $item) { * @param string $id * The ID of the handler being removed. */ - public function removeItem($display_id, $type, $id) { + public function removeHandler($display_id, $type, $id) { // Get info about the types so we can get the right data. $types = static::viewsHandlerTypes(); // Initialize the display. @@ -2142,10 +2142,10 @@ public function removeItem($display_id, $type, $id) { * * @see set_item() */ - public function setItemOption($display_id, $type, $id, $option, $value) { - $item = $this->getItem($display_id, $type, $id); + public function setHandlerOption($display_id, $type, $id, $option, $value) { + $item = $this->getHandler($display_id, $type, $id); $item[$option] = $value; - $this->setItem($display_id, $type, $id, $item); + $this->setHandler($display_id, $type, $id, $item); } /** diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js index 0f620bf1bf5fc9c151c09f5cb3c6a0f8f5ba4420..bb54d507f4d8d323eaf65259b560b84747c03e20 100644 --- a/core/modules/views_ui/js/views-admin.js +++ b/core/modules/views_ui/js/views-admin.js @@ -164,12 +164,12 @@ Drupal.behaviors.addItemForm = { attach: function (context) { var $context = $(context); var $form = $context; - // The add item form may have an id of views-ui-add-item-form--n. - if (!$context.is('form[id^="views-ui-add-item-form"]')) { - $form = $context.find('form[id^="views-ui-add-item-form"]'); + // The add handler form may have an id of views-ui-add-handler-form--n. + if (!$context.is('form[id^="views-ui-add-handler-form"]')) { + $form = $context.find('form[id^="views-ui-add-handler-form"]'); } - if ($form.once('views-ui-add-item-form').length) { - // If we we have an unprocessed views-ui-add-item-form, let's instantiate. + if ($form.once('views-ui-add-handler-form').length) { + // If we we have an unprocessed views-ui-add-handler-form, let's instantiate. new Drupal.viewsUi.AddItemForm($form); } } @@ -285,9 +285,9 @@ Drupal.behaviors.viewsUiSearchOptions = { attach: function (context) { var $context = $(context); var $form = $context; - // The add item form may have an id of views-ui-add-item-form--n. - if (!$context.is('form[id^="views-ui-add-item-form"]')) { - $form = $context.find('form[id^="views-ui-add-item-form"]'); + // The add handler form may have an id of views-ui-add-handler-form--n. + if (!$context.is('form[id^="views-ui-add-handler-form"]')) { + $form = $context.find('form[id^="views-ui-add-handler-form"]'); } // Make sure we don't add more than one event handler to the same form. if ($form.once('views-ui-filter-options').length) { @@ -764,7 +764,7 @@ $.extend(Drupal.viewsUi.RearrangeFilterHandler.prototype, { Drupal.behaviors.viewsFilterConfigSelectAll = { attach: function (context) { // Show the select all checkbox. - $(context).find('#views-ui-config-item-form div.form-item-options-value-all').once('filterConfigSelectAll') + $(context).find('#views-ui-handler-form div.form-item-options-value-all').once('filterConfigSelectAll') .show() .find('input[type=checkbox]') .on('click', function () { @@ -775,7 +775,7 @@ Drupal.behaviors.viewsFilterConfigSelectAll = { }); }); // Uncheck the select all checkbox if any of the others are unchecked. - $('#views-ui-config-item-form').find('div.form-type-checkbox').not($('.form-item-options-value-all')) + $('#views-ui-handler-form').find('div.form-type-checkbox').not($('.form-item-options-value-all')) .find('input[type=checkbox]') .on('click', function () { if ($(this).is('checked') === false) { 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 90c1d58f117a9209536fe8a1a8a64bb0af8ee2a0..0ee468ab71336192af61a0be1398e09e6f853e41 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 @@ -103,7 +103,7 @@ public function reportFields() { foreach ($executable->displayHandlers as $display_id => $display) { if ($executable->setDisplay($display_id)) { foreach ($handler_types as $type => $info) { - foreach ($executable->getItems($type, $display_id) as $item) { + foreach ($executable->getHandlers($type, $display_id) as $item) { $table_data = $this->viewsData->get($item['table']); if (isset($table_data[$item['field']]) && isset($table_data[$item['field']][$type]) && $field_data = $table_data[$item['field']][$type]) { 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/AddHandler.php similarity index 94% rename from core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php rename to core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddHandler.php index 891f383b0dd13a9bb29ab35a01f430bb8dd2860d..a4bd43dfb2fae4df44db399dc88b039b79e108f7 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/AddHandler.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\views_ui\Form\Ajax\AddItem. + * Contains \Drupal\views_ui\Form\Ajax\AddHandler. */ namespace Drupal\views_ui\Form\Ajax; @@ -14,10 +14,10 @@ /** * Provides a form for adding an item in the Views UI. */ -class AddItem extends ViewsFormBase { +class AddHandler extends ViewsFormBase { /** - * Constucts a new AddItem object. + * Constucts a new AddHandler object. */ public function __construct($type = NULL) { $this->setType($type); @@ -27,7 +27,7 @@ public function __construct($type = NULL) { * {@inheritdoc} */ public function getFormKey() { - return 'add-item'; + return 'add-handler'; } /** @@ -42,7 +42,7 @@ public function getForm(ViewStorageInterface $view, $display_id, $js, $type = NU * {@inheritdoc} */ public function getFormId() { - return 'views_ui_add_item_form'; + return 'views_ui_add_handler_form'; } /** @@ -73,7 +73,7 @@ public function buildForm(array $form, array &$form_state) { } $form['#title'] = $this->t('Add @type', array('@type' => $ltitle)); - $form['#section'] = $display_id . 'add-item'; + $form['#section'] = $display_id . 'add-handler'; // Add the display override dropdown. views_ui_standard_display_dropdown($form, $form_state, $section); @@ -171,7 +171,7 @@ public function buildForm(array $form, array &$form_state) { 'data-drupal-views-offset' => 'bottom', ), ); - $view->getStandardButtons($form, $form_state, 'views_ui_add_item_form', $this->t('Add and configure @types', array('@types' => $ltitle))); + $view->getStandardButtons($form, $form_state, 'views_ui_add_handler_form', $this->t('Add and configure @types', array('@types' => $ltitle))); // Remove the default submit function. $form['actions']['submit']['#submit'] = array_filter($form['actions']['submit']['#submit'], function($var) { 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/ConfigHandler.php similarity index 94% rename from core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php rename to core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigHandler.php index b84ddb206679c5f07519acdca3f0e375ae26820d..c82cd07e7e53b78f57b7b33249d84c2e05d482b9 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/ConfigHandler.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\views_ui\Form\Ajax\ConfigItem. + * Contains \Drupal\views_ui\Form\Ajax\ConfigHandler. */ namespace Drupal\views_ui\Form\Ajax; @@ -14,10 +14,10 @@ /** * Provides a form for configuring an item in the Views UI. */ -class ConfigItem extends ViewsFormBase { +class ConfigHandler extends ViewsFormBase { /** - * Constucts a new ConfigItem object. + * Constucts a new ConfigHandler object. */ public function __construct($type = NULL, $id = NULL) { $this->setType($type); @@ -28,7 +28,7 @@ public function __construct($type = NULL, $id = NULL) { * {@inheritdoc} */ public function getFormKey() { - return 'config-item'; + return 'handler'; } /** @@ -66,7 +66,7 @@ public function buildForm(array $form, array &$form_state) { $executable = $view->getExecutable(); $save_ui_cache = FALSE; $executable->setDisplay($display_id); - $item = $executable->getItem($display_id, $type, $id); + $item = $executable->getHandler($display_id, $type, $id); if ($item) { $handler = $executable->display_handler->getHandler($type, $id); @@ -124,7 +124,7 @@ public function buildForm(array $form, array &$form_state) { $rel = key($relationship_options); // We want this relationship option to get saved even if the user // skips submitting the form. - $executable->setItemOption($display_id, $type, $id, 'relationship', $rel); + $executable->setHandlerOption($display_id, $type, $id, 'relationship', $rel); $save_ui_cache = TRUE; } @@ -239,7 +239,7 @@ public function submitForm(array &$form, array &$form_state) { $handler->unpackOptions($handler->options, $options, NULL, FALSE); // Store the item back on the view - $executable->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $handler->options); + $executable->setHandler($form_state['display_id'], $form_state['type'], $form_state['id'], $handler->options); // Ensure any temporary options are removed. if (isset($form_state['view']->temporary_options[$type][$form_state['id']])) { @@ -262,7 +262,7 @@ public function remove(&$form, &$form_state) { $display = &$executable->displayHandlers->get($form_state['display_id']); $display->optionsOverride($form, $form_state); } - $executable->removeItem($form_state['display_id'], $form_state['type'], $form_state['id']); + $executable->removeHandler($form_state['display_id'], $form_state['type'], $form_state['id']); // Write to cache $form_state['view']->cacheSet(); 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/ConfigHandlerExtra.php similarity index 88% rename from core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php rename to core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigHandlerExtra.php index b36bb75491372fb0601c684bc8cbf3907522eadc..7f17178b98d7fd26c260ef2d94e8acfefc62d931 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/ConfigHandlerExtra.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\views_ui\Form\Ajax\ConfigItemExtra. + * Contains \Drupal\views_ui\Form\Ajax\ConfigHandlerExtra. */ namespace Drupal\views_ui\Form\Ajax; @@ -13,10 +13,10 @@ /** * Provides a form for configuring extra information for a Views UI item. */ -class ConfigItemExtra extends ViewsFormBase { +class ConfigHandlerExtra extends ViewsFormBase { /** - * Constucts a new ConfigItemExtra object. + * Constucts a new ConfigHandlerExtra object. */ public function __construct($type = NULL, $id = NULL) { $this->setType($type); @@ -27,7 +27,7 @@ public function __construct($type = NULL, $id = NULL) { * {@inheritdoc} */ public function getFormKey() { - return 'config-item-extra'; + return 'handler-extra'; } /** @@ -64,7 +64,7 @@ public function buildForm(array $form, array &$form_state) { ); $executable = $view->getExecutable(); $executable->setDisplay($display_id); - $item = $executable->getItem($display_id, $type, $id); + $item = $executable->getHandler($display_id, $type, $id); if ($item) { $handler = $executable->display_handler->getHandler($type, $id); @@ -110,7 +110,7 @@ public function submitForm(array &$form, array &$form_state) { } // Store the item back on the view - $form_state['view']->getExecutable()->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $item); + $form_state['view']->getExecutable()->setHandler($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/ConfigHandlerGroup.php similarity index 88% rename from core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemGroup.php rename to core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigHandlerGroup.php index 2a208f405174cc2ad6dfa67fb4b29043eabd984e..d69a69e37d4addbc6a0dc1bca43bd4c4f57b0abf 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/ConfigHandlerGroup.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\views_ui\Form\Ajax\ConfigItemGroup. + * Contains \Drupal\views_ui\Form\Ajax\ConfigHandlerGroup. */ namespace Drupal\views_ui\Form\Ajax; @@ -12,12 +12,12 @@ use Drupal\views\ViewExecutable; /** - * Provides a form for configuring grouping information for a Views UI item. + * Provides a form for configuring grouping information for a Views UI handler. */ -class ConfigItemGroup extends ViewsFormBase { +class ConfigHandlerGroup extends ViewsFormBase { /** - * Constucts a new ConfigItemGroup object. + * Constucts a new ConfigHandlerGroup object. */ public function __construct($type = NULL, $id = NULL) { $this->setType($type); @@ -28,7 +28,7 @@ public function __construct($type = NULL, $id = NULL) { * {@inheritdoc} */ public function getFormKey() { - return 'config-item-group'; + return 'handler-group'; } /** @@ -70,7 +70,7 @@ public function buildForm(array $form, array &$form_state) { $executable->initQuery(); - $item = $executable->getItem($display_id, $type, $id); + $item = $executable->getHandler($display_id, $type, $id); if ($item) { $handler = $executable->display_handler->getHandler($type, $id); @@ -106,7 +106,7 @@ public function submitForm(array &$form, array &$form_state) { $handler->submitGroupByForm($form, $form_state); // Store the item back on the view - $executable->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $item); + $executable->setHandler($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/ViewsFormInterface.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormInterface.php index ad134af7a6a6ddad3a8c28476cb517df634e6d56..d109ea394028fa202f4872aa24effca9f4ebdbdd 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormInterface.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormInterface.php @@ -16,8 +16,8 @@ interface ViewsFormInterface extends FormInterface { * Returns the key that represents this form. * * @return string - * The form key used in the URL, e.g., the string 'add-item' in - * 'admin/structure/views/%/add-item/%/%/%'. + * The form key used in the URL, e.g., the string 'add-handler' in + * 'admin/structure/views/%/add-handler/%/%/%'. */ public function getFormKey(); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/CustomBooleanTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/CustomBooleanTest.php index ae17b195694947346e130f0512d11578de6ac805..75aed9df864525aea44029e0341a7bcc09e61736 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/CustomBooleanTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/CustomBooleanTest.php @@ -96,7 +96,7 @@ public function testCustomOption() { 'options[type_custom_true]' => $values['true'], 'options[type_custom_false]' => $values['false'], ); - $this->drupalPostForm('admin/structure/views/nojs/config-item/test_view/default/field/age', $options, 'Apply'); + $this->drupalPostForm('admin/structure/views/nojs/handler/test_view/default/field/age', $options, 'Apply'); // Save the view. $this->drupalPostForm('admin/structure/views/view/test_view', array(), 'Save'); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/ExposedFormUITest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/ExposedFormUITest.php index 0df584561d536a5cc7d82a52298d2754194ec862..f5aec907e3ca4b2e81e27538691b46efb65875f7 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/ExposedFormUITest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/ExposedFormUITest.php @@ -46,7 +46,7 @@ function testExposedAdminUi() { menu_router_rebuild(); $edit = array(); - $this->drupalGet('admin/structure/views/nojs/config-item/test_exposed_admin_ui/default/filter/type'); + $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type'); // Be sure that the button is called exposed. $this->helperButtonHasLabel('edit-options-expose-button-button', t('Expose filter')); @@ -58,7 +58,7 @@ function testExposedAdminUi() { $this->assertFieldById('edit-options-value-article', '', 'Checkbox for Article exists'); // Click the Expose filter button. - $this->drupalPostForm('admin/structure/views/nojs/config-item/test_exposed_admin_ui/default/filter/type', $edit, t('Expose filter')); + $this->drupalPostForm('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type', $edit, t('Expose filter')); // Check the label of the expose button. $this->helperButtonHasLabel('edit-options-expose-button-button', t('Hide filter')); // Check the label of the grouped exposed button @@ -82,12 +82,12 @@ function testExposedAdminUi() { $this->assertText(t('This identifier is not allowed.')); // Now check the sort criteria. - $this->drupalGet('admin/structure/views/nojs/config-item/test_exposed_admin_ui/default/sort/created'); + $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/sort/created'); $this->helperButtonHasLabel('edit-options-expose-button-button', t('Expose sort')); $this->assertNoFieldById('edit-options-expose-label', '', 'Make sure no label field is shown'); // Click the Grouped Filters button. - $this->drupalGet('admin/structure/views/nojs/config-item/test_exposed_admin_ui/default/filter/type'); + $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type'); $this->drupalPostForm(NULL, array(), t('Grouped filters')); // After click on 'Grouped Filters', the standard operator and value should @@ -102,7 +102,7 @@ function testExposedAdminUi() { $this->helperButtonHasLabel('edit-options-group-info-add-group', t('Add another item')); // Create a grouped filter - $this->drupalGet('admin/structure/views/nojs/config-item/test_exposed_admin_ui/default/filter/type'); + $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type'); $edit = array(); $edit["options[group_info][group_items][1][title]"] = 'Is Article'; $edit["options[group_info][group_items][1][value][article]"] = 'article'; @@ -117,7 +117,7 @@ function testExposedAdminUi() { // Select the empty operator, so the empty value should not trigger a form // error. - $this->drupalGet('admin/structure/views/nojs/config-item/test_exposed_admin_ui/default/filter/body_value'); + $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/body_value'); $edit = array(); $edit["options[group_info][group_items][1][title]"] = $this->randomName(); $edit["options[group_info][group_items][1][operator]"] = 'empty'; @@ -127,7 +127,7 @@ function testExposedAdminUi() { $this->assertNoText(t('The value is required if title for this item is defined.')); // Validate that all the titles are defined for each group - $this->drupalGet('admin/structure/views/nojs/config-item/test_exposed_admin_ui/default/filter/type'); + $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type'); $edit = array(); $edit["options[group_info][group_items][1][title]"] = 'Is Article'; $edit["options[group_info][group_items][1][value][article]"] = TRUE; @@ -143,7 +143,7 @@ function testExposedAdminUi() { $this->assertRaw(t('The title is required if value for this item is defined.'), 'Group items should have a title'); // Un-expose the filter. - $this->drupalGet('admin/structure/views/nojs/config-item/test_exposed_admin_ui/default/filter/type'); + $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type'); $this->drupalPostForm(NULL, array(), t('Hide filter')); // After Un-exposing the filter, Operator and Value should be shown again. @@ -154,7 +154,7 @@ function testExposedAdminUi() { // Click the Expose sort button. $edit = array(); - $this->drupalPostForm('admin/structure/views/nojs/config-item/test_exposed_admin_ui/default/sort/created', $edit, t('Expose sort')); + $this->drupalPostForm('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/sort/created', $edit, t('Expose sort')); // Check the label of the expose button. $this->helperButtonHasLabel('edit-options-expose-button-button', t('Hide sort')); $this->assertFieldById('edit-options-expose-label', '', 'Make sure a label field is shown'); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/FieldUITest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/FieldUITest.php index 160e99cbeeb5e846b687df7cd27c99669b13d156..12d6741fa03830481628259825b19d11ed805c49 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/FieldUITest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/FieldUITest.php @@ -39,24 +39,24 @@ public function testFieldUI() { $this->assertNoText('Views test: Name (Name) [' . t('hidden') . ']'); // Hides the field and check whether the hidden label is appended. - $edit_handler_url = 'admin/structure/views/nojs/config-item/test_view/default/field/name'; + $edit_handler_url = 'admin/structure/views/nojs/handler/test_view/default/field/name'; $this->drupalPostForm($edit_handler_url, array('options[exclude]' => TRUE), t('Apply')); $this->assertText('Views test: Name (Name) [' . t('hidden') . ']'); // Ensure that the expected tokens appear in the UI. - $edit_handler_url = 'admin/structure/views/nojs/config-item/test_view/default/field/age'; + $edit_handler_url = 'admin/structure/views/nojs/handler/test_view/default/field/age'; $this->drupalGet($edit_handler_url); $result = $this->xpath('//details[@id="edit-options-alter-help"]/div[@class="details-wrapper"]/div[@class="item-list"]/fields/li'); $this->assertEqual((string) $result[0], '[age] == Age'); - $edit_handler_url = 'admin/structure/views/nojs/config-item/test_view/default/field/id'; + $edit_handler_url = 'admin/structure/views/nojs/handler/test_view/default/field/id'; $this->drupalGet($edit_handler_url); $result = $this->xpath('//details[@id="edit-options-alter-help"]/div[@class="details-wrapper"]/div[@class="item-list"]/fields/li'); $this->assertEqual((string) $result[0], '[age] == Age'); $this->assertEqual((string) $result[1], '[id] == ID'); - $edit_handler_url = 'admin/structure/views/nojs/config-item/test_view/default/field/name'; + $edit_handler_url = 'admin/structure/views/nojs/handler/test_view/default/field/name'; $this->drupalGet($edit_handler_url); $result = $this->xpath('//details[@id="edit-options-alter-help"]/div[@class="details-wrapper"]/div[@class="item-list"]/fields/li'); $this->assertEqual((string) $result[0], '[age] == Age'); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/FilterBooleanWebTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/FilterBooleanWebTest.php index d78a4a07ea8747382e646809c15ad409479df2cb..841a7c9b4bf5810b7334393f3bc60bf7af5201f5 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/FilterBooleanWebTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/FilterBooleanWebTest.php @@ -33,7 +33,7 @@ public static function getInfo() { * Tests the filter boolean UI. */ public function testFilterBooleanUI() { - $this->drupalPostForm('admin/structure/views/nojs/add-item/test_view/default/filter', array('name[views_test_data.status]' => TRUE), t('Add and configure @handler', array('@handler' => t('filter criteria')))); + $this->drupalPostForm('admin/structure/views/nojs/add-handler/test_view/default/filter', array('name[views_test_data.status]' => TRUE), t('Add and configure @handler', array('@handler' => t('filter criteria')))); $this->drupalPostForm(NULL, array(), t('Expose filter')); $this->drupalPostForm(NULL, array(), t('Grouped filters')); @@ -51,7 +51,7 @@ public function testFilterBooleanUI() { $this->drupalPostForm(NULL, $edit, t('Apply')); - $this->drupalGet('admin/structure/views/nojs/config-item/test_view/default/filter/status'); + $this->drupalGet('admin/structure/views/nojs/handler/test_view/default/filter/status'); $result = $this->xpath('//input[@name="options[group_info][group_items][1][value]"]'); $this->assertEqual((int) $result[1]->attributes()->checked, 'checked'); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/GroupByTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/GroupByTest.php index cffcfc3c8709576adeb82927d66cedc9c48dc551..08d567380add8c0a278f6a92c5456ca2b8c76a2a 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/GroupByTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/GroupByTest.php @@ -35,7 +35,7 @@ public static function getInfo() { function testGroupBySave() { $this->drupalGet('admin/structure/views/view/test_views_groupby_save/edit'); - $edit_groubpy_url = 'admin/structure/views/nojs/config-item-group/test_views_groupby_save/default/field/id'; + $edit_groubpy_url = 'admin/structure/views/nojs/handler-group/test_views_groupby_save/default/field/id'; $this->assertNoLinkByHref($edit_groubpy_url, 0, 'No aggregation link found.'); // Enable aggregation on the view. diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php index 7ff3747888582edd93474a9b951118d78887e6d8..176f00953d500f7608b6ec8bdcd2ccba29da23e9 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php @@ -78,23 +78,23 @@ public function testUICRUD() { $handler_types = ViewExecutable::viewsHandlerTypes(); foreach ($handler_types as $type => $type_info) { // Test adding handlers. - $add_handler_url = "admin/structure/views/nojs/add-item/test_view_empty/default/$type"; + $add_handler_url = "admin/structure/views/nojs/add-handler/test_view_empty/default/$type"; // Area handler types need to use a different handler. if (in_array($type, array('header', 'footer', 'empty'))) { $this->drupalPostForm($add_handler_url, array('name[views.area]' => TRUE), t('Add and configure @handler', array('@handler' => $type_info['ltitle']))); $id = 'area'; - $edit_handler_url = "admin/structure/views/nojs/config-item/test_view_empty/default/$type/$id"; + $edit_handler_url = "admin/structure/views/nojs/handler/test_view_empty/default/$type/$id"; } elseif ($type == 'relationship') { $this->drupalPostForm($add_handler_url, array('name[views_test_data.uid]' => TRUE), t('Add and configure @handler', array('@handler' => $type_info['ltitle']))); $id = 'uid'; - $edit_handler_url = "admin/structure/views/nojs/config-item/test_view_empty/default/$type/$id"; + $edit_handler_url = "admin/structure/views/nojs/handler/test_view_empty/default/$type/$id"; } else { $this->drupalPostForm($add_handler_url, array('name[views_test_data.job]' => TRUE), t('Add and configure @handler', array('@handler' => $type_info['ltitle']))); $id = 'job'; - $edit_handler_url = "admin/structure/views/nojs/config-item/test_view_empty/default/$type/$id"; + $edit_handler_url = "admin/structure/views/nojs/handler/test_view_empty/default/$type/$id"; } $this->assertUrl($edit_handler_url, array(), 'The user got redirected to the handler edit form.'); @@ -125,14 +125,14 @@ public function testUICRUD() { // Test adding a field of the user table using the uid relationship. $type_info = $handler_types['relationship']; - $add_handler_url = "admin/structure/views/nojs/add-item/test_view_empty/default/relationship"; + $add_handler_url = "admin/structure/views/nojs/add-handler/test_view_empty/default/relationship"; $this->drupalPostForm($add_handler_url, array('name[views_test_data.uid]' => TRUE), t('Add and configure @handler', array('@handler' => $type_info['ltitle']))); - $add_handler_url = "admin/structure/views/nojs/add-item/test_view_empty/default/field"; + $add_handler_url = "admin/structure/views/nojs/add-handler/test_view_empty/default/field"; $type_info = $handler_types['field']; $this->drupalPostForm($add_handler_url, array('name[users.signature]' => TRUE), t('Add and configure @handler', array('@handler' => $type_info['ltitle']))); $id = 'signature'; - $edit_handler_url = "admin/structure/views/nojs/config-item/test_view_empty/default/field/$id"; + $edit_handler_url = "admin/structure/views/nojs/handler/test_view_empty/default/field/$id"; $this->assertUrl($edit_handler_url, array(), 'The user got redirected to the handler edit form.'); $this->assertFieldByName('options[relationship]', 'uid', 'Ensure the relationship select is filled with the UID relationship.'); @@ -152,7 +152,7 @@ public function testBrokenHandlers() { foreach ($handler_types as $type => $type_info) { $this->drupalGet('admin/structure/views/view/test_view_broken/edit'); - $href = "admin/structure/views/nojs/config-item/test_view_broken/default/$type/id_broken"; + $href = "admin/structure/views/nojs/handler/test_view_broken/default/$type/id_broken"; $result = $this->xpath('//a[contains(@href, :href)]', array(':href' => $href)); $this->assertEqual(count($result), 1, String::format('Handler (%type) edit link found.', array('%type' => $type))); @@ -186,7 +186,7 @@ public function testOptionalHandlers() { foreach ($handler_types as $type => $type_info) { $this->drupalGet('admin/structure/views/view/test_view_optional/edit'); - $href = "admin/structure/views/nojs/config-item/test_view_optional/default/$type/id_optional"; + $href = "admin/structure/views/nojs/handler/test_view_optional/default/$type/id_optional"; $result = $this->xpath('//a[contains(@href, :href)]', array(':href' => $href)); $this->assertEqual(count($result), 1, String::format('Handler (%type) edit link found.', array('%type' => $type))); 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 01786bbcfacda341dbf23ab21bf981864a10a008..f72f839f75ab92400108120fb1a6665d9789849a 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php @@ -971,7 +971,7 @@ public function getFormBucket(ViewUI $view, $type, $display) { $actions['add'] = array( 'title' => $add_text, - 'href' => "admin/structure/views/nojs/add-item/{$view->id()}/{$display['id']}/$type", + 'href' => "admin/structure/views/nojs/add-handler/{$view->id()}/{$display['id']}/$type", 'attributes' => array('class' => array('icon compact add', 'views-ajax-link'), 'id' => 'views-add-' . $type), 'html' => TRUE, ); @@ -1039,7 +1039,7 @@ public function getFormBucket(ViewUI $view, $type, $display) { if ($handler->broken()) { $build['fields'][$id]['#class'][] = 'broken'; $field_name = $handler->adminLabel(); - $build['fields'][$id]['#link'] = l($field_name, "admin/structure/views/nojs/config-item/{$view->id()}/{$display['id']}/$type/$id", array('attributes' => array('class' => array('views-ajax-link')), 'html' => TRUE)); + $build['fields'][$id]['#link'] = l($field_name, "admin/structure/views/nojs/handler/{$view->id()}/{$display['id']}/$type/$id", array('attributes' => array('class' => array('views-ajax-link')), 'html' => TRUE)); continue; } @@ -1056,15 +1056,15 @@ public function getFormBucket(ViewUI $view, $type, $display) { // Add a [hidden] marker, if the field is excluded. $link_text .= ' [' . $this->t('hidden') . ']'; } - $build['fields'][$id]['#link'] = l($link_text, "admin/structure/views/nojs/config-item/{$view->id()}/{$display['id']}/$type/$id", array('attributes' => $link_attributes, 'html' => TRUE)); + $build['fields'][$id]['#link'] = l($link_text, "admin/structure/views/nojs/handler/{$view->id()}/{$display['id']}/$type/$id", array('attributes' => $link_attributes, 'html' => TRUE)); $build['fields'][$id]['#class'][] = drupal_clean_css_identifier($display['id']. '-' . $type . '-' . $id); if ($executable->display_handler->useGroupBy() && $handler->usesGroupBy()) { - $build['fields'][$id]['#settings_links'][] = l('' . $this->t('Aggregation settings') . '', "admin/structure/views/nojs/config-item-group/{$view->id()}/{$display['id']}/$type/$id", array('attributes' => array('class' => 'views-button-configure views-ajax-link', 'title' => $this->t('Aggregation settings')), 'html' => TRUE)); + $build['fields'][$id]['#settings_links'][] = l('' . $this->t('Aggregation settings') . '', "admin/structure/views/nojs/handler-group/{$view->id()}/{$display['id']}/$type/$id", array('attributes' => array('class' => 'views-button-configure views-ajax-link', 'title' => $this->t('Aggregation settings')), 'html' => TRUE)); } if ($handler->hasExtraOptions()) { - $build['fields'][$id]['#settings_links'][] = l('' . $this->t('Settings') . '', "admin/structure/views/nojs/config-item-extra/{$view->id()}/{$display['id']}/$type/$id", array('attributes' => array('class' => array('views-button-configure', 'views-ajax-link'), 'title' => $this->t('Settings')), 'html' => TRUE)); + $build['fields'][$id]['#settings_links'][] = l('' . $this->t('Settings') . '', "admin/structure/views/nojs/handler-extra/{$view->id()}/{$display['id']}/$type/$id", array('attributes' => array('class' => array('views-button-configure', 'views-ajax-link'), 'title' => $this->t('Settings')), 'html' => TRUE)); } if ($grouping) { 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 e0d472fbe2977f2877eab705b2e7a144927e974f..4890dc9f8aedf3fc8c189323402bda126f1384f4 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php @@ -126,11 +126,11 @@ class ViewUI implements ViewStorageInterface { * @var array */ public static $forms = array( - 'add-item' => '\Drupal\views_ui\Form\Ajax\AddItem', + 'add-handler' => '\Drupal\views_ui\Form\Ajax\AddItem', 'analyze' => '\Drupal\views_ui\Form\Ajax\Analyze', - 'config-item' => '\Drupal\views_ui\Form\Ajax\ConfigItem', - 'config-item-extra' => '\Drupal\views_ui\Form\Ajax\ConfigItemExtra', - 'config-item-group' => '\Drupal\views_ui\Form\Ajax\ConfigItemGroup', + 'handler' => '\Drupal\views_ui\Form\Ajax\ConfigHandler', + 'handler-extra' => '\Drupal\views_ui\Form\Ajax\ConfigHandlerExtra', + 'handler-group' => '\Drupal\views_ui\Form\Ajax\ConfigHandlerGroup', 'display' => '\Drupal\views_ui\Form\Ajax\Display', 'edit-details' => '\Drupal\views_ui\Form\Ajax\EditDetails', 'rearrange' => '\Drupal\views_ui\Form\Ajax\Rearrange', @@ -485,7 +485,7 @@ public function submitItemAdd($form, &$form_state) { if ($cut = strpos($field, '$')) { $field = substr($field, 0, $cut); } - $id = $this->executable->addItem($form_state['display_id'], $type, $table, $field); + $id = $this->executable->addHandler($form_state['display_id'], $type, $table, $field); // check to see if we have group by settings $key = $type; @@ -499,15 +499,15 @@ public function submitItemAdd($form, &$form_state) { ); $handler = Views::handlerManager($key)->getHandler($item); if ($this->executable->displayHandlers->get('default')->useGroupBy() && $handler->usesGroupBy()) { - $this->addFormToStack('config-item-group', $form_state['display_id'], $type, $id); + $this->addFormToStack('handler-group', $form_state['display_id'], $type, $id); } // check to see if this type has settings, if so add the settings form first if ($handler && $handler->hasExtraOptions()) { - $this->addFormToStack('config-item-extra', $form_state['display_id'], $type, $id); + $this->addFormToStack('handler-extra', $form_state['display_id'], $type, $id); } // Then add the form to the stack - $this->addFormToStack('config-item', $form_state['display_id'], $type, $id); + $this->addFormToStack('handler', $form_state['display_id'], $type, $id); } } diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module index ed4ba632bd033ade6b8bf0f9c5ada501d66123af..f90508c009c915462a95df89fd83b2a940112cde 100644 --- a/core/modules/views_ui/views_ui.module +++ b/core/modules/views_ui/views_ui.module @@ -238,13 +238,13 @@ function views_ui_view_preview_section_handler_links(ViewExecutable $view, $type $field_name = $handler->adminLabel(TRUE); $links[$type . '-edit-' . $id] = array( 'title' => t('Edit @section', array('@section' => $field_name)), - 'href' => "admin/structure/views/nojs/config-item/{$view->storage->id()}/{$display['id']}/$type/$id", + 'href' => "admin/structure/views/nojs/handler/{$view->storage->id()}/{$display['id']}/$type/$id", 'attributes' => array('class' => array('views-ajax-link')), ); } $links[$type . '-add'] = array( 'title' => t('Add new'), - 'href' => "admin/structure/views/nojs/add-item/{$view->storage->id()}/{$display['id']}/$type", + 'href' => "admin/structure/views/nojs/add-handler/{$view->storage->id()}/{$display['id']}/$type", 'attributes' => array('class' => array('views-ajax-link')), ); diff --git a/core/modules/views_ui/views_ui.routing.yml b/core/modules/views_ui/views_ui.routing.yml index 1d8128a6174bfaf4d5bacfe752926f51a71af866..03c6b954041f2393fac5e6d34bd7c655c2f71192 100644 --- a/core/modules/views_ui/views_ui.routing.yml +++ b/core/modules/views_ui/views_ui.routing.yml @@ -120,14 +120,14 @@ views_ui.break_lock: requirements: _permission: 'administer views' -views_ui.form_add_item: - path: '/admin/structure/views/{js}/add-item/{view}/{display_id}/{type}' +views_ui.form_add_handler: + path: '/admin/structure/views/{js}/add-handler/{view}/{display_id}/{type}' options: parameters: view: tempstore: TRUE defaults: - _content: '\Drupal\views_ui\Form\Ajax\AddItem::getForm' + _content: '\Drupal\views_ui\Form\Ajax\AddHandler::getForm' requirements: _permission: 'administer views' js: 'nojs|ajax' @@ -204,38 +204,38 @@ views_ui.form_display: _permission: 'administer views' js: 'nojs|ajax' -views_ui.form_config_item: - path: '/admin/structure/views/{js}/config-item/{view}/{display_id}/{type}/{id}' +views_ui.form_handler: + path: '/admin/structure/views/{js}/handler/{view}/{display_id}/{type}/{id}' options: parameters: view: tempstore: TRUE defaults: - _content: '\Drupal\views_ui\Form\Ajax\ConfigItem::getForm' + _content: '\Drupal\views_ui\Form\Ajax\ConfigHandler::getForm' requirements: _permission: 'administer views' js: 'nojs|ajax' -views_ui.form_config_item_extra: - path: '/admin/structure/views/{js}/config-item-extra/{view}/{display_id}/{type}/{id}' +views_ui.form_handler_extra: + path: '/admin/structure/views/{js}/handler-extra/{view}/{display_id}/{type}/{id}' options: parameters: view: tempstore: TRUE defaults: - _content: '\Drupal\views_ui\Form\Ajax\ConfigItemExtra::getForm' + _content: '\Drupal\views_ui\Form\Ajax\ConfigHandlerExtra::getForm' requirements: _permission: 'administer views' js: 'nojs|ajax' -views_ui.form_config_item_group: - path: '/admin/structure/views/{js}/config-item-group/{view}/{display_id}/{type}/{id}' +views_ui.form_handler_group: + path: '/admin/structure/views/{js}/handler-group/{view}/{display_id}/{type}/{id}' options: parameters: view: tempstore: TRUE defaults: - _content: '\Drupal\views_ui\Form\Ajax\ConfigItemGroup::getForm' + _content: '\Drupal\views_ui\Form\Ajax\ConfigHandlerGroup::getForm' form_state: NULL requirements: _permission: 'administer views'