Commit 015d61bc authored by webchick's avatar webchick

Issue #1810480 by dawehner, ACF: Provide the plugin_id() to support views metadata integration.

parent 2413b63e
......@@ -20,6 +20,7 @@ display:
summary_options:
items_per_page: '25'
table: node
plugin_id: argument_comment_user_uid
cache:
type: none
exposed_form:
......@@ -29,6 +30,7 @@ display:
field: nid
id: nid
table: node
plugin_id: node
pager:
type: full
query:
......
......@@ -13,6 +13,7 @@ display:
field: nid
id: nid
table: node
plugin_id: node
cache:
type: none
exposed_form:
......
......@@ -17,6 +17,7 @@ display:
id: nid
table: node
field: nid
plugin_id: node
filter_groups:
groups:
1: AND
......@@ -32,6 +33,7 @@ display:
table: node
value:
- '1'
plugin_id: node_uid_revision
sorts: { }
pager:
type: full
......
......@@ -10,26 +10,31 @@ display:
id: nid
table: node_revision
field: nid
required: TRUE
required: true
plugin_id: standard
fields:
vid:
id: vid
table: node_revision
field: vid
plugin_id: standard
nid_1:
id: nid_1
table: node_revision
field: nid
plugin_id: standard
nid:
id: nid
table: node
field: nid
relationship: nid
plugin_id: node
arguments:
nid:
id: nid:
id: nid
table: node_revision
field: nid
plugin_id: node_nid
display_plugin: default
display_title: Master
id: default
......
......@@ -10,26 +10,31 @@ display:
id: vid
table: node_revision
field: vid
required: TRUE
required: true
plugin_id: standard
fields:
vid:
id: vid
table: node_revision
field: vid
plugin_id: standard
nid_1:
id: nid_1
table: node_revision
field: nid
plugin_id: standard
nid:
id: nid
table: node
field: nid
relationship: vid
plugin_id: node
arguments:
nid:
id: nid:
id: nid
table: node_revision
field: nid
plugin_id: node_nid
display_plugin: default
display_title: Master
id: default
......
......@@ -76,6 +76,7 @@ display:
empty_zero: '0'
hide_alter_empty: '1'
link_to_node: '0'
plugin_id: node
filters:
status_extra:
id: status_extra
......@@ -112,12 +113,14 @@ display:
default_group: All
default_group_multiple: { }
group_items: { }
plugin_id: node_status
sorts:
nid:
id: nid
table: node
field: nid
order: ASC
plugin_id: standard
filter_groups:
operator: AND
groups:
......
......@@ -118,7 +118,7 @@ public function pre_render($result) {
parent::pre_render($result);
if ($result) {
// Get all entities which will be used to render in rows.
// Get all entities which will be used to render in rows.c
$entities = array();
foreach ($result as $row) {
$entity = $row->_entity;
......
......@@ -18,11 +18,13 @@ display:
field: name
id: name
table: taxonomy_term_data
plugin_id: taxonomy
nid:
field: nid
id: nid
relationship: tid_representative
table: node
plugin_id: node
pager:
options:
items_per_page: '10'
......@@ -44,6 +46,7 @@ display:
subquery_sort: node.nid
subquery_view: ''
table: taxonomy_term_data
plugin_id: groupwise_max
row:
type: fields
sorts:
......@@ -52,6 +55,7 @@ display:
id: tid
order: DESC
table: taxonomy_term_data
plugin_id: standard
style:
type: default
title: test_groupwise
......
......@@ -20,6 +20,7 @@ display:
summary_options:
items_per_page: '25'
table: taxonomy_term_data
plugin_id: taxonomy
tid_1:
default_argument_type: fixed
field: tid
......@@ -31,6 +32,7 @@ display:
summary_options:
items_per_page: '25'
table: taxonomy_term_data
plugin_id: taxonomy
cache:
type: none
exposed_form:
......@@ -47,6 +49,7 @@ display:
table: node
vocabularies:
tags: '0'
plugin_id: node_term_data
term_node_tid_1:
field: term_node_tid
id: term_node_tid_1
......@@ -54,6 +57,7 @@ display:
table: node
vocabularies:
tags: '0'
plugin_id: node_term_data
sorts:
nid:
field: nid
......
......@@ -19,11 +19,13 @@ display:
field: name
id: name
table: users
plugin_id: user_name
nid:
field: nid
id: nid
relationship: uid_representative
table: node
plugin_id: node
filters:
status:
expose:
......@@ -33,6 +35,7 @@ display:
id: status
table: users
value: '1'
plugin_id: boolean
pager:
options:
items_per_page: '10'
......@@ -54,6 +57,7 @@ display:
subquery_sort: node.nid
subquery_view: ''
table: users
plugin_id: groupwise_max
row:
type: fields
sorts:
......@@ -62,6 +66,7 @@ display:
id: created
order: DESC
table: users
plugin_id: date
style:
type: default
title: test_groupwise_user
......
......@@ -37,6 +37,7 @@ display:
link_to_user: '1'
overwrite_anonymous: '0'
table: users
plugin_id: user_name
title:
alter:
absolute: '0'
......@@ -54,6 +55,7 @@ display:
label: ''
link_to_node: '1'
table: node
plugin_id: node
uid:
alter:
absolute: '0'
......@@ -77,6 +79,7 @@ display:
id: uid
link_to_user: '1'
table: users
plugin_id: user
pager:
options:
items_per_page: '10'
......
......@@ -11,6 +11,7 @@ display:
id: uid
table: users
field: uid
plugin_id: user
arguments:
uid:
id: uid
......@@ -18,6 +19,7 @@ display:
field: uid
title_enable: true
title: %1
plugin_id: user_uid
display_plugin: default
display_title: Master
id: default
......
......@@ -18,6 +18,7 @@ display:
table: views
validate:
type: user
plugin_id: 'null'
cache:
type: none
exposed_form:
......
......@@ -31,6 +31,7 @@ display:
link_to_user: '1'
overwrite_anonymous: '0'
table: users
plugin_id: user_name
pager:
type: full
query:
......
......@@ -33,6 +33,7 @@ display:
table: node
field: created
order: DESC
plugin_id: date
arguments:
created_year_month:
id: created_year_month
......@@ -51,6 +52,7 @@ display:
override: true
items_per_page: '30'
specify_validation: 1
plugin_id: node_created_year_month
filters:
status:
id: status
......@@ -60,6 +62,7 @@ display:
group: 0
expose:
operator: false
plugin_id: boolean
style:
type: default
row:
......@@ -101,3 +104,4 @@ display:
summary_options:
items_per_page: '30'
specify_validation: 1
plugin_id: node_created_year_month
......@@ -36,6 +36,7 @@ display:
empty: false
content: 'No backlinks found.'
format: '1'
plugin_id: text
fields:
title:
id: title
......@@ -43,6 +44,7 @@ display:
field: title
label: ''
link_to_node: 1
plugin_id: node
arguments:
nid:
id: nid
......@@ -66,6 +68,7 @@ display:
group: 0
expose:
operator: false
plugin_id: boolean
style:
type: html_list
options:
......
......@@ -35,6 +35,7 @@ display:
id: nid
table: comment
field: nid
plugin_id: standard
fields:
subject:
id: subject
......@@ -42,18 +43,21 @@ display:
field: subject
label: ''
link_to_comment: 1
plugin_id: comment
timestamp:
id: timestamp
table: comment
field: changed
label: ''
date_format: 'time ago'
plugin_id: date
sorts:
timestamp:
id: timestamp
table: comment
field: changed
order: DESC
plugin_id: date
filters:
status_extra:
id: status_extra
......@@ -61,6 +65,7 @@ display:
field: status_extra
relationship: nid
group: 0
plugin_id: node_status
style:
type: html_list
row:
......@@ -88,23 +93,27 @@ display:
relationship: nid
label: 'Reply to'
link_to_node: 1
plugin_id: node
timestamp:
id: timestamp
table: comment
field: changed
label: ''
date_format: 'time ago'
plugin_id: date
subject:
id: subject
table: comment
field: subject
label: ''
link_to_comment: 1
plugin_id: comment
comment:
id: comment
table: field_data_comment_body
field: comment_body
label: ''
plugin_id: field
path: comments/recent
style:
type: html_list
......
......@@ -38,11 +38,13 @@ display:
table: node
field: sticky
order: DESC
plugin_id: standard
created:
id: created
table: node
field: created
order: DESC
plugin_id: date
filters:
promote:
id: promote
......@@ -52,6 +54,7 @@ display:
group: 0
expose:
operator: false
plugin_id: boolean
status:
id: status
table: node
......@@ -60,6 +63,7 @@ display:
group: 0
expose:
operator: false
plugin_id: boolean
page_1:
id: page_1
display_title: Page
......
......@@ -35,6 +35,7 @@ display:
table: node
field: title
link_to_node: 1
plugin_id: node
name:
id: name
table: users
......@@ -42,12 +43,14 @@ display:
label: Author
link_to_user: 1
relationship: uid
plugin_id: user_name
changed:
id: changed
table: node
field: changed
label: 'Last update'
date_format: long
plugin_id: date
arguments:
title:
id: title
......@@ -67,11 +70,13 @@ display:
case: upper
path_case: lower
transform_dash: 0
plugin_id: string
relationships:
uid:
id: uid
table: node
field: uid
plugin_id: standard
style:
type: table
options:
......@@ -144,6 +149,7 @@ display:
case: upper
path_case: lower
transform_dash: 0
plugin_id: string
displays:
default: default
page: page_1
......
......@@ -32,11 +32,13 @@ display:
table: node
field: sticky
order: DESC
plugin_id: standard
created:
id: created
table: node
field: created
order: DESC
plugin_id: date
arguments:
term_node_tid_depth:
id: term_node_tid_depth
......@@ -55,6 +57,7 @@ display:
type: taxonomy_term
depth: '0'
break_phrase: 1
plugin_id: taxonomy_index_tid_depth
term_node_tid_depth_modifier:
id: term_node_tid_depth_modifier
table: node
......@@ -65,6 +68,7 @@ display:
summary:
format: default_summary
specify_validation: 1
plugin_id: taxonomy_index_tid_depth_modifier
filters:
status_extra:
id: status_extra
......@@ -73,6 +77,7 @@ display:
group: 0
expose:
operator: false
plugin_id: node_status
style:
type: default
row:
......
......@@ -34,31 +34,37 @@ display:
id: uid
table: node
field: uid
plugin_id: standard
fields:
type:
id: type
table: node
field: type
plugin_id: node_type
title:
id: title
table: node
field: title
plugin_id: node
name:
id: name
table: users
field: name
relationship: uid
label: Author
plugin_id: user_name
comment_count:
id: comment_count
table: node_comment_statistics
field: comment_count
label: Replies
plugin_id: numeric
last_comment_timestamp:
id: last_comment_timestamp
table: node_comment_statistics
field: last_comment_timestamp
label: 'Last Post'
plugin_id: comment_last_timestamp
timestamp:
id: timestamp
table: history
......@@ -66,6 +72,7 @@ display:
label: ''
link_to_node: 0
comments: 1
plugin_id: node_history_user_timestamp
new_comments:
id: new_comments
table: node
......@@ -74,11 +81,13 @@ display:
hide_empty: true
suffix: ' new'
link_to_comment: 1
plugin_id: node_new_comments
sorts:
last_comment_timestamp:
id: last_comment_timestamp
table: node_comment_statistics
field: last_comment_timestamp
plugin_id: date
arguments:
uid_touch:
id: uid_touch
......@@ -92,6 +101,7 @@ display:
summary:
format: default_summary
specify_validation: 1
plugin_id: argument_comment_user_uid
filters:
status:
id: status
......@@ -101,6 +111,7 @@ display:
group: 0
expose:
operator: false
plugin_id: boolean
style:
type: table
options:
......
......@@ -68,6 +68,12 @@ public static function getInfo() {
);
}
protected function setUp() {
parent::setUp();
$this->enableViewsTestModule();
}
/**
* Tests CRUD operations.
*/
......@@ -345,9 +351,10 @@ protected function displayMethodTests() {
$expected_items[$id1] = $expected_item = array(
'id' => 'id',
'table' => 'views_test_data',
'field' => 'id'
'field' => 'id',
'plugin_id' => 'numeric',
);
$this->assertEqual($item1, $expected_item);
$this->assertArrayEqual($item1, $expected_item);
$options = array(
'alter' => array(
......@@ -359,12 +366,13 @@ protected function displayMethodTests() {
$expected_items[$id2] = $expected_item = array(
'id' => 'name',
'table' => 'views_test_data',
'field' => 'name'
'field' => 'name',
'plugin_id' => 'standard',
) + $options;
$this->assertEqual($item2, $expected_item);
$this->assertArrayEqual($item2, $expected_item);
// Tests the expected fields from the previous additions.
$this->assertEqual($view->getItems('field', $display_id), $expected_items);
$this->assertArrayEqual($view->getItems('field', $display_id), $expected_items);
// Alter an existing item via setItem and check the result via getItem
// and getItems.
......@@ -375,8 +383,8 @@ 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);
$this->assertArrayEqual($view->getItem($display_id, 'field', 'id'), $item);
$this->assertArrayEqual($view->getItems('field', $display_id), $expected_items);
}
/**
......
......@@ -59,6 +59,35 @@ protected function enableViewsTestModule() {
$this->checkPermissions(array(), TRUE);
}
/**
* Asserts that two arrays are the same, but not checking the order of it.
*
* @param array $first
* The first value to check.
* @param array $second
* The second value to check.
* @param string $message
* (optional) A message to display with the assertion. Do not translate
* messages: use format_string() to embed variables in the message text, not
* t(). If left blank, a default message will be displayed.
* @param string $group
* (optional) The group this message is in, which is displayed in a column
* in test output. Use 'Debug' to indicate this is debugging output. Do not
* translate this string. Defaults to 'Other'; most tests do not override
* this default.
* @return bool
* TRUE on pass, FALSE on fail.
*/
protected function assertArrayEqual(array $first, array $second, $message = '', $group = 'Other') {
$diff = array_diff($first, $second);
if (empty($diff)) {
$this->assert(TRUE, $message ? $message : format_string('Value @first is equal to value @second.', array('@first' => var_export($first, TRUE), '@second' => var_export($second, TRUE))), $group);
}
else {
$this->assert(FALSE, $message ? $message : format_string('The first value differs from the second by @diff.', array('@diff' => var_export($diff, TRUE))));
}
}
/**
* Verifies that a result set returned by a View matches expected values.
*
......
......@@ -2034,15 +2034,18 @@ public function addItem($display_id, $type, $table, $field, $options = array(),
// If the desired type is not found, use the original value directly.
$handler_type = !empty($types[$type]['type']) ? $types[$type]['type'] : $type;