[#7854] Error in DIMP's _getIdxString()-function
Summary Error in DIMP's _getIdxString()-function
Queue DIMP
Queue Version 1.1.1
Type Bug
State No Feedback
Priority 2. Medium
Owners
Requester thomas@gelf.net
Created 2009-01-15 (4193 days ago)
Due
Updated 2010-12-22 (3487 days ago)
Assigned 2009-01-15 (4193 days ago)
Resolved 2009-01-24 (4184 days ago)
Milestone
Patch No

Comments
thomas@gelf.net 2009-01-15 15:32:09
As I'm in a hurry right now I wasn't able to immediately figure

out what this function is used for:



> function _getIdxString($indices)

> {

>     $i = each($indices);

>     return reset($i['value']) . IMP_IDX_SEP . $i['key'];

> }



However if you look my log line and then at the code, the error

is obvious - there is no $key:



> PHP Warning:  reset(): Passed variable is not an array or object

> in dimp/imp.php on line 112

> PHP Notice:  Undefined index:  key in dimp/imp.php on line 112



Best regards,

Thomas Gelf



thomas@gelf.net 2009-01-15 15:37:37
This then leads to...



> PHP Fatal error:  Call to undefined method PEAR_Error::getHeaderOb()

> in imp/lib/Compose.php



...in the forwardMessage function, it doesn't expect $imp_contents to be

a PEAR_Error.

Michael Slusarz <slusarz@horde.org> 2009-01-15 19:05:14
> As I'm in a hurry right now I wasn't able to immediately figure

> out what this function is used for:

>

>> function _getIdxString($indices)

>> {

>>     $i = each($indices);

>>     return reset($i['value']) . IMP_IDX_SEP . $i['key'];

>> }

>

> However if you look my log line and then at the code, the error

> is obvious - there is no $key:

>

>> PHP Warning:  reset(): Passed variable is not an array or object

>> in dimp/imp.php on line 112

>> PHP Notice:  Undefined index:  key in dimp/imp.php on line 112



So what is the value of $indices?

thomas@gelf.net 2009-01-16 08:54:36
>>> function _getIdxString($indices) {

>>>     $i = each($indices);

>>>     return reset($i['value']) . IMP_IDX_SEP . $i['key'];



> So what is the value of $indices?



I don't know that - and I'll not have enough time to track this down

before monday. But who cares, just have a look at the posted code

and tell me the value of $key - the error is to be found there!



Chuck Hagenbuch <chuck@horde.org> 2009-01-16 18:35:39
> I don't know that - and I'll not have enough time to track this down

> before monday. But who cares, just have a look at the posted code

> and tell me the value of $key - the error is to be found there!



Except that is *is* there for the rest of us. That's why you have to 
help us reproduce the problem by supplying the actual value, to help 
us figure out what's going on.

thomas@gelf.net 2009-01-16 21:15:46
>> I don't know that - and I'll not have enough time to track this down

>> before monday. But who cares, just have a look at the posted code

>> and tell me the value of $key - the error is to be found there!

>

> Except that is *is* there for the rest of us. That's why you have to

> help us reproduce the problem by supplying the actual value, to help

> us figure out what's going on.



Sorry, I misread the function - I really need some sleep. I'll do some

tests on monday and let you know!