Summary | Editing a virtual folder from the mailbox view creates a duplicate on save |
Queue | IMP |
Queue Version | HEAD |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | slusarz (at) horde (dot) org |
Requester | joeri (at) joeri (dot) nu |
Created | 03/04/2005 (7457 days ago) |
Due | |
Updated | 03/07/2005 (7454 days ago) |
Assigned | 03/04/2005 (7457 days ago) |
Resolved | 03/07/2005 (7454 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ Resolved
State ⇒ Assigned
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Editing a virtual folder from the mailbox view creates a duplicate on save
Queue ⇒ IMP
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.