[Tickets #1490] NEW: Editing a virtual folder from the mailbox view
creates a duplicate on save
bugs at bugs.horde.org
bugs at bugs.horde.org
Fri Mar 4 06:48:46 PST 2005
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/?id=1490
-----------------------------------------------------------------------
Ticket | 1490
Created By | joeri at joeri.nu
Summary | Editing a virtual folder from the mailbox view creates a duplicate on save
Queue | IMP
Version | HEAD
State | Unconfirmed
Priority | 1. Low
Type | Bug
Owners |
-----------------------------------------------------------------------
joeri at joeri.nu (2005-03-04 06:48) wrote:
Create a Virtual Folder, open it using the block in the left frame then if
you click in the mailbox view on the edit link and save the folder again,
you get a duplicate folder which is corrupt (unserialize error)
As I see it IMP tries to delete the folder without the IMP_VFOLDER_PREFIX
appended.
This problem can be avoided by using the folder view in IMP and clicking on
the edit link next to the folder.
I tried to solve this by adding this function to lib/VFolder.php:
/**
* Add the IMP identifying label (if needed) to a virtual folder ID.
*
* @access public
*
* @param string $id The virtual folder ID.
*
* @return string The virtual folder name, with the IMP specific
identifying
* information added.
*/
function getIMPLabel($id)
{
$id=IMP_VFolder::_stripIMPLabel($id);
return IMP_VFOLDER_PREFIX . $id;
}
And modifying search.php on line 301:
$imptree->delete($edit_vfolder_id);
to:
$imptree->delete(IMP_VFolder::getIMPLabel($edit_vfolder_id));
Another approach would be to change editVFolderURL in lib/VFolder.php to
always add the IMP_VFOLDER_PREFIX to the folder_id parameter ( You need the
extra function getIMPlabel too).
File lib/VFolder.php line 278:
return Util::addParameter(Horde::applicationUrl('search.php'),
array('edit_vfolder' => 1, 'vfolder' => $id));
to:
return Util::addParameter(Horde::applicationUrl('search.php'),
array('edit_vfolder' => 1, 'vfolder' =>
IMP_VFolder::getIMPLabel($edit_vfolder_id));
I personally prefer the first method, although both patches can be
implemented together with no problems and this would create more unified
links.
More information about the bugs
mailing list