Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Are all forms created by webform module automatically taken care of, or do we have to add each form id in configuration?
Comment | File | Size | Author |
---|---|---|---|
#5 | webforms_special_form_id-1863514-5.patch | 2.43 KB | hctom |
Comments
Comment #1
PatchRanger CreditAttribution: PatchRanger commentedAnswering your question: yes, right now you need to add each webform form manually. The table at admin/config/people/botcha/form includes all forms that are known by BOTCHA - so if there is no some concrete form then you should add it.
Let's turn it into a feature request: I think it makes sense to add webform forms to the list (though I think we shouldn't protect them by default - just list them).
Comment #2
PatchRanger CreditAttribution: PatchRanger commentedBy the way (I will not get tired mentioning it):
If you are interested in getting this issue closed - please consider donating using PatchRanger service. Each donation - is in fact a bounty which developers will be rewarded with after fixing the issue. For more details see http://drupal.org/project/botcha#how-much-does-it-cost.
Comment #3
millenniumtreeHow about an option to add botcha to all webforms?
What about a wildcard in the form ID?
That way you just enter a form ID of 'webform_client_form_*' and you're done.
Comment #4
hctomIMHO the special
webform_client_form_*
form ID absolutely makes more sense than listing all webforms by default. We work for a portal page that hosts hundreds or even thousands of contest forms utilizing thewebform
module. If all these form IDs would have been listed on the BOTCHA admin page, it won't be accessible anymore because of tons of data.The above stated special form ID should be enough to protect all webforms. It is unique (especially because of the "*" character in it, which no other form ID will ever have) and so it should be easy to filter that case in the
BotchaFormController::isEnabled()
method.I will provide a patch for that in the next comment for the
7.x-3.x-dev
branch, because we urgently need this feature.EDIT: Unfortunately the above stated special form ID collides with the validation of allowed input of form IDs and I guess it is not the best name, because this will also be used for the
botcha_enabled_FORM_ID
variable name. So I suggest the following special ID:__webform_client_form__all__
.Comment #5
hctomAttached you can find a patch which provides the special
__webform_client_form__all__
form ID handling to target all webforms at once. Nevertheless with this implementation it is still possible to create different configs for special webforms by their real form ID, which will always take precedence over the special form ID.NOTE: This should work as a quick fix, but for the future there should be something better like regular expression handling or similar. Unfortunately this would change a lot in the current API (e.g. enabled status cannot be saved in a variable anymore having the form ID in its name - this may be solved to move this information into the corresponding row in the
botcha_recipebook_form
table or another specific table containing this information), so there should be a follow up issue to make this more robust.I'd appreciate your feedback on my proposed quick fix solution.
Comment #6
Akshita CreditAttribution: Akshita commentedHi
My apologies first for posting this question here. I have installed Botcha and its dependencies on dev environment. Not I am not sure how to test my webform to make sure botcha is working.
Any help is highly appreciable.
Thanks
Rev