Commit 6c614cbf authored by catch's avatar catch
Browse files

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:
entity_type: node
filters:
status:
value: true
value: '1'
table: node_field_data
field: status
id: status
......
......@@ -854,7 +854,7 @@ display:
plugin_id: field
filters:
status:
value: true
value: '1'
table: node_field_data
field: status
plugin_id: boolean
......
......@@ -173,7 +173,7 @@ display:
entity_field: changed
filters:
status:
value: true
value: '1'
table: comment_field_data
field: status
id: status
......@@ -184,7 +184,7 @@ display:
entity_type: comment
entity_field: status
status_node:
value: true
value: '1'
table: node_field_data
field: status
relationship: node
......
......@@ -120,7 +120,7 @@ display:
entity_field: subject
filters:
status:
value: true
value: '1'
table: comment_field_data
field: status
id: status
......@@ -131,7 +131,7 @@ display:
entity_type: comment
entity_field: status
status_node:
value: true
value: '1'
table: node_field_data
field: status
relationship: node
......
......@@ -111,7 +111,7 @@ display:
entity_type: user
filters:
status:
value: true
value: '1'
table: users_field_data
field: status
id: status
......
......@@ -146,6 +146,16 @@ public function testBooleanFilterHandler() {
$this->assertEqual(t('True'), (string) $option[0]);
$option = $this->xpath('//label[@for="edit-options-value-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:
plugin_id: field
filters:
status:
value: true
value: '1'
table: node_field_data
field: status
plugin_id: boolean
......
......@@ -106,7 +106,7 @@ display:
id: status
table: node_field_data
field: status
value: true
value: '1'
group: 0
expose:
operator: '0'
......
......@@ -370,7 +370,7 @@ display:
group_type: group
admin_label: ''
operator: '='
value: true
value: '1'
group: 1
exposed: true
expose:
......
......@@ -105,7 +105,7 @@ display:
operator: '='
relationship: none
table: node_field_data
value: true
value: '1'
plugin_id: boolean
entity_type: node
entity_field: promote
......@@ -116,7 +116,7 @@ display:
group: 1
id: status
table: node_field_data
value: true
value: '1'
plugin_id: boolean
entity_type: node
entity_field: status
......
......@@ -91,7 +91,7 @@ display:
plugin_id: field
filters:
status:
value: true
value: '1'
table: node_field_data
field: status
id: status
......@@ -177,7 +177,7 @@ display:
filter_groups: false
filters:
status:
value: true
value: '1'
table: node_field_data
field: status
id: status
......@@ -244,7 +244,7 @@ display:
filter_groups: false
filters:
status:
value: true
value: '1'
table: node_field_data
field: status
id: status
......@@ -311,7 +311,7 @@ display:
filter_groups: false
filters:
status:
value: true
value: '1'
table: node_field_data
field: status
id: status
......
......@@ -166,7 +166,7 @@ display:
type: language
filters:
status:
value: true
value: '1'
table: node_field_data
field: status
id: status
......
......@@ -123,7 +123,7 @@ display:
plugin_id: node_path
filters:
status:
value: true
value: '1'
table: node_field_data
field: status
plugin_id: boolean
......
......@@ -29,7 +29,7 @@ display:
group: 1
id: status
table: node_field_data
value: true
value: '1'
plugin_id: boolean
entity_type: node
entity_field: status
......
......@@ -123,7 +123,7 @@ display:
entity_field: nid
filters:
status:
value: true
value: '1'
table: node_field_data
field: status
id: status
......
......@@ -89,7 +89,7 @@ display:
plugin_id: field
filters:
status:
value: true
value: '1'
table: node_field_data
field: status
id: status
......
......@@ -89,7 +89,7 @@ display:
plugin_id: field
filters:
status:
value: true
value: '1'
table: node_field_data
field: status
id: status
......
......@@ -89,7 +89,7 @@ display:
plugin_id: field
filters:
status:
value: true
value: '1'
table: node_field_data
field: status
id: status
......
......@@ -223,7 +223,7 @@ display:
plugin_id: numeric
filters:
status:
value: true
value: '1'
table: node_field_data
field: status
id: status
......
......@@ -250,27 +250,28 @@ protected function runUpdates() {
// Ensure there are no failed updates.
if ($this->checkFailedUpdates) {
$this->assertNoRaw('<strong>' . t('Failed:') . '</strong>');
}
// 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
// again. Assert the schema of all configuration objects now.
$names = $this->container->get('config.storage')->listAll();
/** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config */
$typed_config = $this->container->get('config.typed');
$typed_config->clearCachedDefinitions();
foreach ($names as $name) {
$config = $this->config($name);
$this->assertConfigSchema($typed_config, $name, $config->get());
}
// 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
// again. Assert the schema of all configuration objects now.
$names = $this->container->get('config.storage')->listAll();
/** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config */
$typed_config = $this->container->get('config.typed');
$typed_config->clearCachedDefinitions();
foreach ($names as $name) {
$config = $this->config($name);
$this->assertConfigSchema($typed_config, $name, $config->get());
}
// Ensure that the update hooks updated all entity schema.
$needs_updates = \Drupal::entityDefinitionUpdateManager()->needsUpdates();
$this->assertFalse($needs_updates, 'After all updates ran, entity schema is up to date.');
if ($needs_updates) {
foreach (\Drupal::entityDefinitionUpdateManager()->getChangeSummary() as $entity_type_id => $summary) {
foreach ($summary as $message) {
$this->fail($message);
// Ensure that the update hooks updated all entity schema.
$needs_updates = \Drupal::entityDefinitionUpdateManager()->needsUpdates();
$this->assertFalse($needs_updates, 'After all updates ran, entity schema is up to date.');
if ($needs_updates) {
foreach (\Drupal::entityDefinitionUpdateManager()
->getChangeSummary() as $entity_type_id => $summary) {
foreach ($summary as $message) {
$this->fail($message);
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment