The Needs Review Queue Bot → tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- 🇮🇳India prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan
Add The Re-roll For The 10.1x Branch.
- Status changed to Needs review
almost 2 years ago 12:25pm 3 March 2023 - 🇮🇳India mohit_aghera Rajkot
Cleaning out phpcs/phpstan issues.
@Prem Suthar: Please try to run commit-code-check sh script before creating any patch or re-roll.
Here are the steps to do that:- visit `core` directory on your local setup
- run `yarn install`. This will install required js dependency
- Run script using `sh ./core/scripts/dev/commit-code-check.sh`
Also, you can run test cases on local and resolve test case failures if any. Please refer documentation here https://www.drupal.org/docs/automated-testing/phpunit-in-drupal/running-... →
- Status changed to Needs work
almost 2 years ago 2:03pm 8 March 2023 - 🇺🇸United States smustgrave
The issue summary should be updated to include proposed solution.
- Status changed to Needs review
over 1 year ago 5:39am 26 March 2023 - 🇮🇳India mohit_aghera Rajkot
Updated the issue summary.
I think change record won't be required since it is a minor bug. - Status changed to RTBC
over 1 year ago 5:32pm 27 March 2023 - 🇺🇸United States smustgrave
@mohit_aghera thanks!
Tests look good!
Verified the issue by adding a List (text) to the Article content type on a standard install.
Made it required
Added
$form['field_test']['widget']['#required_error'] = t('CUSTOM REQUIRED ERROR MESSAGE');
to claro_form_alter and verified errors message not usedApplied patch and not it is!
- Status changed to Needs work
over 1 year ago 1:03am 29 March 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
-
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php @@ -90,7 +89,15 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen + elseif (isset($element['#title'])) { + $form_state->setError($element, t('@name field is required.', ['@name' => $element['#title']])); + }
This isn't needed for a widget, the title is set by
\Drupal\Core\Field\WidgetBase::form
So we can keep this as (pseudo code)
if (custom required) {
use custom required
}
else {
keep the original code
} -
+++ b/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php @@ -371,7 +371,47 @@ public function testSelectListSingle() { + // Disable form alter hook. + \Drupal::state()->set('options_test.form_alter_enable', FALSE);
This isn't needed, each test{Something} runs with a new database.
-
- 🇮🇳India ranjith_kumar_k_u Kerala
addressed #31, but there is test failure on
OptionsWidgetsTest::testSelectListSingle
because we removedelseif
condition(#31.1)So I changed the following code.
from// Submit form: select invalid 'none' option. $edit = ['card_1' => '_none']; $this->submitForm($edit, 'Save'); $this->assertSession()->pageTextContains("{$field->getName()} field is required.");
to
// Submit form: select invalid 'none' option. $edit = ['card_1' => '_none']; $this->submitForm($edit, 'Save'); $this->assertSession()->pageTextContains("Error message");
because I can see only the following
- Status changed to Needs review
over 1 year ago 2:59pm 30 March 2023 - Status changed to Needs work
over 1 year ago 3:10pm 30 March 2023 - 🇺🇸United States smustgrave
Not sure we should just editing the test to just pass is the right path.
If making the changes in #31 breaks something we should discuss if that change is needed.
Just "Error message" doesn't seem to be useful.
@larowlan thoughts?
- 🇮🇳India ranjith_kumar_k_u Kerala
Hi @smustgrave, #32 was my understanding mistake , in #31.1 suggest that
if (custom required) { use custom required } else { keep the original code }
so I have updated the code like that in #33, kindly ignore the #32 patch
- Status changed to Needs review
over 1 year ago 5:06am 31 March 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
+++ b/core/modules/options/tests/src/Functional/OptionsWidgetsTest.php @@ -371,7 +371,44 @@ public function testSelectListSingle() { - $this->assertFieldValues($entity_init, 'card_1', []);
this looks like a regression
- Status changed to Needs work
over 1 year ago 8:36pm 31 March 2023 - Status changed to Needs review
over 1 year ago 11:55am 14 April 2023 - 🇮🇳India mohit_aghera Rajkot
Putting the line back to
testSelectListSingle ()
test case that was removed.
Both the test cases are passing on local.I think it was accidentally removed by me in #14
- Status changed to RTBC
over 1 year ago 1:40pm 14 April 2023 - 🇺🇸United States smustgrave
Marking as #39 and #31 appears to be addressed.
- last update
over 1 year ago 29,203 pass - last update
over 1 year ago 29,284 pass - last update
over 1 year ago 29,292 pass - last update
over 1 year ago 29,303 pass - last update
over 1 year ago 29,305 pass - last update
over 1 year ago 29,344 pass - last update
over 1 year ago 29,367 pass - last update
over 1 year ago 29,367 pass - last update
over 1 year ago 29,372 pass - last update
over 1 year ago 29,379 pass - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply -
larowlan →
committed a0db6dfb on 10.1.x
Issue #3060626 by mohit_aghera, ranjith_kumar_k_u, Suresh Prabhu Parkala...
-
larowlan →
committed a0db6dfb on 10.1.x
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Committed to 10.1.x
Waiting for tests before backport.
Thanks!
- last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - Open on Drupal.org →Environment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago 28,519 pass - last update
over 1 year ago 30,335 pass - last update
over 1 year ago 28,519 pass - last update
over 1 year ago 28,519 pass - last update
over 1 year ago 28,519 pass - Status changed to Fixed
over 1 year ago 9:36am 26 May 2023 Automatically closed - issue fixed for 2 weeks with no activity.