Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
9e4cdb98
Commit
9e4cdb98
authored
Jan 22, 2014
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2143495
by dawehner, derhasi: Improve naming of ViewExecutable::addItem(), ::getItem() & Co.
parent
4fbb1a1b
Changes
37
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
155 additions
and
155 deletions
+155
-155
core/modules/comment/lib/Drupal/comment/Tests/Views/FilterUserUIDTest.php
...ment/lib/Drupal/comment/Tests/Views/FilterUserUIDTest.php
+2
-2
core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/row/EntityReference.php
...pal/entity_reference/Plugin/views/row/EntityReference.php
+1
-1
core/modules/field/lib/Drupal/field/Tests/Views/FieldUITest.php
...odules/field/lib/Drupal/field/Tests/Views/FieldUITest.php
+2
-2
core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php
...ib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php
+2
-2
core/modules/tracker/lib/Drupal/tracker/Tests/Views/TrackerUserUidTest.php
...ker/lib/Drupal/tracker/Tests/Views/TrackerUserUidTest.php
+1
-1
core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php
...modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php
+1
-1
core/modules/user/lib/Drupal/user/Tests/Views/HandlerFilterUserNameTest.php
...lib/Drupal/user/Tests/Views/HandlerFilterUserNameTest.php
+1
-1
core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php
...dules/views/lib/Drupal/views/Plugin/views/HandlerBase.php
+1
-1
core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
...lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
+2
-2
core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php
...b/Drupal/views/Plugin/views/relationship/GroupwiseMax.php
+5
-5
core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php
...s/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php
+2
-2
core/modules/views/lib/Drupal/views/Tests/Handler/AreaTest.php
...modules/views/lib/Drupal/views/Tests/Handler/AreaTest.php
+2
-2
core/modules/views/lib/Drupal/views/Tests/Handler/FilterDateTest.php
...s/views/lib/Drupal/views/Tests/Handler/FilterDateTest.php
+1
-1
core/modules/views/lib/Drupal/views/Tests/Handler/HandlerAllTest.php
...s/views/lib/Drupal/views/Tests/Handler/HandlerAllTest.php
+1
-1
core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php
...ules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php
+5
-5
core/modules/views/lib/Drupal/views/Tests/Plugin/ArgumentDefaultTest.php
...ews/lib/Drupal/views/Tests/Plugin/ArgumentDefaultTest.php
+2
-2
core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php
...dules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php
+6
-6
core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php
...dules/views/lib/Drupal/views/Tests/ViewExecutableTest.php
+3
-3
core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php
.../modules/views/lib/Drupal/views/Tests/ViewStorageTest.php
+11
-11
core/modules/views/lib/Drupal/views/ViewExecutable.php
core/modules/views/lib/Drupal/views/ViewExecutable.php
+10
-10
core/modules/views_ui/js/views-admin.js
core/modules/views_ui/js/views-admin.js
+10
-10
core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php
...s_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php
+1
-1
core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddHandler.php
...les/views_ui/lib/Drupal/views_ui/Form/Ajax/AddHandler.php
+7
-7
core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigHandler.php
.../views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigHandler.php
+8
-8
core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigHandlerExtra.php
...s_ui/lib/Drupal/views_ui/Form/Ajax/ConfigHandlerExtra.php
+6
-6
core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigHandlerGroup.php
...s_ui/lib/Drupal/views_ui/Form/Ajax/ConfigHandlerGroup.php
+7
-7
core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormInterface.php
...s_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormInterface.php
+2
-2
core/modules/views_ui/lib/Drupal/views_ui/Tests/CustomBooleanTest.php
.../views_ui/lib/Drupal/views_ui/Tests/CustomBooleanTest.php
+1
-1
core/modules/views_ui/lib/Drupal/views_ui/Tests/ExposedFormUITest.php
.../views_ui/lib/Drupal/views_ui/Tests/ExposedFormUITest.php
+9
-9
core/modules/views_ui/lib/Drupal/views_ui/Tests/FieldUITest.php
...odules/views_ui/lib/Drupal/views_ui/Tests/FieldUITest.php
+4
-4
core/modules/views_ui/lib/Drupal/views_ui/Tests/FilterBooleanWebTest.php
...ews_ui/lib/Drupal/views_ui/Tests/FilterBooleanWebTest.php
+2
-2
core/modules/views_ui/lib/Drupal/views_ui/Tests/GroupByTest.php
...odules/views_ui/lib/Drupal/views_ui/Tests/GroupByTest.php
+1
-1
core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php
...odules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php
+9
-9
core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
...s/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
+5
-5
core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
+8
-8
core/modules/views_ui/views_ui.module
core/modules/views_ui/views_ui.module
+2
-2
core/modules/views_ui/views_ui.routing.yml
core/modules/views_ui/views_ui.routing.yml
+12
-12
No files found.
core/modules/comment/lib/Drupal/comment/Tests/Views/FilterUserUIDTest.php
View file @
9e4cdb98
...
...
@@ -32,7 +32,7 @@ public static function getInfo() {
function
testCommentUserUIDTest
()
{
$view
=
views_get_view
(
'test_comment_user_uid'
);
$view
->
setDisplay
();
$view
->
remove
Item
(
'default'
,
'argument'
,
'uid_touch'
);
$view
->
remove
Handler
(
'default'
,
'argument'
,
'uid_touch'
);
$options
=
array
(
'id'
=>
'uid_touch'
,
...
...
@@ -40,7 +40,7 @@ function testCommentUserUIDTest() {
'field'
=>
'uid_touch'
,
'value'
=>
array
(
$this
->
loggedInUser
->
id
()),
);
$view
->
add
Item
(
'default'
,
'filter'
,
'node_field_data'
,
'uid_touch'
,
$options
);
$view
->
add
Handler
(
'default'
,
'filter'
,
'node_field_data'
,
'uid_touch'
,
$options
);
$this
->
executeView
(
$view
,
array
(
$this
->
account
->
id
()));
$result_set
=
array
(
array
(
...
...
core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/row/EntityReference.php
View file @
9e4cdb98
...
...
@@ -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
->
get
Item
s
(
'field'
,
$this
->
displayHandler
->
display
[
'id'
]);
$fields
=
$this
->
view
->
get
Handler
s
(
'field'
,
$this
->
displayHandler
->
display
[
'id'
]);
$this
->
options
[
'inline'
]
=
drupal_map_assoc
(
array_keys
(
$fields
));
}
...
...
core/modules/field/lib/Drupal/field/Tests/Views/FieldUITest.php
View file @
9e4cdb98
...
...
@@ -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
);
...
...
core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php
View file @
9e4cdb98
...
...
@@ -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'
));
}
...
...
core/modules/tracker/lib/Drupal/tracker/Tests/Views/TrackerUserUidTest.php
View file @
9e4cdb98
...
...
@@ -60,7 +60,7 @@ public function testUserUid() {
$view
->
destroy
();
// Remove the filter now, so only the argument will affect the query.
$view
->
remove
Item
(
'default'
,
'filter'
,
'uid_touch_tracker'
);
$view
->
remove
Handler
(
'default'
,
'filter'
,
'uid_touch_tracker'
);
// Test the incorrect argument UID.
$view
->
initHandlers
();
...
...
core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php
View file @
9e4cdb98
...
...
@@ -82,7 +82,7 @@ public function testBulkForm() {
// Remove the user status filter from the view.
$view
=
views_get_view
(
'test_user_bulk_form'
);
$view
->
remove
Item
(
'default'
,
'filter'
,
'status'
);
$view
->
remove
Handler
(
'default'
,
'filter'
,
'status'
);
$view
->
storage
->
save
();
// Ensure the anonymous user is found.
...
...
core/modules/user/lib/Drupal/user/Tests/Views/HandlerFilterUserNameTest.php
View file @
9e4cdb98
...
...
@@ -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.
...
...
core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php
View file @
9e4cdb98
...
...
@@ -852,7 +852,7 @@ public function displayExposedForm($form, &$form_state) {
$this
->
defaultExposeOptions
();
}
$form_state
[
'view'
]
->
getExecutable
()
->
set
Item
(
$form_state
[
'display_id'
],
$form_state
[
'type'
],
$form_state
[
'id'
],
$item
);
$form_state
[
'view'
]
->
getExecutable
()
->
set
Handler
(
$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
);
...
...
core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
View file @
9e4cdb98
...
...
@@ -426,7 +426,7 @@ public function buildGroupForm($form, &$form_state) {
$this
->
buildGroupOptions
();
}
$form_state
[
'view'
]
->
getExecutable
()
->
set
Item
(
$form_state
[
'display_id'
],
$form_state
[
'type'
],
$form_state
[
'id'
],
$item
);
$form_state
[
'view'
]
->
getExecutable
()
->
set
Handler
(
$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
()
->
set
Item
(
$form_state
[
'display_id'
],
$form_state
[
'type'
],
$form_state
[
'id'
],
$item
);
$form_state
[
'view'
]
->
getExecutable
()
->
set
Handler
(
$form_state
[
'display_id'
],
$form_state
[
'type'
],
$form_state
[
'id'
],
$item
);
$form_state
[
'view'
]
->
cacheSet
();
$form_state
[
'rerender'
]
=
TRUE
;
...
...
core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php
View file @
9e4cdb98
...
...
@@ -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
->
add
Item
(
'default'
,
'sort'
,
$sort_table
,
$sort_field
,
$sort_options
);
$temp_view
->
add
Handler
(
'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
->
add
Item
(
'default'
,
'field'
,
$this
->
definition
[
'base'
],
$this
->
definition
[
'field'
]);
$temp_view
->
add
Handler
(
'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
->
add
Item
(
'default'
,
'relationship'
,
$relationship_table
,
$relationship_field
);
$relationship_id
=
$temp_view
->
add
Handler
(
'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
->
add
Item
(
'default'
,
'argument'
,
$this
->
definition
[
'argument table'
],
$this
->
definition
[
'argument field'
],
$temp_item_options
);
$temp_view
->
add
Handler
(
'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 add
Handler
() 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
();
...
...
core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php
View file @
9e4cdb98
...
...
@@ -103,9 +103,9 @@ public function testEntityArea() {
// Change the view mode of the area handler.
$view
=
views_get_view
(
'test_entity_area'
);
$item
=
$view
->
get
Item
(
'default'
,
'header'
,
'entity_entity_test'
);
$item
=
$view
->
get
Handler
(
'default'
,
'header'
,
'entity_entity_test'
);
$item
[
'view_mode'
]
=
'test'
;
$view
->
set
Item
(
'default'
,
'header'
,
'entity_entity_test'
,
$item
);
$view
->
set
Handler
(
'default'
,
'header'
,
'entity_entity_test'
,
$item
);
$preview
=
$view
->
preview
(
'default'
,
array
(
$entities
[
1
]
->
id
()));
$this
->
drupalSetContent
(
drupal_render
(
$preview
));
...
...
core/modules/views/lib/Drupal/views/Tests/Handler/AreaTest.php
View file @
9e4cdb98
...
...
@@ -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"]'
);
...
...
core/modules/views/lib/Drupal/views/Tests/Handler/FilterDateTest.php
View file @
9e4cdb98
...
...
@@ -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.
...
...
core/modules/views/lib/Drupal/views/Tests/Handler/HandlerAllTest.php
View file @
9e4cdb98
...
...
@@ -85,7 +85,7 @@ public function testHandlers() {
$options
[
'value'
]
=
array
(
1
);
}
}
$view
->
add
Item
(
'default'
,
$type
,
$base_table
,
$field
,
$options
);
$view
->
add
Handler
(
'default'
,
$type
,
$base_table
,
$field
,
$options
);
}
}
}
...
...
core/modules/views/lib/Drupal/views/Tests/Handler/HandlerTest.php
View file @
9e4cdb98
...
...
@@ -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
->
add
Item
(
'default'
,
'relationship'
,
$this
->
randomName
(),
$this
->
randomName
(),
array
(),
'broken_relationship'
);
$view
->
add
Handler
(
'default'
,
'relationship'
,
$this
->
randomName
(),
$this
->
randomName
(),
array
(),
'broken_relationship'
);
// Setup a valid relationship.
$view
->
add
Item
(
'default'
,
'relationship'
,
'comment'
,
'node'
,
array
(
'relationship'
=>
'cid'
),
'valid_relationship'
);
$view
->
add
Handler
(
'default'
,
'relationship'
,
'comment'
,
'node'
,
array
(
'relationship'
=>
'cid'
),
'valid_relationship'
);
$view
->
initHandlers
();
$field
=
$view
->
field
[
'title'
];
...
...
core/modules/views/lib/Drupal/views/Tests/Plugin/ArgumentDefaultTest.php
View file @
9e4cdb98
...
...
@@ -59,7 +59,7 @@ public function testArgumentDefaultPlugin() {
),
'default_action'
=>
'default'
);
$id
=
$view
->
add
Item
(
'default'
,
'argument'
,
'views_test_data'
,
'name'
,
$options
);
$id
=
$view
->
add
Handler
(
'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
(
...
...
core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php
View file @
9e4cdb98
...
...
@@ -297,26 +297,26 @@ public function testOutputIsEmpty() {
'id'
=>
'id'
,
'value'
=>
array
(
'value'
=>
7297
)
);
$view
->
set
Item
(
'default'
,
'filter'
,
'id'
,
$item
);
$view
->
set
Handler
(
'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
->
remove
Item
(
'default'
,
'empty'
,
'area'
);
$item
=
$view
->
get
Item
(
'default'
,
'header'
,
'area'
);
$view
->
remove
Handler
(
'default'
,
'empty'
,
'area'
);
$item
=
$view
->
get
Handler
(
'default'
,
'header'
,
'area'
);
$item
[
'empty'
]
=
TRUE
;
$view
->
set
Item
(
'default'
,
'header'
,
'area'
,
$item
);
$view
->
set
Handler
(
'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
->
get
Item
(
'default'
,
'header'
,
'area'
);
$item
=
$view
->
get
Handler
(
'default'
,
'header'
,
'area'
);
$item
[
'empty'
]
=
FALSE
;
$view
->
set
Item
(
'default'
,
'header'
,
'area'
,
$item
);
$view
->
set
Handler
(
'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.'
);
...
...
core/modules/views/lib/Drupal/views/Tests/ViewExecutableTest.php
View file @
9e4cdb98
...
...
@@ -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 generate
Item
Id() method.
// Test the generate
Handler
Id() method.
$test_ids
=
drupal_map_assoc
(
array
(
'test'
,
'test_1'
));
$this
->
assertEqual
(
$view
->
generate
Item
Id
(
'new'
,
$test_ids
),
'new'
);
$this
->
assertEqual
(
$view
->
generate
Item
Id
(
'test'
,
$test_ids
),
'test_2'
);
$this
->
assertEqual
(
$view
->
generate
Handler
Id
(
'new'
,
$test_ids
),
'new'
);
$this
->
assertEqual
(
$view
->
generate
Handler
Id
(
'test'
,
$test_ids
),
'test_2'
);
// Test the getPath() method.
$path
=
$this
->
randomName
();
...
...
core/modules/views/lib/Drupal/views/Tests/ViewStorageTest.php
View file @
9e4cdb98
...
...
@@ -257,11 +257,11 @@ protected function displayMethodTests() {
$display_id
=
'default'
;
$expected_items
=
array
();
// Tests add
Item
with getItem.
// Tests add
Handler
with getItem.
// Therefore add one item without any optioins and one item with some
// options.
$id1
=
$view
->
add
Item
(
$display_id
,
'field'
,
'views_test_data'
,
'id'
);
$item1
=
$view
->
get
Item
(
$display_id
,
'field'
,
'id'
);
$id1
=
$view
->
add
Handler
(
$display_id
,
'field'
,
'views_test_data'
,
'id'
);
$item1
=
$view
->
get
Handler
(
$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
->
add
Item
(
$display_id
,
'field'
,
'views_test_data'
,
'name'
,
$options
);
$item2
=
$view
->
get
Item
(
$display_id
,
'field'
,
'name'
);
$id2
=
$view
->
add
Handler
(
$display_id
,
'field'
,
'views_test_data'
,
'name'
,
$options
);
$item2
=
$view
->
get
Handler
(
$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
->
get
Item
s
(
'field'
,
$display_id
),
$expected_items
);
$this
->
assertEqual
(
$view
->
get
Handler
s
(
'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
->
set
Item
(
$display_id
,
'field'
,
$id1
,
$item
);
$this
->
assertEqual
(
$view
->
get
Item
(
$display_id
,
'field'
,
'id'
),
$item
);
$this
->
assertEqual
(
$view
->
get
Item
s
(
'field'
,
$display_id
),
$expected_items
);
$view
->
set
Handler
(
$display_id
,
'field'
,
$id1
,
$item
);
$this
->
assertEqual
(
$view
->
get
Handler
(
$display_id
,
'field'
,
'id'
),
$item
);
$this
->
assertEqual
(
$view
->
get
Handler
s
(
'field'
,
$display_id
),
$expected_items
);
// Test removeItem method.
unset
(
$expected_items
[
$id2
]);
$view
->
remove
Item
(
$display_id
,
'field'
,
$id2
);
$this
->
assertEqual
(
$view
->
get
Item
s
(
'field'
,
$display_id
),
$expected_items
);
$view
->
remove
Handler
(
$display_id
,
'field'
,
$id2
);
$this
->
assertEqual
(
$view
->
get
Handler
s
(
'field'
,
$display_id
),
$expected_items
);
}
/**
...
...
core/modules/views/lib/Drupal/views/ViewExecutable.php
View file @
9e4cdb98
...
...
@@ -1958,14 +1958,14 @@ public static function getPluginTypes() {
* @return string
* The unique ID for this handler instance.
*/
public
function
add
Item
(
$display_id
,
$type
,
$table
,
$field
,
$options
=
array
(),
$id
=
NULL
)
{
public
function
add
Handler
(
$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
->
generate
Item
Id
(
$field
,
$fields
);
$id
=
$this
->
generate
Handler
Id
(
$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
generate
Item
Id
(
$requested_id
,
$existing_items
)
{
public
static
function
generate
Handler
Id
(
$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
get
Item
s
(
$type
,
$display_id
=
NULL
)
{
public
function
get
Handler
s
(
$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
get
Item
(
$display_id
,
$type
,
$id
)
{
public
function
get
Handler
(
$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
set
Item
(
$display_id
,
$type
,
$id
,
$item
)
{
public
function
set
Handler
(
$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
remove
Item
(
$display_id
,
$type
,
$id
)
{
public
function
remove
Handler
(
$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
set
Item
Option
(
$display_id
,
$type
,
$id
,
$option
,
$value
)
{
$item
=
$this
->
get
Item
(
$display_id
,
$type
,
$id
);
public
function
set
Handler
Option
(
$display_id
,
$type
,
$id
,
$option
,
$value
)
{
$item
=
$this
->
get
Handler
(
$display_id
,
$type
,
$id
);
$item
[
$option
]
=
$value
;
$this
->
set
Item
(
$display_id
,
$type
,
$id
,
$item
);
$this
->
set
Handler
(
$display_id
,
$type
,
$id
,
$item
);
}
/**
...
...
core/modules/views_ui/js/views-admin.js
View file @
9e4cdb98
...
...
@@ -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
)
{
...
...
core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php
View file @
9e4cdb98
...
...
@@ -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
->
get
Item
s
(
$type
,
$display_id
)
as
$item
)
{
foreach
(
$executable
->
get
Handler
s
(
$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
])
{
...
...
core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Add
Item
.php
→
core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/Add
Handler
.php
View file @
9e4cdb98
...
...
@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\views_ui\Form\Ajax\Add
Item
.
* Contains \Drupal\views_ui\Form\Ajax\Add
Handler
.
*/
namespace
Drupal\views_ui\Form\Ajax
;
...
...
@@ -14,10 +14,10 @@
/**
* Provides a form for adding an item in the Views UI.
*/
class
Add
Item
extends
ViewsFormBase
{
class
Add
Handler
extends
ViewsFormBase
{
/**
* Constucts a new Add
Item
object.
* Constucts a new Add
Handler
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
)));