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

Command icon 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

sabrina.liman created an issue. See original summary.

sabrina.liman’s picture

Issue summary: View changes
sabrina.liman’s picture

Project: Webform DropzoneJS » DropzoneJS Webform
Version: 8.x-1.0 » 1.0.x-dev
Status: Active » Closed (outdated)
anouar louedziane’s picture

I 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

damondt’s picture

This is also addressed in the larger D10 compatibility issue https://www.drupal.org/project/webform_dropzonejs/issues/3299484

damondt’s picture

Status: Closed (outdated) » Closed (duplicate)
Related issues: +#3299484: Automated Drupal 10 compatibility fixes
fotispan’s picture

Status: Closed (duplicate) » Needs review

This 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"

johnlutz made their first commit to this issue’s fork.

johnlutz’s picture

I 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.

jorisclaes’s picture

StatusFileSize
new1.24 KB

The 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.

lorenzs’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed the issue as well as the proposed (small) fix in MR5 / patch #11.

jopdebeeck’s picture

I added these changes also to the D11 compatibility issue branch: https://www.drupal.org/project/dropzonejs_webform/issues/3499051

arno_vgh’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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