[#7105] Warning displayed on column options page
Summary Warning displayed on column options page
Queue Turba
Queue Version 2.2.1
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester dion (dot) rowney (at) usask (dot) ca
Created 07/23/2008 (120 days ago)
Due
Updated 07/23/2008 (120 days ago)
Assigned
Resolved 07/23/2008 (120 days ago)
Attachments
Milestone
Patch No

History
07/23/2008 Michael Rubinsky Comment #2
State ⇒ Not A Bug
Reply to this comment
07/23/2008 dion (dot) rowney (at) usask (dot) ca Comment #1
Patch ⇒
Milestone ⇒
Queue ⇒ Turba
Summary ⇒ Warning displayed on column options page
Type ⇒ Bug
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Reply to this comment
The following warning appears on the config page:

horde/turba/templates/prefs/columnselect.inc


Drag columns to re-arrange them. Check a column to enable it.

       Warning: Invalid argument supplied for foreach() in 
/var/www/html/horde/turba/templates/prefs/columnselect.inc on line 64
    1. First Name
    2. Last Name
    3. Middle Names
etc...

To resolve I added a check in my code and submit it for your consideration:

// First the selected columns in their current order.
add>> if ( isset ( $sources[$source] ) ) {
foreach ($sources[$source] as $column) {      if (substr($column, 0, 2) == '__' || $column == 'name') {
         continue;
     }
     $checked = isset($selected[$column]) ? ' checked="checked"' : '';
     $name = htmlspecialchars('turba-prefs-cols-' . $source . '-' . $column);
     echo '<li id="turba-prefs-cols-' . htmlspecialchars($source) . 
'_' . $i . '"><input name="' . $name . '" id="' . $name . '" 
type="checkbox" class="check
box"' . $checked . ' />' . 
htmlspecialchars($attributes[$column]['label']) . '</li>';
     $i++;
}
add>>}