This happens with the following modules:

Field Label Plurals

:

If I change any options on this page and save. The page seems to refresh and nothing has changed. If I redo changes and save, I get the following truncated error:

Fatal error: Call to undefined function date_field_widget_settings_form_validate() in .../drupal/includes/form.inc on line 1389

I'm not sure where to start troubleshooting this. I've removed all date fields, uninstalled date and calendar and reinstalled, etc. and am still getting the same error. Using Drupal 7.14.

Field Display Label

:

#1889544: Date field incompatible? Error when saving field....

Fatal error: Call to undefined function date_field_widget_settings_form_validate() in /home/public_html/includes/form.inc on line 1406

I tried to save a date field with a different display label. Cause the error above. Something I did wrong?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jon Betts’s picture

OK, after a few days of rebuilding and applying modules one-by-one, it appears that the problem occurs when activating the "Field label plurals" module. Feel free to remove this issue or keep it around in case someone else has the same issue. I'll post an issue, if needed in the Field label plurals module issuse queue as well.

KarenS’s picture

Title: Fatal Error (undefined function date_field_widget_settings_form_validate()) when saving date field edit settings » Fatal Error (undefined function date_field_widget_settings_form_validate()) when using Field Label Plurals module
Status: Active » Closed (works as designed)

Glad you figured that out. Let's close this issue, but I'll re-name it so people can find it.

Niklas Fiekas’s picture

Alright. I debugged it and found the problem: Date module is lazy loading the validation handlers, even if it shouldn't do it that way.

Scenario:

  1. Date module is asked to build the form with some #element_validate entries. It includes date_admin.inc that has the validation handlers.
  2. Field label plurals adds some ajax to the form.
  3. The user triggers an ajax request.
  4. FAPI is executing #element_validate handlers, but since this is a new request date_admin.inc has not been included.

Instead Date module should keep its promise to FAPI and have the validation handlers around. Form builder available <=> validation handlers available.

Here's a patch that would solve this by moving the validation handlers next to the form builder stubs.

Status: Closed (works as designed) » Needs work

The last submitted patch, 1699312-element-validation-handler-loading-3.patch, failed testing.

Niklas Fiekas’s picture

Status: Needs work » Needs review

(Test failures look unrelated.)

gmclelland’s picture

I ran into the same error. The patch in #3 applied cleanly for me and I don't see any more errors when I created the date field.

Hope that helps

GaëlG’s picture

Version: 7.x-2.5 » 7.x-2.6
Status: Needs review » Reviewed & tested by the community

Works for me too.

arlinsandbulte’s picture

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1699312-element-validation-handler-loading-3.patch, failed testing.

pounard’s picture

Status: Needs work » Needs review
FileSize
1.17 KB

Here is an updated working patch (at least for the fatal I got) hope this helps.

Status: Needs review » Needs work

The last submitted patch, 1699312-10-date_field_validate_fatal.patch, failed testing.

pounard’s picture

Status: Needs work » Needs review
FileSize
1.17 KB

Normal, I did a stupid stupid typo error, uploading new one!

pounard’s picture

As a side note, this does not only do a fatal when using the Field Label Plurals module, we experienced it without.

Status: Needs review » Needs work

The last submitted patch, 1699312-12-date_field_validate_fatal.patch, failed testing.

markabur’s picture

I applied #12 to Date 2.6 and it took care of the error for me.

mcabalaji’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 12: 1699312-12-date_field_validate_fatal.patch, failed testing.

The last submitted patch, 12: 1699312-12-date_field_validate_fatal.patch, failed testing.

klonos’s picture

Title: Fatal Error (undefined function date_field_widget_settings_form_validate()) when using Field Label Plurals module » Fatal error: Call to undefined function date_field_widget_settings_form_validate() in form.inc
Issue summary: View changes
Related issues: +#1889544: Date field incompatible? Error when saving field....

This seems to be a more generic issue that happens with other modules as well. One example is Field Display Label. Updated the issue summary to include it as an example and the issue title to be more generic.

gmclelland’s picture

Status: Needs work » Needs review
FileSize
1.17 KB

Here is a reroll of #12

Status: Needs review » Needs work

The last submitted patch, 20: 1699312-20-date_field_validate_fatal.patch, failed testing.

gmclelland’s picture

Here is a reroll of #3

gmclelland’s picture

Status: Needs work » Needs review

And back to NR

Status: Needs review » Needs work

The last submitted patch, 22: 1699312-21-element-validation-handler-loading.patch, failed testing.

gmclelland’s picture

Well that sucks, anybody know why the patches are failing?

Katrina B’s picture

The "Field Label Plurals" module does seem to be the culprit. If I disable it -- no error. If I enable it and try to edit a date field -- error. Unfortunately, I need the plurals module; the only temporary solution seems to be to disable (deactivate) the plurals module, modify the date field, then reactivate (re-enable) the plurals module.

Not a great solution -- but one that works (for now).

pounard’s picture

The "Field Label Plurals" module does seem to be the culprit.

Got the error without.

hyscaler’s picture

This also appears for Multivalue Settings module.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 22: 1699312-21-element-validation-handler-loading.patch, failed testing.

netlooker’s picture

Version: 7.x-2.6 » 7.x-2.x-dev
Status: Needs work » Needs review
FileSize
31.69 KB

I've tried to resolve this issue today. I've checked latest patch and I was able to apply it without problems. What I've done is just a moving of helper functions witch were related to the form stuff.

pfrenssen’s picture

Status: Needs review » Reviewed & tested by the community

For me this bug occurs when altering the date field instance form and introducing AJAX. When the AJAX response is generated only date.field.inc is loaded which contains the main date_field_instance_settings_form. For some bizarre reason the form validate handler and some helper functions that are uniquely used in this form are located in a different file date_admin.inc which is not included in this page request.

I reviewed the patch. It solves the issue responsibly. Not a single line of code is changed, it just moves the validate handler and helper functions into the right file.

Plazik’s picture

#31 works for me.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 31: 1699312-29-element-validation-handler-loading.patch, failed testing.

Morasta’s picture

This is also a problem with the Required by role module. Ran the patch in #31 against date 2.8 and it solved the problem.

esmitex’s picture

I have the same issue:

Fatal error: Call to undefined function date_field_widget_settings_form_validate() in /homepages/5/d578771729/htdocs/smq/includes/form.inc on line 1465 

but i don't have the fields plural plugin.

azinck’s picture

Re-rolled. But not a strict re-roll. I just touched the validation functions and instead of moving them to date.field.inc entirely, I just followed the pattern set forth for the form-building methods (so as to limit amount of code included).

leendertdb’s picture

Status: Needs review » Reviewed & tested by the community

We also had the same problem, but the field plural module was not installed. So I'm assuming this bug can have multiple different causes.

The patch from #38 works perfect and solves the "Fatal error: Call to undefined function date_field_widget_settings_form_validate()" error for us. Thanks all!

Updating status to RTBC. Can we get this committed please?

  • podarok committed 4a2dc35 on 7.x-2.x authored by azinck
    Issue #1699312 by gmclelland, pounard, Niklas Fiekas, azinck, netlooker...
podarok’s picture

Status: Reviewed & tested by the community » Fixed

#38 is merged. Thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.