Fatal error: Call to undefined function commerce_registration_registration_settings_form_validate() in /home/.../public_html/devsite/includes/form.inc on line 1432

I received the above message on a white page after saving my product. I had just checked the Enable Registrations box and saved.

Please help me determine what may have caused this.

Thank you.

Comments

jpontani’s picture

Status: Active » Postponed (maintainer needs more info)

I'm unable to reproduce this error. If you can provide steps on how you got to that error, I can look into what's causing it.

Loube’s picture

StatusFileSize
new151.85 KB
new143.63 KB
new183.98 KB

I installed Drupal Commerce 7.x-1.2+10-dev and created my Product Type and added Products. I installed Entity Registration7.x-1.0-alpha3 and Commerce Registration 7.x-2.0-alpha2+0-dev.

I read the README for Entity Registration and created a Registation Type. See RegType_Loube.png.

I read your instructions and since I already had a product type and products. I went ahead and added my registration type "Online Program Registration" to my product type. See ProductTypeWithRegisTypeAdded_Loube.png.

And since I had previously created products for that product type, I edited my product and found the newly added registrations settings. I selected "Enable Registrations" and saved. See AddProduct_Loube.png

The first time I saved it the page seemed to just refresh and bumped me back to the "Enable Registrations" not being checked. So I tried to enable again and saved. That is when I get the Fatal Error message.

So then I tried to create a new product instead of editing an existing one, but the same thing happened.

jpontani’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new889 bytes

Try this patch and see if it works. Force including the registration forms include file since we use their validation handler. FYI this patch is for the latest commit, so it won't be available as a tar file yet. You'll have to grab it from the repo.

Status: Needs review » Needs work

The last submitted patch, commerce_registration-1483136-3-fix_validation.patch, failed testing.

Loube’s picture

Since the patch failed testing, should I try it anyway or do you think there is another avenue for this to be resolved?

jpontani’s picture

Status: Needs work » Needs review

Just grab the latest commit (414b544). I added some other changes in that should make things work all around better. The patch failed because it was testing it against alpha2, but the patch was for the latest commit (dev branch basically).

Loube’s picture

I have never used git before so I had to install it and figure out how to use it to apply the patch to the 7.x-2.0-dev.

This is the message I got when I tried to apply the patch.

fatal: corrupt patch at line 16

Loube’s picture

More info:

I typed this:

git apply -v commerce_registration-1483136-3-fix_validation.patch

After which came this message:

