deletion of calendar with no items causes database query error
- Status
- Closed
- Subject
- deletion of calendar with no items causes database query error
- Version
- 1.9.x
- Category
- Error
- Feature
- Calendar
- Resolution status
- Fixed or Solved
- Submitted by
- Nelson Ko
- Volunteered to solve
- Nelson Ko
- Lastmod by
- Nelson Ko
- Rating
- Description
problem is in drop_calendar function within calendarlib.php.
1.9.x CVS Head Revision 1.50
Lines 103-104
$query = "delete from `tiki_calendar_roles` where `calitemId` in (".implode(',', array_fill(0,count($allItemsFromCalendar),'?')).")";
$this->query($query,array($allItemsFromCalendar));If there are no items in calendar, $allItemsFromCalendar will not have any items. My setup with MySQL throws query error... don't know if this is universal. Anyway, fix is easy. Simply add if clause to check if $allItemsFromCalendar has any items.
- Solution
if (count($allItemsFromCalendar) > 0) {
$query = "delete from `tiki_calendar_roles` where `calitemId` in (".implode(',', array_fill(0,count($allItemsFromCalendar),'?')).")";
$this->query($query,array($allItemsFromCalendar));
}- Importance
- 8
- Priority
- 40
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 913
- Created
- Wednesday 18 October, 2006 16:14:40 UTC
by Unknown - LastModif
- Wednesday 16 May, 2007 15:30:50 UTC