Loading...
 
Features / Usability

Features / Usability


Bug in Calendar

posts: 1

When category and location is enabled in calendering, information is distorted between the two. All new category is added into location, while no entry is added into category.

This appears to be caused by cut&paste error. I've rectified the code and appended below.

function set_item($user, $calitemId, $data) {
if (!$data%22locationId%22 and !$data%22newloc%22) {
$data%22newloc%22 = tra("not specified");
}

if $data%22newloc%22 {
$query = "delete from `tiki_calendar_locations` where `calendarId`=? and `name`=?";
$bindvars=array($data%22calendarId%22,trim($data%22newloc%22));
$this->query($query,$bindvars,-1,-1,false);
$query = "insert into `tiki_calendar_locations` (`calendarId`,`name`) values (?,?)";
$this->query($query,$bindvars);
$data%22locationId%22 = $this->GetOne("select `callocId` from `tiki_calendar_locations` where `calendarId`=? and `name`=?",$bindvars);
}

if (!$data%22categoryId%22 and !$data%22newcat%22) {
$data%22newcat%22 = tra("not specified");
}

if $data%22newcat%22 {
$query = "delete from `tiki_calendar_categories` where `calendarId`=? and `name`=?";
$bindvars=array($data%22calendarId%22,trim($data%22newcat%22));
$this->query($query,$bindvars,-1,-1,false);
$query = "insert into `tiki_calendar_categories` (`calendarId`,`name`) values (?,?)";
$this->query($query,$bindvars);
$data%22categoryId%22 = $this->GetOne("select `calcatId` from `tiki_calendar_categories` where `calendarId`=? and `name`=?",$bindvars);
}

posts: 1001 Canada

Hi miq, thanks for your feedback already.
I could check to see if this can be committed, but to help could you please use ~np~code~/np~ (surround your code with non-parsed tags to avoid getting your code being parsed by Tiki? It would be ideal to mention the file, the Tiki version and highlight the differences (provide diff output?) if possible.

Thanks anywaywink