- Status changed to Needs review
over 2 years ago 5:04am 10 February 2023 - ๐ฎ๐ณIndia arunkumark Coimbatore
The patch has been rerolled for Drupal 10.1.x
The last submitted patch, 87: 1585930-87.patch, failed testing. View results โ
- Status changed to Needs work
over 2 years ago 8:58pm 16 February 2023 - ๐จ๐ฆCanada joseph.olstad
Patch 84 still applies cleanly to the HEAD of 9.5.x, 10.0.x and 10.1.x, I just checked vs the latest in each branch.
Patch 84 passes.
Patch 85 and 87 were not needed and were incorrectly rolled and fail testing.
https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa... โ
- ๐ฌ๐งUnited Kingdom longwave UK
We still need to address the backward compatibility concerns from #66 onwards: we need a way to allow keep
'_none'
for existing sites that depend on it, while allowing''
for sites that want to use that instead. - ๐จ๐ฆCanada joseph.olstad
patch 84 no longer applies to 10.0.x, will need a new patch for 10.0.10
- last update
about 2 years ago Custom Commands Failed - last update
about 2 years ago 28,519 pass, 2 fail 43:28 39:31 Running- last update
about 2 years ago 28,519 pass, 2 fail - ๐ฎ๐ณIndia sumithra ramalingam
Thank you @joseph.olstad
Patch #93 working clearly with D10.1.4 version. - ๐ฉ๐ชGermany luenemann Sรผdbaden, Germany
Fixed link to project page.
- last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago 25,834 pass, 1,819 fail - ๐ฆ๐ทArgentina darktek
New 11.2.3 version was released today and patch #93 ๐ Options module uses '_none' as a special value Needs work is not working anymore.
I'm sharing this new patch: https://www.drupal.org/files/issues/2025-08-07/1585930-96.patch โ
- ๐ช๐ธSpain eduardo morales alberti Spain, ๐ช๐บ
@darktek some changes do not match the 93 patch:
Why do you replaced "$element['#value'] === ''" by "$element['#value'] == ''" or "if ($value !== '') {" by "if ($value != '') {"?
interdiff 1585930-93.patch 1585930-96.patch
diff -u b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php --- b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php @@ -90,7 +90,7 @@ * The form state. */ public static function validateElement(array $element, FormStateInterface $form_state) { - if ($element['#required'] && $element['#value'] === '') { + if ($element['#required'] && $element['#value'] == '') { if (isset($element['#required_error'])) { $form_state->setError($element, $element['#required_error']); } @@ -144,7 +144,7 @@ // Add an empty option if the widget needs one. if ($empty_label = $this->getEmptyLabel()) { - $options = ['' => $empty_label] + $options; + $options = ['_none' => $empty_label] + $options; } $module_handler = \Drupal::moduleHandler(); diff -u b/core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.php b/core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.php --- b/core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.php +++ b/core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.php @@ -36,7 +36,7 @@ $this->assertCount(count($this->test) + 1, $options); foreach ($options as $option) { $value = $option->getValue(); - if ($value !== '') { + if ($value != '') { $this->assertContains($value, $this->test); } } diff -u b/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php b/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php --- b/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php +++ b/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php @@ -613,7 +613,7 @@ // Display form: check that empty '' option is present and has label. $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit'); - $this->assertNotEmpty($this->xpath('//div[@id=:id]//input[@value=:value]', [':id' => 'edit-card-1', ':value' => '']), 'A test radio button has a "None" choice.'); + $this->assertNotEmpty($this->xpath('//div[@id=:id]//input[@value=:value]', [':id' => 'edit-card-1', ':value' => '']), 'A test radio button has a "None" choice.'); // Change it to the select widget. $display_repository->getFormDisplay('entity_test', 'entity_test') diff -u b/core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php b/core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php --- b/core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php +++ b/core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php @@ -52,12 +52,12 @@ * @param string $id * The ID of the workspace to create. * @param string $parent - * (optional) The ID of the parent workspace. Defaults to ''. + * (optional) The ID of the parent workspace. Defaults to '_none'. * * @return \Drupal\workspaces\WorkspaceInterface * The workspace that was just created. */ - protected function createWorkspaceThroughUi($label, $id, $parent = '') { + protected function createWorkspaceThroughUi($label, $id, $parent = '_none') { $this->drupalGet('/admin/config/workflow/workspaces/add'); $this->submitForm([ 'id' => $id, @@ -94,12 +94,12 @@ * @param string|null $id * The ID of the workspace to create. * @param string $parent - * (optional) The ID of the parent workspace. Defaults to '_none'. + * (optional) The ID of the parent workspace. Defaults to ''. * * @return \Drupal\workspaces\WorkspaceInterface * The workspace that was just created. */ - protected function createWorkspaceThroughUi(?string $label = NULL, ?string $id = NULL, string $parent = '_none') { + protected function createWorkspaceThroughUi(?string $label = NULL, ?string $id = NULL, string $parent = '') { $id ??= $this->randomMachineName(); $label ??= $this->randomString();
- ๐ช๐ธSpain eduardo morales alberti Spain, ๐ช๐บ
We will open a MR to track the changes properly
- Merge request !13034Issue #1585930 by swentel, attiks: Options module uses '_none' as a special value โ (Open) created by eduardo morales alberti
- ๐ช๐ธSpain eduardo morales alberti Spain, ๐ช๐บ
Failed PHPUnit:
Options Widgets (Drupal\Tests\options\Functional\OptionsWidgets) โ Radio buttons โ Check boxes โ Select list single โ Select list required error attribute โ โ Behat\Mink\Exception\ElementNotFoundException: Option with id|name|label|value "_none" not found. โ โ /builds/issue/drupal-1585930/core/tests/Drupal/Tests/WebAssert.php:241 โ /builds/issue/drupal-1585930/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php:406 โด โ Select list multiple โ Select list float โ Empty value โ Options list alter โ โ Behat\Mink\Exception\ElementNotFoundException: Element matching xpath "//select[@id="edit-card-1"]//option[@value="_none" and text()="- None -"]" not found. โ โ /builds/issue/drupal-1585930/vendor/behat/mink/src/WebAssert.php:465 โ /builds/issue/drupal-1585930/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php:689
- ๐ช๐ธSpain eduardo morales alberti Spain, ๐ช๐บ
Failing:
Options Widgets (Drupal\Tests\options\Functional\OptionsWidgets) โ Radio buttons โ Check boxes โ Select list single โ Select list required error attribute โ Select list multiple โ Select list float โ Empty value โ Options list alter โ โ Behat\Mink\Exception\ElementNotFoundException: Element matching xpath "//select[@id="edit-card-4"]//option[@value="" and text()="- Select something -"]" not found. โ โ /builds/issue/drupal-1585930/vendor/behat/mink/src/WebAssert.php:465 โ /builds/issue/drupal-1585930/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php:691