Form Field Manager - Action Hook bug #7168
Replies: 1 comment
-
Hi @pulsovi, we are aware you have opened an issue for this bug related problem. An internal ticket has been created. Reference: Form Field Manager - Action Hook bug #7175 for additional information. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am a WordPress plugin developer and I am working on a website customization plugin for a client.
During my work, I detected a bug in this plugin: https://givewp.com/addons/form-field-manager/
Precisely in the
action_hook
functionality which is one of the custom fields that can be added by the plugin.The bug manifests itself in the following two cases:
-
The hook does not work or no longer works.
Here are the details of my diagnosis after reading the source code:
The custom field details are saved along with the other fields in form metadata.
This field has several properties, 2 of which will be important below:
'name'
and'label'
Only the
'label'
property can be modified in the back office, this is supposed to be the name of the triggered hook as can be confirmed by readinggive-form-field-manager/includes/class-render-form.php @action_hook
.But in practice, it is the
'name'
property which is used for the call to thedo_action
function, seegive-form-field-manager/src/FormFields/Actions/RegisterFields.php@register
atcase FieldType::action_hook():
.In the back office, the form modification page displays a block to configure the
"action_hook"
with a single visible and modifiable field: the "label", seegive-form-field-manager/includes/admin/ admin-template.php@action_hook
.When submitting this information (POST), the
"name"
of the"action_hook"
field is set tostrtolower($field['label'])
the very first time, then it cannot be changed anymore , seegive-form-field-manager/includes/admin/admin-form.php@save_form_meta
.The only solution for the user who wants to change the hook is a hack: toggle the visibility of the form from 'publish' to 'pending'
at this point, the
'name'
is redefined tostrtolower($field['label'])
and we can republish the form.you must also ensure that the hook used is an entirely lowercase character string. And be careful,
-
is considered the capital letter of_
.Beta Was this translation helpful? Give feedback.
All reactions