Hi folks, I’m having difficulty getting at the $fields array within an extension using the ‘freeform_module_insert_end’ hook - help appreciated.
From the docs
“Available through this extension hook is the associative array $fields which contains all of the Freeform fields where the key is the name of the field and the value is the label.”
Within my extension I have a function which is being passed $fields and $entry_id. I only want this function to do stuff for a particular form: “questionnaire”.
Code looks something like this:
function foo ($fields, $entry_id) {
if ($fields['form_name']=='questionnaire') {
// do stuff
}
}
The problem is that $fields[’form_name’] is returning no value, so my stuff doesn’t get done.
Is there something wrong with the syntax I’m using to address the $fields array? I’m somewhat confused about what “the value is the label” means in the context of the $fields array: I thought the label was the display name given to the field for display within CP Home › Modules › Freeform › Manage Entries. I’m no doubt missing something obvious here!
If I remove the condition, it works perfectly. I’m using the latest version of Freeform (2.6.3) and EE 1.6.2 Build: 20080124
Cheers
Ken and David
