[Tickets #4991] Re: Default identity not selected correctly when replying to or forwarding messages in Inbox

bugs at horde.org bugs at horde.org
Fri Jan 11 17:17:56 UTC 2008


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=4991
-----------------------------------------------------------------------
 Ticket             | 4991
 Updated By         | Michael Slusarz <slusarz at horde.org>
 Summary            | Default identity not selected correctly when replying to or forwarding
                    | messages in Inbox
 Queue              | IMP
 Version            | 4.1.3
 Type               | Enhancement
 State              | Feedback
 Priority           | 1. Low
 Milestone          | 
 Patch              | 
 Owners             | Michael Slusarz
-----------------------------------------------------------------------


Michael Slusarz <slusarz at horde.org> (2008-01-11 12:17) wrote:

> Is the _identitiesWithDefaultLast() needed?  I don't seem to do 
> anything different from _identities()  The unset() part is a NOP

How so?  Imagine this scenario:
$_identities = array(
  [0] => 'foo1 at example.com',
  [1] => 'foo2 at example.com',  (DEFAULT)
  [2] => 'foo2 at example.com',
)

Running through the $_identities array only would cause identity 2 to blow
away identity 1 when storing the identity for 'foo2 at example.com'.  So we
need to move the default identity to be the last entry in the loop.  After
an unset($_identities[1]) and $_identities[1] = 'foo2 at example.com' the
array looks like:
$_identities = array(
  [0] => 'foo1 at example.com',
  [2] => 'foo2 at example.com',
  [1] => 'foo2 at example.com', (DEFAULT)
)

which is what we want.  You need to do the unset() before the assignment
or else the array value will simply be overwritten instead of being
appended to the end.



More information about the bugs mailing list