Problem/Motivation

The sync code introduced in #3460684 in antibot_form_alter() for webform_settings_form has two issues:

  1. It adds/removes individual webform_submission_*_add_form IDs to antibot.settings one-by-one on each webform save, instead of managing the webform_submission_* wildcard when the Webform module's global "Protect all webforms" third-party setting is enabled. This causes dirty config on every drush cex.
  2. The sync only runs on webform_settings_form (per-webform settings). When the global "Protect all webforms" option is toggled at /admin/structure/webform/config (form_id: webform_admin_config_forms_form), the wildcard is never added or removed from antibot.settings.

Steps to reproduce

  1. Enable Antibot and Webform modules.
  2. Go to /admin/structure/webform/config and enable "Protect all webforms with Antibot".
  3. Save. Check antibot.settings form_ids — the webform_submission_* wildcard is never added.
  4. Go to any individual webform settings form and save. An individual webform_submission_*_add_form ID is added instead of the wildcard.

Proposed resolution

Fix the sync logic in antibot_form_alter() to properly handle the Webform module's global "Protect all webforms" setting:

  1. Add global admin form support: Extend the sync to also run on webform_admin_config_forms_form (the form at /admin/structure/webform/config), so the wildcard is synced when the user toggles the global "Protect all webforms" option.
  2. Use wildcard instead of individual IDs: When the global protection is ON (detected via webform.third_party_settings_manager), ensure the webform_submission_* wildcard is present in form_ids instead of adding individual webform_submission_*_add_form IDs one by one.
  3. Clean up on disable: When the global protection is OFF, remove the wildcard from form_ids if present, and sync individual webform IDs only on the per-webform settings form (webform_settings_form).

Note: This issue is related to a companion Webform patch that fixes the Antibot third-party checkbox UI when global protection is active. See related Webform issue #3613417.

Remaining tasks

  • Review and feedback from maintainers.

User interface changes

None.

API changes

None.

Data model changes

None. The patch only changes how antibot.settings form_ids are managed at save time.

CommentFileSizeAuthor
#2 sync-wildcard-3613411-1.patch3.4 KBsolucionex

Comments

solucionex created an issue. See original summary.

solucionex’s picture

StatusFileSize
new3.4 KB
solucionex’s picture

Issue summary: View changes
solucionex’s picture

Issue summary: View changes
cao89’s picture

Any chance of this getting reviewed and merged in any time soon? I had to pin to 2.0.4 because it was causing an issue with a config read only ignore setting. Basically we allow content admins to change settings to webforms but not others and I think this issue is causing can a fatal error when they try to adjust webform settings.

danrod’s picture

I'll look into merging to the 2.0.x branch and create a tagged release