Problem/Motivation
Attempt to access a webform submission containing a dropzonejs field results in the following error
Error: Call to undefined function template_preprocess_webform_element_managed_file() in template_preprocess_webform_element_dropzonejs() (line 31 of modules/contrib/dropzonejs_webform/webform_dropzonejs.module).
Steps to reproduce
1. Complete a webform containing a dropzonejs field.
2. Attempt to access the submission at /admin/structure/webform/manage/{webform_id}/results/submissions
3. Encounter error.
Proposed resolution
Find out why the 'undefined function' which is defined in the webform module is not being recognised. Increasing the weight of the webformdropzone_js module in the core.extension.yml to ensure the webform module is implemented first solves this error.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 3413530_fix_call_to_undefined_function_5.patch | 1.24 KB | jorisclaes |
Issue fork dropzonejs_webform-3413530
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
sabrina.liman commentedComment #3
sabrina.liman commentedComment #4
anouar louedziane commentedI had the same issue in my project:
Attempting to access a webform submission containing a dropzonejs field results in the following error.
Error: Call to undefined function template_preprocess_webform_element_managed_file() in template_preprocess_webform_element_dropzonejs() (line 13 of /modules/contrib/webform_dropzonejs/includes/webform_dropzonejs.theme.template.inc).
The issue is due to this deprecated function module_load_include, using the ModuleHandler::loadInclude() instead seems to resolve the issue for me.
FI: https://www.drupal.org/node/2948698
Comment #5
damondt commentedThis is also addressed in the larger D10 compatibility issue https://www.drupal.org/project/webform_dropzonejs/issues/3299484
Comment #6
damondt commentedComment #7
fotispanThis is not a duplicate.
The issue reported by @damondt refers to the module "webform_dropzonejs" and not "dropzonejs_webform"
Changing issue status to "Needs review"
Comment #10
johnlutzI created an mr with the changes #4 and added them to the .module file. I am not clear on why there are the include files and the hooks in the .module file.
Comment #11
jorisclaes commentedThe patch provided is only a partial fix.
To make things easier for the next one, I took the diff from MR !5, which I believe is correct.
Comment #12
lorenzs commentedConfirmed the issue as well as the proposed (small) fix in MR5 / patch #11.
Comment #13
jopdebeeck commentedI added these changes also to the D11 compatibility issue branch: https://www.drupal.org/project/dropzonejs_webform/issues/3499051
Comment #14
arno_vgh