I can't add a new social group - I get an error no calendar specified.
Quote:
Originally Posted by Wayne Luke
I was evaluating this to see if I want to keep it and click Install. However I cam across an error.
Warning: Invalid argument supplied for foreach() in [path]/calendar.php(1825) : eval()'d code on line 70
This leads to the plugin on calendar_add_complete and this code:
PHP Code:
if (count($othergroups)>0) {
$socialgrouplist .= "<option>-------------------</option>";
}
// Add options to social group list.
foreach ($othergroups as $socialgroup) {
$selected = ($groupid==$socialgroup['groupid']) ? 'selected="selected"' : "";
$socialgrouplist .= "<option value=\"$socialgroup[groupid]\" $selected>$socialgroup[name]</option>";
}
I don't have any "$othergroups" as I am the owner of all groups on the site. So shouldn't the Foreach be within the if block with the divider line so that it doesn't try to process a loop without data?
I changed the above code to:
PHP Code:
if (count($othergroups)>0) {
$socialgrouplist .= "<option>-------------------</option>";
// Add options to social group list.
foreach ($othergroups as $socialgroup) {
$selected = ($groupid==$socialgroup['groupid']) ? 'selected="selected"' : "";
$socialgrouplist .= "<option value=\"$socialgroup[groupid]\" $selected>$socialgroup[name]</option>";
}
}
Clears up the error. Wouldn't be noticeable on an active site with different groups created.
|
Was getting the same error, thanks for the fix! Mod working now