Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I use a date field, I get errors:
Warning: Illegal string offset 'month' in form_process_date() (line 2975 of /srv/www/drupal/includes/form.inc).
Warning: Illegal string offset 'day' in form_process_date() (line 2975 of /srv/www/drupal/includes/form.inc).
Warning: Illegal string offset 'year' in form_process_date() (line 2975 of /srv/www/drupal/includes/form.inc).
The date component has nothing unusual. I used today as the default date.
Comments
Comment #1
tjtj CreditAttribution: tjtj commentedRemoving today fixes this, but I am supposed to be able to use GNU date designators.
Comment #2
quicksketchI can't confirm this problem. A new release came out today, could you check if it still exists in beta2? I set up a new date component using "today" as the default value and it works as expected, with no warnings or notices.
Comment #3
sfcamil CreditAttribution: sfcamil commentedWebform 7.x-3.20+9-dev
Same problem using
Warning: Illegal string offset 'day' in form_process_date() (line 2975 of xampp\htdocs\asmt\includes\form.inc).
Warning: Illegal string offset 'month' in form_process_date() (line 2975 of xampp\htdocs\asmt\includes\form.inc).
Warning: Illegal string offset 'year' in form_process_date() (line 2975 of xampp\htdocs\asmt\includes\form.inc).
But the date is correctly inserted in form !
all the fields date in config was changed to d-m-Y
Comment #4
quicksketch@sfcamil: When setting a #default_value, it needs to be specified as an array:
Webform does the conversion from a string for you from the UI options. If you're form altering the form, you have to use the more explicit array-based format.
Comment #5
quicksketchSeems like this is fixed. It was a custom coding problem anyway, which is outside our issue queue scope.