Closed (fixed)
Project:
User protect
Version:
6.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Feb 2009 at 21:04 UTC
Updated:
26 Jul 2009 at 15:20 UTC
I was getting this error at admin/user/userprotect/protection_defaults:
warning: Invalid argument supplied for foreach() in /includes/form.inc on line 1195.
The problem is that if no options on the form are checked, the returned default value is empty. The attached patch assures that the default value is always an array.
| Comment | File | Size | Author |
|---|---|---|---|
| userprotect_defaultvalues.patch | 704 bytes | dboulet |
Comments
Comment #1
cedarm commentedWouldn't replacing the whole loop with
$defaults = array_keys(array_filter($current_defaults));be simpler?Comment #2
hunmonk commentedcedarm's fix in #1 is more elegant, so i've committed that to 5.x-1.x-dev and 6.x-1.x-dev.
thanks!