commerce_registration-1483136-3-fix_validation.patch:11 trailing whitespace.
if (!function_exists("registration_registrations_settings_form_validate')) {
commerce_registration-1483136-3-fix_validation.patch:12 trailing whitespace.
module_load_include('inc', 'registration', '/includes/registration.forms');
commerce_registration-1483136-3-fix_validation.patch:13 trailing whitespace.
}
fatal: corrupt patch at line 16

jpontani’s picture

All you need to run in git is just:

git clone --branch 7.x-2.x http://git.drupal.org/project/commerce_registration.git

Once you do that, it will download the files into a new directory "commerce_registration" in whatever directory you are working in. Then just copy the directory to your server (you can ignore the .git folder) and that will be the latest committed files I have.

Loube’s picture

Does the branch 7.x-2.x already has the patch applied to it? I assumed it did so I used git with your instructions, then uploaded it to my server site/all/modules/commerce_registrations. I updated too. But I still have the error message.

jpontani’s picture

Yes, the 7.x-2.x branch has the fix.

Make sure you have the latest version of Entity Registrations as well (alpha4).

Loube’s picture

I updated to Entity Registrations alpha 4. But the same problem.

I have been trying to get this to work on a previously created Product Type. One that I made before installing registration et al. Maybe this is why I am having this problem.

To see if this was the case I created a brand new Product Type and I was able to add a new product without the error message. I went on to create the product display and go through check out until I got to the registration page. It all seems to be fine. I am very glad to have this working. I appreciate your help with this issue.

To have this work though, I guess I will have to re-create all my products in a newly created product type. Unless I can see if there is a way to transfer them all to the new product type.

jpontani’s picture

Status: Needs review » Postponed (maintainer needs more info)

I'll test this tomorrow and see if it's something in my code.

Leaving this as postponed for now until I can get more info on what's causing it.

Andrei Tyuhai’s picture

I've got exactly the same error.

mrfelton’s picture

Version: 7.x-2.0-alpha2 » 7.x-2.x-dev

Very similar problem here:

Fatal error: Call to undefined function registration_registrations_settings_form() in /Users/tom/workspace/concern7/profiles/concern/modules/contrib/commerce_registration/includes/commerce_registration.forms.inc on line 38

This is with registration-7.x-1.0-beta1 from yesterday, and latest git code of commerce_registration. This happens when trying to access node/[nid]/registrations/settings. WSOD.

mrfelton’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new5.72 KB

Looks like Registration has changed the name and signature for those form functions. Patch updated commerce_registration to work with latest registration beta1

jpontani’s picture

Patched in the latest commit. Doesn't show I committed it as I just reinstalled pretty much my entire computer and forgot to setup my git configs.

jpontani’s picture

Status: Needs review » Fixed

Going to set as fixed for now. If the issue comes up again just reopen.

Status: Fixed » Closed (fixed)

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

mrconnerton’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new3.62 KB

I am using latest dev version of commerce_registration and I have this problem as well. It seems that not all of this patch got in and I was getting the same errors.

Here is the patch I created that works for me.

dave bruns’s picture

Same problem. I downloaded the latest release of dev (7.x-2.x-dev) applied the patch in #20, but still get the same error when trying to enable registrations in the product:

Fatal error: Call to undefined function commerce_registration_registration_settings_form_validate() in site/includes/form.inc on line 1443

Registration 7.x-1.0-beta2
Commerce Registration Integration, 7.x-2.0-beta1+1-dev (patched with #20)

Let me know if there is any other info I can provide.

rerooting’s picture

Works fine for me. I cloned the latest 7.x-2.x branch and applied the patch in #20 with no problems, and verbose output saying that it was cleanly applied. I have yet to do exhaustive testing, but all seems well!

rerooting’s picture

Update: Fully tested and it works fine with this patch. This is such a great module! The possibilities that this module and registration provide are veritably endless! I was going to do all this custom with rules, views, etc. but this approach saved me tons of time. Thanks so much!

dave bruns’s picture

This is driving me a little crazy. I think the problem (#21) I'm seeing stems from the syntax of the module_load_include calls in commerce_registration.module on line 372 and 375, which preface the includes directory with "/", e.g.:

      if (!function_exists("registration_entity_settings_form")) {
        module_load_include("inc", "registration", "/includes/registration.forms");
      }

If I force load these files at the start of the module without the "/":

module_load_include('inc', 'registration', 'includes/registration.forms');
module_load_include('inc', 'commerce_registration', 'includes/commerce_registration.forms');

I don't see the undefined function error(s). I'm on a Mac, which might explain why not everyone sees the problem (?)

However, I do get a different error now after saving a product with an attached registration field:

Notice: Undefined index: reminder in registration_entity_settings_form_validate() (line 562 of /sites/all/modules/registration/includes/registration.forms.inc).

Not sure if this is related or not.

jpontani’s picture

This should be fixed in the latest commit. I removed all the initial backslashes on all module_load_include calls so that should be fixed. I also fixed the settings form so the Undefined Index error is gone.

dave bruns’s picture

OK, I pulled the latest commits from dev, and re-tested. The errors I reported in #24 are gone. Excellent.

However, I now get a new error during checkout when moving from Shipping to Review:

EntityMetadataWrapperException: Unknown data property commerce_product. in EntityStructureWrapper->getPropertyInfo() (line 339 of /sites/all/modules/entity/includes/entity.wrapper.inc).

In limited testing, this seems to happen only when there has been some shipping rate applied. I can do some more testing with different kinds of products tomorrow. Let me know if you want me to open this in a new issue.

Also - I notice that the patch in #20 above is not in dev - not sure it it should be or not, but just wanted to mention it.

jpontani’s picture

Status: Needs review » Fixed

The exact patch is not in dev, but the issues it addresses are fixed in dev currently.

The Exception you're getting is most likely due to a line item check. Going to mark this as fixed and open a new issue with that error.

dave bruns’s picture

@jpontani - I was testing #1601268: commerce_product metadata property doesn't exist on all line items again, and started to run into the undefined function error again today. I cleaned up some references to form function signatures that have changed, added 'reminder' into the product ui form, and ended up changing module_load_include to form_load_include inside commerce_registration_form_alter. I'm not sure if this is related to caching or not, but this was the only I could resolve the undefined function error, without just forcing commerce_registration.forms.inc to load.

Things are working well for me now, except for the path error mentioned in 1601268.

Please review the patch carefully and use only what makes sense to you.

dave bruns’s picture

Status: Fixed » Needs review

Just switching status to needs review.

jpontani’s picture

Status: Needs review » Fixed

Everything looked fine. I changed a few extra calls that were not part of your patch to use form_load_include as well, as they are part of forms. Wanted to make sure the include loading is consistent with forms, so hopefully this resolves any form caching issues. Pushed in the latest commit (42e674a).

I messed up the git commit attribution, figures :/

Status: Fixed » Closed (fixed)

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

DocDJ-forum’s picture

Issue summary: View changes

I just downloaded the Kickstart (full pkg with Core). I already had PHP, MySQL & Apache (on Windows x64) running with an active website. After many required changes to php.ini, I finally got to "configure site" and got the error message noted in this forum:
Fatal error: Call to undefined function commerce_currencies() in
E:\DJs Documents\public_html\drupal\profiles\commerce_kickstart\commerce_kickstart.install on line 240

Since I have no products, (this is a NEW Drupal-commerce site), I don't know if the suggested patch is relevant (now that 2 years have gone by, I assume the patch is part of the distributed code). Any ideas what I can try? I am new to Drupal, PHP, MySQL, Commerce and Kickstart. (But I AM a programmer & have built queries and DBs with MS Access). I did create a simple DrupalGardens site I hope to add to Commerce.

Regards,
DJ