Closed (fixed)
Project:
Variable
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
12 Sep 2012 at 18:07 UTC
Updated:
24 Oct 2017 at 01:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
villette commentedI think this patch should do the trick
Comment #2
mavaddat commentedI can confirm that this fixes the problem. Thank you villette!
Comment #3
iva2k commentedI stumbled upon this problem in a different module (settings page with multilingual variables) and patch in #1 solves the issue.
form_load_include() is a fairly recent drupal 7 addition and all form-related (i.e. submit, validate) functions contained in non .module files need to be loaded using form_load_include().
RTBC.
Also I did a quick code review, and found module_load_include('form.inc', ...) in few places where it most likely also need to be changed to form_load_include():
file variable.module: functions variable_edit_form(), variable_edit_subform()
file node.variable.inc: function node_variable_type_subform()
file variable_admin.inc: function variable_admin_realm_edit()
file variable_realm.module: function variable_realm_form_system_theme_settings_alter()
I have no test cases to verify if it breaks anything, but I'm pretty sure it will find ways to screw things up in unexpected ways. Maintainers, please review code in those and make corrections as needed.
Comment #4
iva2k commentedHere's a patch including other locations that should be changed to form_load_include() for sure.
Someone from maintainers need to review code in other places mentioned in #6:
Comment #5
HydroZ commentedThis patch solved it for me. I applied it to Version 7.x-2.2 an it works as well.
Comment #6
tengokuI'm reporting that this patch also works for me on 7.x-2.2, updating the issue to this version. thanks
Comment #7
Anticosti commented#4 worked for me too.
Much appreciated. Thanks!
Comment #8
jomarocas commentedhey this work fine, this solutions of the bug
Comment #9
bforchhammer commentedCommitted #4. Thanks for patch and reviews!
Comment #11
lmeurs commentedThanks!
Comment #12
pratik60 commentedAfter trying to save a variable with managed file, I get this bug.
Call to undefined function variable_form_submit_callback() in /webapps/d7/includes/form.inc on line 1513
Are we sure this is fixed or am I missing something?
Comment #13
lykyd commentedI'm experiencing this error with Variable 7.x-2.5 and Variable File 7.x-1.x-dev, that implement the patch #4.
I'm implementing variables in a hook_variable_info().
Using a "file_upload" type won't give any error, but changing it to "file_managed" gives me a white screen with the error :
PHP Fatal error: Call to undefined function variable_form_submit_callback() in /www/mysite.fr/site/includes/form.inc on line 1520, referer: http://mysite.local/admin/mysite/settings
Setting the localize parameter to false does fix the issue but prevent me from having two different files for each language.
Comment #14
geek-merlin#12, #13: YES this zombie returned from its grave. Exorcising it in #2918293: Call to undefined funtion when form is saved (eg managed file).