- ๐ฆ๐บAustralia acbramley
- ๐จ๐ฆCanada xmacinfo Canada
@acbramley: I am a bit confused. Does this issue require more work or is it RTBC?
- ๐ฆ๐บAustralia acbramley
@xmacinfo no, it needs reviewing. It was set to Needs Work in #74 based on the deprecation error. That has been fixed. However, it's also tagged for usability and accessibility review, however I'm not 100% sure if that is required given it's a fairly straight forward change.
- ๐จ๐ฆCanada xmacinfo Canada
@acbramley: Thanks for the clarification. Letโs see if we can have usability and accessibility reviews.
- Status changed to Needs work
almost 2 years ago 3:32pm 17 March 2023 - ๐ฌ๐งUnited Kingdom AaronMcHale Edinburgh, Scotland
Usability review
We reviewed this issue at ๐ Drupal Usability Meeting 2023-03-17 Fixed .
That issue will have a link to the recording, for the record the attendees were: myself, @rkoller, @simohell, @shaal and @blackbamboo.
After discussing various options, the group made the following recommendations:
- We recommend
[field_name] value is incorrect. Enter a valid date and time.
for the error message text. For example: "Authored on value is incorrect. Enter a valid date and time". - We also recommend completely removing the
title
attributes. - In a follow-up issue, we should explore making the validation specific to the individual date or time elements, right now if the error is triggered by the time element, both the date and time elements are highlighted in red. This is not ideal, and we should find a way to highlight the specific element that is causing the error.
- We used the "Authored on" Node field to test with, and we noted that the description of that filed could be improved, it simply says "The time that the node was created.", we felt this could be improved by saying "date and time", we also try to avoid the term "node" in the user interface and instead prefer "content". Obviously that is out of scope for this issue, but as with point three it would be useful if a follow-up issue could be filed for that.
Adding the needs followup tag for points 3 and 4.
- We recommend
- ๐ฆ๐บAustralia acbramley
Thanks @AaronMcHale!
Re 1. - This actually already is the error message (for the Authored On field at least). For other date time fields added to the content type there is no
#title
attribute on the$element
since that comes from the fieldset itself. There is no other way I can see to get the title for those fields, this should be investigated in a follow up imo as it could have large flow on affects for getting that info in there.The error messages in #80 were when using one of those custom fields (i.e a Date time field added to the Article content type). When testing the Authored on field, it shows correctly:
The problem with the title is already a bug in the current error message as well. Since this issue is just about removing the format I think that should be moved to a follow up.
I've removed the title attributes per #84.2.
So looks like we need 3 follow ups?
1. Improve Datetime validation to be specific to Date or Time input
2. Improve Authored On description (fwiw this is manageable using base field overrides although most people wouldn't be interacting with that system.
3. Add field title to Datetime validation error for configurable datetime fields. - Status changed to Needs review
almost 2 years ago 11:13pm 19 March 2023 - ๐ฌ๐งUnited Kingdom AaronMcHale Edinburgh, Scotland
@acbramley Thanks for the reply.
The text that is being proposed is
[field_name] value is incorrect. Enter a valid date and time.
, which is different from what is in the patch in this issue. Note that we have specifically removed the word "invalid".We probably then should have a follow-up issue to, as you say, remove the title attribute on the fieldset.
- ๐ฆ๐บAustralia acbramley
So it would be
Authored on value is incorrect. Enter a valid date and time
? Honestly that reads much worse than what's there currently to me.To be clear - it's not a title attribute on the fieldset. When a non-base date field is rendered on the form it is wrapped in a fieldset. That fieldset contains the field's label in its legend, it is not a label on the element passed in (i.e not in
$element['#title']
. Therefore it is not possible to include that label in the error message (that I can see) - Status changed to Needs work
over 1 year ago 9:50pm 6 May 2023 - ๐บ๐ธUnited States smustgrave
Not 100% sure what needs accessibility review. If general direction can be pointed out I'm not the worst 508 tester.
Moving to NW for all the follow up tickets being discussed. - ๐ฆ๐บAustralia Nadim Hossain
Because of the recent changes in 10.1.x, the patch in #85 does not get applied. So just re-rolling it to be compatible with 10.1.x
- last update
over 1 year ago 29,435 pass, 2 fail - Status changed to Needs review
over 1 year ago 7:57am 30 June 2023 - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 29,560 pass, 2 fail The last submitted patch, 93: 2791693-93.patch, failed testing. View results โ
- Status changed to Needs work
over 1 year ago 10:42pm 2 July 2023 - ๐ฆ๐บAustralia acbramley
+++ b/core/lib/Drupal/Core/Datetime/Element/Datetime.php @@ -374,7 +369,7 @@ public static function validateDatetime(&$element, FormStateInterface $form_stat + $form_state->setError($element, t('The %field date is invalid. Please enter a date in the valid format.', ['%field' => $title]));
Why has this changed from "in the correct format" to "in the valid format"? Please also post interdiffs with your changes and reasoning behind them.
- Status changed to Needs review
over 1 year ago 9:16am 26 July 2023 - last update
over 1 year ago Patch Failed to Apply - ๐บ๐ฆUkraine nginex
I've fixed an issue in tests. Here is a patch to review.
- last update
over 1 year ago CI aborted - last update
over 1 year ago 29,447 pass, 2 fail - last update
over 1 year ago Custom Commands Failed - ๐บ๐ฆUkraine nginex
D11 patch where Datetime::formatExample() was completely removed
- last update
over 1 year ago 29,875 pass, 2 fail - ๐บ๐ฆUkraine nginex
"Please" is a forbidden word, so here is a new patch for D11
The last submitted patch, 97: 2791693-d10-97.patch, failed testing. View results โ
The last submitted patch, 99: 2791693-d11-99.patch, failed testing. View results โ
- last update
over 1 year ago 29,447 pass, 1 fail - last update
over 1 year ago 29,447 pass, 2 fail - ๐บ๐ฆUkraine nginex
Ok, need to upload test only patch + a full patch
The last submitted patch, 102: 2791693-d10-102-TEST-ONLY-FAIL.patch, failed testing. View results โ
The last submitted patch, 102: 2791693-d10-102.patch, failed testing. View results โ
- last update
over 1 year ago 29,447 pass, 2 fail - last update
over 1 year ago 29,447 pass, 1 fail - last update
over 1 year ago 29,453 pass - ๐บ๐ฆUkraine nginex
Ah, there was issue in the test, I did some cleanup, should be good now
The last submitted patch, 105: 2791693-d10-105-TEST-ONLY-FAIL.patch, failed testing. View results โ
- last update
over 1 year ago 29,879 pass - last update
over 1 year ago 29,873 pass, 1 fail The last submitted patch, 107: 2791693-d11-107-TEST-ONLY-FAIL.patch, failed testing. View results โ
- Status changed to Needs work
over 1 year ago 8:48pm 21 August 2023 - ๐บ๐ธUnited States smustgrave
IS mentions Deprecate DateTime::formatExample but didn't see in the patch
Also was previously tagged for follow ups have those been opened?
- ๐บ๐ฆUkraine nginex
Hi @smustgrave,
Patch #105 for drupal 10 has a deprecation.
Patch #107 for drupal 11 does not have deprecation because the method was completely removed.Am I missing something?
- ๐บ๐ธUnited States smustgrave
11.x is the current development branch that D10 releases will be cut from. So the deprecation needs to be included.
- Status changed to Needs review
over 1 year ago 1:02pm 22 August 2023 - last update
over 1 year ago 30,056 pass - ๐บ๐ฆUkraine nginex
@smustgrave thanks, I missed that momoment, here is updated patch.
- Status changed to Needs work
over 1 year ago 9:42pm 22 August 2023 - ๐บ๐ธUnited States smustgrave
There were a number of follow ups being discussed in 84-88 have those been opened?
- Status changed to Needs review
over 1 year ago 10:39pm 22 August 2023 - ๐ฆ๐บAustralia acbramley
Follow ups created
๐ [PP1] Improve Datetime validation to be specific to Date or Time input Active
๐ Improve Authored On description Active
๐ Add field title to Datetime validation error for configurable datetime fields Active - ๐ฆ๐บAustralia acbramley
Needs accessibility review was added a long time ago (talked about PHP and JS changes which doesn't apply anymore), I don't feel like this new solution needs that anymore. It's also been through a usability review already.
- Status changed to Needs work
over 1 year ago 2:45pm 25 August 2023 - ๐บ๐ธUnited States smustgrave
Thanks @acbramley for cleaning those tags up!
Everything looks good but can deprecation be updated for 10.2 vs 10.1 please.
Then think it's good to RTBC!
- First commit to issue fork.
- last update
over 1 year ago 30,058 pass - @rpayanm opened merge request.
- Status changed to Needs review
over 1 year ago 6:15pm 25 August 2023 - Status changed to RTBC
over 1 year ago 5:42pm 26 August 2023 - last update
over 1 year ago 30,060 pass - last update
over 1 year ago Build Successful - last update
over 1 year ago 30,130 pass - last update
over 1 year ago 30,135 pass - Status changed to Needs work
over 1 year ago 4:49am 3 September 2023 - ๐ณ๐ฟNew Zealand quietone
I'm triaging RTBC issues โ . I read the IS and the comments. I didn't find any unanswered questions or other work to do.
Thanks for making this review easy by having an up to date IS and screenshots.
Thanks for making the followup issues, #115. I think should be siblings of this one so they are easy to find and to consider the 'big picture' That is, they should have the same parent as this one.
I read the patch, not a code review.
-
+++ b/core/lib/Drupal/Core/Datetime/Element/Datetime.php @@ -389,8 +384,14 @@ public static function validateDatetime(&$element, FormStateInterface $form_stat + * @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. HTML date + * input format should not be exposed to users, as browser widgets expose + * input differently, varying by vendor, locale, device type, etc.
By practice, this is the same deprecation message as in the trigger_error. So, lets keep them the same.
@deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. There is no replacement.
-
+++ b/core/lib/Drupal/Core/Datetime/Element/Datetime.php @@ -389,8 +384,14 @@ public static function validateDatetime(&$element, FormStateInterface $form_stat + * @see https://www.drupal.org/project/drupal/issues/2791693
There should be a blank line before the @see.
-
+++ b/core/lib/Drupal/Core/Datetime/Element/Datetime.php @@ -389,8 +384,14 @@ public static function validateDatetime(&$element, FormStateInterface $form_stat + * @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. HTML date ... + @trigger_error(__METHOD__ . ' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. No replacement provided. https://www.drupal.org/project/drupal/issues/2791693', E_USER_DEPRECATED);
This is close, but does not meet coding standards, it needs 'See'. And the version needs to be updated. Also changing the middle sentence to be consistent.
is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/project/drupal/issues/2791693
+++ b/core/lib/Drupal/Core/Datetime/Element/Datetime.php @@ -5,8 +5,8 @@ +use Drupal\Core\Form\FormStateInterface;
The re-sorting is out of scope.
@rpayanm, this issue has been using a patch work flow for many years and can continue to do so. There is no need to create an MR.
Finally, removing tags per the guidelines and setting back to NW.
-
- Status changed to Needs review
over 1 year ago 10:42pm 3 September 2023 - last update
over 1 year ago 30,135 pass - last update
over 1 year ago 30,135 pass - Status changed to RTBC
over 1 year ago 8:51am 4 September 2023 - ๐ณ๐ฟNew Zealand quietone
@acbramley, thank you for making the changes.
I have reviewed the changes and read the CR and setting back to RTBC.
- ๐บ๐ธUnited States BlackBamboo Washington DC
catch โ credited BlackBamboo โ .
- ๐ฉ๐ชGermany rkoller Nรผrnberg, Germany
catch โ credited rkoller โ .
- ๐บ๐ธUnited States shaal Boca Raton, FL
- Status changed to Fixed
over 1 year ago 9:12am 4 September 2023 - ๐บ๐ฆUkraine HitchShock Ukraine
Just rerolled a patch for 9.5.11, without tests
- ๐ฌ๐งUnited Kingdom jonathan1055
@HitchShock @kavbiswa I don't think there is a plan to port this change to 10.x and 9.x? But I could be wrong.
- ๐บ๐ฆUkraine HitchShock Ukraine
Hi @jonathan1055
Sure, the solution will be released in the last Drupal version. We added these patches only for those who want to apply it to the older versions Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
about 1 year ago 10:18pm 18 December 2023 - ๐บ๐ธUnited States RichardDavies Portland, Oregon
Can someone please reroll the patch for Drupal 10.2.0?
- ๐ฆ๐บAustralia acbramley
@RichardDavies no need, the patch was committed to 11.x before 10.2.0 was released and is therefore available in 10.2.0 :)
- ๐บ๐ธUnited States RichardDavies Portland, Oregon
@acbramley Ah, thank you for the clarification. I didn't understand how the 11.x branch worked and couldn't find this item listed in any of the 10.2x release notes so I assumed it wasn't in the 10.2 release. But I've just confirmed it is indeed there.
- ๐ฌ๐งUnited Kingdom jonathan1055
Thanks @RichardDavies for confirming the fix is in 10.2. I also did not know that the commit to 11.x would be silently ported to 10.x without some commit message being shown here, or some comment from the committer. I'm sure many people knew this, but I didn't, and I always look for commit messages in the comments of the issues. Maybe I should also remember to search in the commit history of the branch.
Viewing https://git.drupalcode.org/project/drupal/-/commits/10.2.x and scrolling down we see
The commit id 5404ebfb is exactly the same as the 11.x commit so I am still unsure wheteher this was a cherry-pick or whether the 11.x branch was actually the 'same' as the 10.2.x branch back then. - ๐ณ๐ฑNetherlands Martijn de Wit ๐ณ๐ฑ The Netherlands
It is the new Drupal core branching:
https://www.drupal.org/about/core/blog/new-drupal-core-branching-scheme-... โ - ๐ฌ๐งUnited Kingdom jonathan1055
Thank you @Martijn de Wit, I knew there was something big going with branch naming, and that post explains it all.
- ๐บ๐ธUnited States paul121 Spokane, WA
I believe an unintended change was introduced with this issue. If a
timestamp
field provided a default value or default value callback, that field-level default value is no longer used as the default value in the entity form when creating a new entity. There is a check inTimestampDatetimeWidget::formElement()
to only use the field item delta value if the entity is "not new": https://git.drupalcode.org/project/drupal/-/commit/5404ebfb11155b53dee0e...A
timestamp
field with a default value might be a common use-case when the field is required (the user must provide a value) but the application would like to preset a default value to the current time for convenience. For an example see ๐ Make timestamp required Fixed - ๐ฆ๐บAustralia acbramley
@paul121 nice find, I will try and track down in this issue why that change was made.
Are you able to create a new issue with your bug report and steps to reproduce from a fresh Drupal install?
- ๐บ๐ธUnited States paul121 Spokane, WA
Thanks for the *fast* response @acbramley! I've opened a new issue ๐ Datetime_timestamp widget does not use default field value Active