sproctor / php-calendar

PHP-Calendar
http://www.php-calendar.org/
Apache License 2.0
140 stars 67 forks source link

Fatal error #86

Closed goverc closed 10 years ago

goverc commented 10 years ago

Getting a fatal error when adding one event, which recurs for 20 years (xmas day). also had the same error prior when i tried to add an all-day event.

Fatal error: Call to a member function add() on a non-object in C:\xampp\htdocs\cal\includes\calendar.php on line 327

line 327 is : $attribs->add($url);

in the following area of the file: function create_action_link($text, $action, $args = false, $attribs = false) { global $phpc_script, $vars, $phpcid;

$url = "href=\"$phpc_script?action=" . htmlentities($action);

if (!$args) {
    $args = array();
}
if (!array_key_exists("phpcid", $args)) {
    $args["phpcid"] = htmlentities($phpcid);
}

foreach ($args as $key => $value) {
    if(empty($value))
        continue;
    if (is_array($value)) {
        foreach ($value as $v) {
            $url .= "&" . htmlentities("{$key}[]=$v");
        }
    } else {
        $url .= "&" . htmlentities("$key=$value");
    }
}
$url .= '"';

if($attribs !== false) {
} else {
    $attribs = attrs($url);
}
return tag('a', $attribs, $text);

}

not sure how to rectify...

goverc commented 10 years ago

closed and re-opened calendar and it is displaying the .css properties of the item inside the day:

style="color: #000000 !important;background: #e5de14 !important;"Christmas Day

I don't get the original error anymore, but this css displays on all other events i input now...

sproctor commented 10 years ago

Don't use the head version from git. It's not ready for public consumption. The releases are here https://code.google.com/p/php-calendar/downloads/list

sproctor commented 10 years ago

I just committed a few things. In there is probably the fix to your problem.