Problem/Motivation

Using captcha module 2.0.5 and webform module 6.2.2, when I place an image captcha on a webform with some file upload fields, it creates the following error in the system logs when uploading a file:

Missing required form ID on route entity.node.canonical

All works well in the frontend and the file upload but we have this error in the logs for each file upload in the webform with an image captcha.

Steps to reproduce

Place an image captcha on the first page of a webform with at least one file upload field on the second page of the webform.

You fill the Captcha on the first page and then you upload a file on the second page.

This creates the aforementioned error in the system log on the ajax upload call :

https://mywebsite.com/mywebform?_wrapper_format=drupal_ajax&ajax_form=1&element_parents=elements/etape_2/fieldset_etape_2___constituer_votre_dossier/diplome_6

It does not matter if I add the image captcha directly on the webform or using captcha points, we always have this error in the logs on each file upload. This is why I think this issue comes from the image captcha sub-module and not the webform module. Please, correct me if I'm wrong.

Proposed resolution

Do not check for the form_id in imageCaptchaAfterBuildProcess() during an ajax file upload.

Remaining tasks

Determine how to implement the proposed solution.

User interface changes

None

API changes

None

Data model changes

None

Issue fork captcha-3426421

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

LeDucDuBleuet created an issue. See original summary.

znak’s picture

Status: Active » Needs review
StatusFileSize
new2.93 KB

Please, test my patch here

Status: Needs review » Needs work

The last submitted patch, 2: captcha-3426421-missing_required_form_ID-2.patch, failed testing. View results

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

japerry changed the visibility of the branch 3426421-missing-required-form to hidden.

  • japerry committed 363532f7 on 2.x
    Issue #3426421 by znak: Missing required form ID on route entity.node....
japerry’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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