* create a form with multistep.module, required date field in step1
* proceed to step 2 and submit
* required date field fails to validate: "Field foodate required" - all other required fields play fine

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

geek-merlin’s picture

first error is "@field_name From date value #@delta" coming from date_combo_element_process()@date_elements.inc:283

second error is "!name field is required.", so this is not thrown by date_field_validate() but probably by _form_validate()@form.inc:1321...
yes, indeed: we find no elements['#value'] there...

edit: later on we get "Field %field is required." coming from date_popup_validate()@date_popup.module:392

geek-merlin’s picture

hmm, this might be #408770: #access of date_combo fields prevents validation, but porting this (unported!) trivial patch does not solve the problem.
it's also not #749874: #access=FALSE results in 'The dates are invalid' upon submission.

geek-merlin’s picture

so editing an existing node.

in both steps we have correct form-default-values,
but at validate time we have formstate-value NULL in step2

jover’s picture

I have a similar problem with a custom multistep node form, several date fields spread over several steps.
Receiving many errors after clicking next (to proceed to another step), dates aren't saved after clicking the submit button and the date popup doesn't work on any of the date fields (javascript?)...

Everything seems to be working fine in my multistep form, except the date fields.

Date combo process-patch does not work for Date D7.

geek-merlin’s picture

Status: Active » Needs work
FileSize
9.87 KB

this is wip, but works in our project.
so if you are interested, i'll share early so you can help test.

right now it only works for date combo, because in date_combo_value_callback() i cannot see how to get the format to use, so i hardcoded it for our project (it's the date->format lines), but this will not workfor other widgets.

maybe @karen may give a hint here?

HnLn’s picture

sub

peem83’s picture

patch #5 works for me :)

KarenS’s picture

That patch has elements of several different patches, including two I just committed. I can't evaluate a patch with that much unrelated stuff in it, please try again to create a patch that only has the fix for this problem.

KarenS’s picture

Status: Needs work » Postponed (maintainer needs more info)
KarenS’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

No response, so I can't do anything with this.

jover’s picture

j0rd’s picture

Same problem and it looks like Axel (#4) is writing code which is very similar to what I've been working on.

For those looking for information related to #access = FALSE and $form_state['input'] vs. $form_state['values'] take a look at the documentation here: http://api.drupal.org/api/drupal/includes--form.inc/function/form_builder/7

Additionally I have created a very similar bug which is related to this:
#1304344: Date values cleared, instead of saved when updating a node when $form['myfield']['#access'] = FALSE

jayson13’s picture

I am having this issue with date in my multistep form. I am using latest 7.x-2.x-dev version but i still having this error. What is the best work-around?

Thanks!

jayson13’s picture

FileSize
59.17 KB
42.86 KB
92.59 KB

This is how to reproduce the problem. Add a multistep form with step 1 contains Title Field and a Date field (calendar pop up, requires an end date). Step 2 contains 1 text area.

You will see error "The value input for field Start Date is invalid" and also "The value input for field End Date is invalid"

I have attached the screenshots for my settings.

Thanks!

bmango’s picture

I am having a similar problem when I use date fields and the Multistep module. It happens when a date field is placed in a Multistep fieldset. It looks like I'm going to have to stop using the Multistep module.

gaurav_varshney’s picture

Issue summary: View changes
Status: Closed (won't fix) » Active

Not Working

DamienMcKenna’s picture

Status: Active » Needs work