- Issue created by @Anil Thapa
- 🇮🇳India kasli_harshit
Tried to reproduce the issue getting the same error (The timestamp must be numeric.) while working with D10 and webform 6.2.0-beta6 .
However when i tried to reproduce the same in D9 and with webform 6.1.4 though we are able to save the webform fields and condition without any error . however we are not getting the desired result .Follow the same steps as mentioned in the issue with D9 and webform 6.1.4 , Set the page2 date field min value to date1 field value using (([webform_submission:values:date1_field_name]) . Now when we try to submit the response , the date validation for date2 is checking min value against the submission date of webform(today) instead of the date1 field value which is not the ideal behaviour.
Adding the screenshot for the same.
- 🇺🇸United States jrockowitz Brooklyn, NY
So the below YAML source when pasted into a D10 6.2.x webform trigger the error
page_01: '#type': wizard_page '#title': page_01 date_01: '#type': date '#title': date_01 page_02: '#type': wizard_page '#title': page_02 date_02: '#type': date '#title': date_02 '#date_date_min': '[webform_submission:values:date_01]'
- 🇺🇸United States jrockowitz Brooklyn, NY
I was not able to track down the root cause of the regression but the attached patch is reasonable and safe fix to immediate issue and is unlikely to cause additional regressions.
- Status changed to Needs review
about 1 year ago 12:26pm 3 October 2023 - last update
about 1 year ago 535 pass - 🇮🇳India kasli_harshit
@jrockowitz i tried to applied the patch(#7) , after applying the patch although we are successfully able to save webform with the conditions on the date field , however we are still getting same error now upon submission of the webform. Attaching the screenshot for reference .
- Status changed to Needs work
about 1 year ago 5:57pm 3 October 2023 - 🇺🇸United States jrockowitz Brooklyn, NY
The error is originating from \Drupal\Component\Datetime\DateTimePlus::createFromTimestamp
- 🇺🇸United States jrockowitz Brooklyn, NY
A slightly better approach where all invalid element date properties will unset. This approach can be used to prevent other date-related regressions.
This patch should also be applied to 6.1.x
- Status changed to Needs review
about 1 year ago 11:21am 4 October 2023 - last update
about 1 year ago Patch Failed to Apply - last update
about 1 year ago Composer require failure - last update
about 1 year ago 536 pass - last update
about 1 year ago Patch Failed to Apply - last update
about 1 year ago Patch Failed to Apply - 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
The patch will stop the "timestamp must be numeric" errors. But is this field supposed to be able to support tokens? Should it set an error message when it encounters an invalid value in one of the four properties that it checks?
- 🇺🇸United States jrockowitz Brooklyn, NY
The tokens are replaced via parent::prepare($element, $webform_submission).
If the tokens are NOT replaced, they are invalid, so they should be removed.
- 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
OK, so you're saying that any valid tokens will have already been replaced? That makes sense. In that case, this patch makes sense to me.
-
Liam Morland →
committed 9deee07a on 6.1.x authored by
jrockowitz →
Issue #3388424 by jrockowitz, Liam Morland: Ensure timestamps are...
-
Liam Morland →
committed 9deee07a on 6.1.x authored by
jrockowitz →
-
Liam Morland →
committed 9deee07a on 6.2.x authored by
jrockowitz →
Issue #3388424 by jrockowitz, Liam Morland: Ensure timestamps are...
-
Liam Morland →
committed 9deee07a on 6.2.x authored by
jrockowitz →
- Status changed to Fixed
about 1 year ago 9:53pm 6 October 2023 -
Liam Morland →
committed 9deee07a on 6.x authored by
jrockowitz →
Issue #3388424 by jrockowitz, Liam Morland: Ensure timestamps are...
-
Liam Morland →
committed 9deee07a on 6.x authored by
jrockowitz →
Automatically closed - issue fixed for 2 weeks with no activity.
- 🇮🇳India Rohit Tiwari
I am getting the same issue still on same scenario as mentioned in the issue summary.
My setup is:
Drupal: 9.5.8
Webform: 6.2.3Error: InvalidArgumentException: The timestamp must be numeric. in Drupal\Component\Datetime\DateTimePlus::createFromTimestamp() (line 201 of /mnt/www/html/trimedcmsej6ddn8fnr/docroot/core/lib/Drupal/Component/Datetime/DateTimePlus.php).
- Status changed to Fixed
5 months ago 3:59pm 5 July 2024 - 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
What property is causing the problem? Maybe something else needs to be added to
$date_properties
. - 🇮🇳India Rohit Tiwari
This is the YML causing issue:
published_dates: '#type': flexbox publish_date: '#type': datetime '#title': 'Publish Date' '#date_date_min': TODAY '#date_date_format': '' '#date_time_format': '' '#date_time_step': '60' '#required': true unpublish_date: '#type': datetime '#title': 'Unpublish Date (if any)' '#date_date_min': '[webform_submission:values:publish_date]' '#date_date_format': '' '#date_time_format': '' '#date_time_step': '60'
- 🇵🇹Portugal jrochate
I'm also having this problem:
webform 6.2.x
drupal 10.3data_evento_inicio: '#type': datetime '#title': 'Data do Evento' '#title_display': inline '#required': true '#format': simple_datetime_alt '#date_year_range': '' data_evento_fim: '#type': datetime '#title': Fim '#title_display': inline '#required': true '#date_min': '[webform_submission:values:data_evento_inicio:raw]' '#format': simple_datetime_alt '#date_year_range': ''
I think the best is to use raw as should result in an UNIXTIMESTAMP.
But I'm getting the error:
Unable to render elements, please view the below message(s) and the error log.
The timestamp must be numeric.
Is it impossible to reference previous submissions fields on this validation rule?
Can't find out the limitation. TIA