Notice: Undefined index: fid in customfilter_rule_delete_submit() (line 1062 of customfilter.module)

Created on 6 February 2018, almost 7 years ago
Updated 5 June 2024, 5 months ago

Deleting a filter rule gives error:

Notice: Undefined index: fid in customfilter_rule_delete_submit() (line 1062 of /home/username/public_html/sites/all/modules/customfilter/customfilter.module).

because $form_state['values'] on line 1062 doesn't have such an array member as ['fid']. It only has the following array members for deleted rule:

values (Array, 6 elements)
confirm (Integer) 1
submit (String, 6 characters ) Delete
form_build_id (String, 48 characters ) form-IaOK_fWuB2bADmBrGggmTl5_iQwNddpLc965r-Jm4dE
form_token (String, 43 characters ) 65aD9rFQ7IHLTZOunKqejP7F0kJ_7ikGxW83vd6fwfI
form_id (String, 24 characters ) customfilter_rule_delete | (Callback) customfilter_rule_delete();
op (String, 6 characters ) Delete

I am not sure if clearing cache is really needed at this point, but as a temporary solution I've fixed this with the following patch:

1062c1062
<   customfilter_cache_clear($form_state['values']['fid']);
---
>   customfilter_cache_clear($form['#fid']);
🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024