Commit 6c614cbf authored by catch's avatar catch

Issue #2459289 by Lendude, dhrjgpt2005, kalistos, dawehner, david_garcia:...

Issue #2459289 by Lendude, dhrjgpt2005, kalistos, dawehner, david_garcia: Boolean default values are not saved
parent 97642595
...@@ -132,7 +132,7 @@ display: ...@@ -132,7 +132,7 @@ display:
entity_type: node entity_type: node
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
id: status id: status
......
...@@ -854,7 +854,7 @@ display: ...@@ -854,7 +854,7 @@ display:
plugin_id: field plugin_id: field
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
plugin_id: boolean plugin_id: boolean
......
...@@ -173,7 +173,7 @@ display: ...@@ -173,7 +173,7 @@ display:
entity_field: changed entity_field: changed
filters: filters:
status: status:
value: true value: '1'
table: comment_field_data table: comment_field_data
field: status field: status
id: status id: status
...@@ -184,7 +184,7 @@ display: ...@@ -184,7 +184,7 @@ display:
entity_type: comment entity_type: comment
entity_field: status entity_field: status
status_node: status_node:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
relationship: node relationship: node
......
...@@ -120,7 +120,7 @@ display: ...@@ -120,7 +120,7 @@ display:
entity_field: subject entity_field: subject
filters: filters:
status: status:
value: true value: '1'
table: comment_field_data table: comment_field_data
field: status field: status
id: status id: status
...@@ -131,7 +131,7 @@ display: ...@@ -131,7 +131,7 @@ display:
entity_type: comment entity_type: comment
entity_field: status entity_field: status
status_node: status_node:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
relationship: node relationship: node
......
...@@ -111,7 +111,7 @@ display: ...@@ -111,7 +111,7 @@ display:
entity_type: user entity_type: user
filters: filters:
status: status:
value: true value: '1'
table: users_field_data table: users_field_data
field: status field: status
id: status id: status
......
...@@ -146,6 +146,16 @@ public function testBooleanFilterHandler() { ...@@ -146,6 +146,16 @@ public function testBooleanFilterHandler() {
$this->assertEqual(t('True'), (string) $option[0]); $this->assertEqual(t('True'), (string) $option[0]);
$option = $this->xpath('//label[@for="edit-options-value-0"]'); $option = $this->xpath('//label[@for="edit-options-value-0"]');
$this->assertEqual(t('False'), (string) $option[0]); $this->assertEqual(t('False'), (string) $option[0]);
// Expose the filter and see if the 'Any' option is added and if we can save
// it.
$this->drupalPostForm(NULL, [], 'Expose filter');
$option = $this->xpath('//label[@for="edit-options-value-all"]');
$this->assertEqual(t('- Any -'), (string) $option[0]);
$this->drupalPostForm(NULL, ['options[value]' => 'All', 'options[expose][required]' => FALSE], 'Apply');
$this->drupalPostForm(NULL, [], 'Save');
$this->drupalGet('/admin/structure/views/nojs/handler/test_view_fieldapi/default/filter/field_boolean_value');
$this->assertFieldChecked('edit-options-value-all');
} }
} }
...@@ -147,7 +147,7 @@ display: ...@@ -147,7 +147,7 @@ display:
plugin_id: field plugin_id: field
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
plugin_id: boolean plugin_id: boolean
......
...@@ -106,7 +106,7 @@ display: ...@@ -106,7 +106,7 @@ display:
id: status id: status
table: node_field_data table: node_field_data
field: status field: status
value: true value: '1'
group: 0 group: 0
expose: expose:
operator: '0' operator: '0'
......
...@@ -370,7 +370,7 @@ display: ...@@ -370,7 +370,7 @@ display:
group_type: group group_type: group
admin_label: '' admin_label: ''
operator: '=' operator: '='
value: true value: '1'
group: 1 group: 1
exposed: true exposed: true
expose: expose:
......
...@@ -105,7 +105,7 @@ display: ...@@ -105,7 +105,7 @@ display:
operator: '=' operator: '='
relationship: none relationship: none
table: node_field_data table: node_field_data
value: true value: '1'
plugin_id: boolean plugin_id: boolean
entity_type: node entity_type: node
entity_field: promote entity_field: promote
...@@ -116,7 +116,7 @@ display: ...@@ -116,7 +116,7 @@ display:
group: 1 group: 1
id: status id: status
table: node_field_data table: node_field_data
value: true value: '1'
plugin_id: boolean plugin_id: boolean
entity_type: node entity_type: node
entity_field: status entity_field: status
......
...@@ -91,7 +91,7 @@ display: ...@@ -91,7 +91,7 @@ display:
plugin_id: field plugin_id: field
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
id: status id: status
...@@ -177,7 +177,7 @@ display: ...@@ -177,7 +177,7 @@ display:
filter_groups: false filter_groups: false
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
id: status id: status
...@@ -244,7 +244,7 @@ display: ...@@ -244,7 +244,7 @@ display:
filter_groups: false filter_groups: false
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
id: status id: status
...@@ -311,7 +311,7 @@ display: ...@@ -311,7 +311,7 @@ display:
filter_groups: false filter_groups: false
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
id: status id: status
......
...@@ -166,7 +166,7 @@ display: ...@@ -166,7 +166,7 @@ display:
type: language type: language
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
id: status id: status
......
...@@ -123,7 +123,7 @@ display: ...@@ -123,7 +123,7 @@ display:
plugin_id: node_path plugin_id: node_path
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
plugin_id: boolean plugin_id: boolean
......
...@@ -29,7 +29,7 @@ display: ...@@ -29,7 +29,7 @@ display:
group: 1 group: 1
id: status id: status
table: node_field_data table: node_field_data
value: true value: '1'
plugin_id: boolean plugin_id: boolean
entity_type: node entity_type: node
entity_field: status entity_field: status
......
...@@ -123,7 +123,7 @@ display: ...@@ -123,7 +123,7 @@ display:
entity_field: nid entity_field: nid
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
id: status id: status
......
...@@ -89,7 +89,7 @@ display: ...@@ -89,7 +89,7 @@ display:
plugin_id: field plugin_id: field
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
id: status id: status
......
...@@ -89,7 +89,7 @@ display: ...@@ -89,7 +89,7 @@ display:
plugin_id: field plugin_id: field
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
id: status id: status
......
...@@ -89,7 +89,7 @@ display: ...@@ -89,7 +89,7 @@ display:
plugin_id: field plugin_id: field
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
id: status id: status
......
...@@ -223,7 +223,7 @@ display: ...@@ -223,7 +223,7 @@ display:
plugin_id: numeric plugin_id: numeric
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
id: status id: status
......
...@@ -250,7 +250,6 @@ protected function runUpdates() { ...@@ -250,7 +250,6 @@ protected function runUpdates() {
// Ensure there are no failed updates. // Ensure there are no failed updates.
if ($this->checkFailedUpdates) { if ($this->checkFailedUpdates) {
$this->assertNoRaw('<strong>' . t('Failed:') . '</strong>'); $this->assertNoRaw('<strong>' . t('Failed:') . '</strong>');
}
// The config schema can be incorrect while the update functions are being // The config schema can be incorrect while the update functions are being
// executed. But once the update has been completed, it needs to be valid // executed. But once the update has been completed, it needs to be valid
...@@ -268,13 +267,15 @@ protected function runUpdates() { ...@@ -268,13 +267,15 @@ protected function runUpdates() {
$needs_updates = \Drupal::entityDefinitionUpdateManager()->needsUpdates(); $needs_updates = \Drupal::entityDefinitionUpdateManager()->needsUpdates();
$this->assertFalse($needs_updates, 'After all updates ran, entity schema is up to date.'); $this->assertFalse($needs_updates, 'After all updates ran, entity schema is up to date.');
if ($needs_updates) { if ($needs_updates) {
foreach (\Drupal::entityDefinitionUpdateManager()->getChangeSummary() as $entity_type_id => $summary) { foreach (\Drupal::entityDefinitionUpdateManager()
->getChangeSummary() as $entity_type_id => $summary) {
foreach ($summary as $message) { foreach ($summary as $message) {
$this->fail($message); $this->fail($message);
} }
} }
} }
} }
}
/** /**
* Runs the install database tasks for the driver used by the test runner. * Runs the install database tasks for the driver used by the test runner.
......
...@@ -88,7 +88,7 @@ display: ...@@ -88,7 +88,7 @@ display:
entity_field: title entity_field: title
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
id: status id: status
......
...@@ -182,7 +182,7 @@ display: ...@@ -182,7 +182,7 @@ display:
group_type: group group_type: group
admin_label: '' admin_label: ''
operator: '=' operator: '='
value: true value: '1'
group: 1 group: 1
exposed: false exposed: false
expose: expose:
......
...@@ -130,7 +130,7 @@ display: ...@@ -130,7 +130,7 @@ display:
field_api_classes: false field_api_classes: false
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
plugin_id: boolean plugin_id: boolean
......
...@@ -116,7 +116,7 @@ display: ...@@ -116,7 +116,7 @@ display:
entity_field: title entity_field: title
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
id: status id: status
......
...@@ -116,7 +116,7 @@ display: ...@@ -116,7 +116,7 @@ display:
entity_field: title entity_field: title
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
id: status id: status
......
...@@ -116,7 +116,7 @@ display: ...@@ -116,7 +116,7 @@ display:
entity_field: title entity_field: title
filters: filters:
status: status:
value: true value: '1'
table: node_field_data table: node_field_data
field: status field: status
id: status id: status
......
...@@ -705,7 +705,7 @@ display: ...@@ -705,7 +705,7 @@ display:
group_type: group group_type: group
admin_label: '' admin_label: ''
operator: '=' operator: '='
value: true value: '1'
group: 1 group: 1
exposed: true exposed: true
expose: expose:
...@@ -753,7 +753,7 @@ display: ...@@ -753,7 +753,7 @@ display:
group_type: group group_type: group
admin_label: '' admin_label: ''
operator: '=' operator: '='
value: true value: '1'
group: 1 group: 1
exposed: false exposed: false
expose: expose:
......
...@@ -89,7 +89,7 @@ display: ...@@ -89,7 +89,7 @@ display:
entity_field: name entity_field: name
filters: filters:
status: status:
value: true value: '1'
table: users_field_data table: users_field_data
field: status field: status
id: status id: status
......
...@@ -96,7 +96,7 @@ display: ...@@ -96,7 +96,7 @@ display:
entity_field: name entity_field: name
filters: filters:
status: status:
value: true value: '1'
table: users_field_data table: users_field_data
field: status field: status
id: status id: status
......
...@@ -48,7 +48,7 @@ display: ...@@ -48,7 +48,7 @@ display:
group: 1 group: 1
id: status id: status
table: users_field_data table: users_field_data
value: true value: '1'
plugin_id: boolean plugin_id: boolean
entity_type: user entity_type: user
entity_field: status entity_field: status
......
...@@ -52,7 +52,7 @@ display: ...@@ -52,7 +52,7 @@ display:
table: users_field_data table: users_field_data
field: status field: status
operator: '=' operator: '='
value: true value: '1'
plugin_id: boolean plugin_id: boolean
entity_type: user entity_type: user
entity_field: status entity_field: status
......
...@@ -126,7 +126,7 @@ display: ...@@ -126,7 +126,7 @@ display:
field_api_classes: false field_api_classes: false
filters: filters:
status: status:
value: true value: '1'
table: users_field_data table: users_field_data
field: status field: status
plugin_id: boolean plugin_id: boolean
......
...@@ -142,7 +142,7 @@ display: ...@@ -142,7 +142,7 @@ display:
plugin_id: user_roles plugin_id: user_roles
filters: filters:
status: status:
value: true value: '1'
table: users_field_data table: users_field_data
field: status field: status
id: status id: status
......
...@@ -123,7 +123,7 @@ views.filter.group_item.numeric: ...@@ -123,7 +123,7 @@ views.filter.group_item.numeric:
# Schema for the views filter value. # Schema for the views filter value.
views.filter_value.boolean: views.filter_value.boolean:
type: boolean type: string