Skip to content

Commit

Permalink
Fix item deletions.
Browse files Browse the repository at this point in the history
Missed parsing the folderid here.
  • Loading branch information
mrubinsk committed Nov 10, 2013
1 parent 4308c10 commit be8f3c7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
5 changes: 3 additions & 2 deletions framework/Core/lib/Horde/Core/ActiveSync/Connector.php
Expand Up @@ -210,10 +210,11 @@ public function calendar_replace($uid, Horde_ActiveSync_Message_Appointment $con
* Delete an event from Horde's calendar storage
*
* @param string $uid The UID of the event to delete
* @param string $calendar The calendar id. @since 2.12.0
*/
public function calendar_delete($uid)
public function calendar_delete($uid, $calendar = null)
{
$this->_registry->calendar->delete($uid);
$this->_registry->calendar->delete($uid, null, $calendar);
}

/**
Expand Down
20 changes: 14 additions & 6 deletions framework/Core/lib/Horde/Core/ActiveSync/Driver.php
Expand Up @@ -1374,33 +1374,41 @@ public function deleteMessage($folderid, array $ids)
// this for anything other than email.
$results = $ids;

$parts = $this->_parseFolderId($folderid);
if (is_array($parts)) {
$class = $parts[self::FOLDER_PART_CLASS];
$folder_id = $parts[self::FOLDER_PART_ID];
} else {
$class = $parts;
$folder_id = null;
}
ob_start();
switch ($folderid) {
case self::APPOINTMENTS_FOLDER_UID:
switch ($class) {
case Horde_ActiveSync::CLASS_CALENDAR:
try {
$this->_connector->calendar_delete($ids);
$this->_connector->calendar_delete($ids, $folder_id);
} catch (Horde_Exception $e) {
$this->_logger->err($e->getMessage());
}
break;

case self::CONTACTS_FOLDER_UID:
case Horde_ActiveSync::CLASS_CONTACTS:
try {
$this->_connector->contacts_delete($ids);
} catch (Horde_Exception $e) {
$this->_logger->err($e->getMessage());
}
break;

case self::TASKS_FOLDER_UID:
case Horde_ActiveSync::CLASS_TASKS:
try {
$this->_connector->tasks_delete($ids);
} catch (Horde_Exception $e) {
$this->_logger->err($e->getMessage());
}
break;

case self::NOTES_FOLDER_UID:
case Horde_ActiveSync::CLASS_NOTES:
try {
$this->_connector->notes_delete($ids);
} catch (Horde_Exception $e) {
Expand Down

0 comments on commit be8f3c7

Please sign in to comment.