6.0.0-alpha14
7/2/25

[#9626] Imap_Client fetch() fails with empty UID list
Summary Imap_Client fetch() fails with empty UID list
Queue Horde Framework Packages
Queue Version Git master
Type Enhancement
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester wrobel (at) horde (dot) org
Created 03/06/2011 (5232 days ago)
Due
Updated 03/07/2011 (5231 days ago)
Assigned
Resolved 03/07/2011 (5231 days ago)
Milestone
Patch No

History
03/07/2011 08:13:16 AM Michael Slusarz Assigned to Michael Slusarz
State ⇒ Resolved
 
03/07/2011 08:10:51 AM Git Commit Comment #2 Reply to this comment
Changes have been made in Git for this ticket:

Bug #9626: Add Horde_Imap_Client_Ids#isEmpty()

  4 files changed, 83 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/e7d466400e867b7c3fef90540ae862542d5a195c
03/06/2011 02:31:43 PM Gunnar Wrobel Comment #1
Priority ⇒ 1. Low
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ Imap_Client fetch() fails with empty UID list
Type ⇒ Enhancement
State ⇒ New
Reply to this comment
The following fails with an exception ...

         $query = new Horde_Imap_Client_Fetch_Query();
         $query->structure();

         $ret = $this->getBackend()->fetch(
             $folder,
             $query,
             array('ids' => new Horde_Imap_Client_Ids($uids))
         );

... if $uids is array().

(1299420790.8779) C: 5 UID FETCH  (BODYSTRUCTURE)
(1299420790.8787) S: 5 BAD Invalid sequence in Uid

12. Horde_Imap_Client_Socket->_fetch() 
/home/wrobel/environment/horde-glue/horde/framework/Imap_Client/lib/Horde/Imap/Client/Base.php:1954
13. Horde_Imap_Client_Socket->_sendLine() 
/home/wrobel/environment/horde-glue/horde/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php:2430
14. Horde_Imap_Client_Socket->_parseResponse() 
/home/wrobel/environment/horde-glue/horde/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php:3493
15. Horde_Imap_Client_Base->_exception() 
/home/wrobel/environment/horde-glue/horde/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php:3860

I can obviously catch the problem before calling fetch() but I 
wondered if it wouldn't make sense to change the API to return an 
empty array in that case.

Saved Queries