Closed (fixed)
Project:
Webform
Version:
6.2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Sep 2023 at 05:05 UTC
Updated:
9 Jul 2024 at 10:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
anil thapa commentedComment #3
anil thapa commentedComment #4
kasliwal_harshit commentedTried 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.
Comment #5
jrockowitz commentedComment #6
jrockowitz commentedSo the below YAML source when pasted into a D10 6.2.x webform trigger the error
Comment #7
jrockowitz commentedI 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.
Comment #8
jrockowitz commentedComment #9
kasliwal_harshit commented@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 .
Comment #10
jrockowitz commentedComment #11
jrockowitz commentedThe error is originating from \Drupal\Component\Datetime\DateTimePlus::createFromTimestamp
Comment #12
jrockowitz commentedA 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
Comment #13
jrockowitz commentedComment #14
liam morlandThe patch applies to 6.2.x but not 6.1.x.
Comment #15
liam morlandThe 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?
Comment #16
jrockowitz commentedThe tokens are replaced via parent::prepare($element, $webform_submission).
If the tokens are NOT replaced, they are invalid, so they should be removed.
Comment #17
liam morlandOK, 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.
Comment #20
liam morlandComment #21
liam morlandComment #24
rohit tiwari commentedI 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.3
Error: 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).
Comment #25
liam morlandWhat property is causing the problem? Maybe something else needs to be added to
$date_properties.Comment #26
rohit tiwari commentedThis is the YML causing issue:
Specifically this token: [webform_submission:values:publish_date]
Comment #27
jrochate commentedI'm also having this problem:
webform 6.2.x
drupal 10.3
I think the best is to use raw as should result in an UNIXTIMESTAMP.
But I'm getting the error:
Is it impossible to reference previous submissions fields on this validation rule?
Can't find out the limitation. TIA