[dev] Turba - last address book stored in session - issue when deleted.

Michael Rubinsky mike at theupstairsroom.com
Thu Nov 30 15:11:20 PST 2006


Quoting Jan Schneider <jan at horde.org>:

> Zitat von Michael Rubinsky <mike at theupstairsroom.com>:
>
>> Quoting Chuck Hagenbuch <chuck at horde.org>:
>>
>>> Quoting Michael Rubinsky <mike at theupstairsroom.com>:
>>>
>>>> Ok, I know this is a fringe case, but...If a user has two address  
>>>>   books, views one, then goes to the My Address Books page and   
>>>> deletes  the one he just viewed, then goes back to the browse  
>>>> page,  the error  message about it not being found is displayed,  
>>>> but since  there is now  only 1 browseable address book, there is  
>>>> no source  selection widget in  the menu.  Yea, he could click on  
>>>> the address  book in the side bar  menu, but it is possible that  
>>>> the side bar is  not being displayed.
>>>>
>>>> I have patched it so that if there is only 1 browesable address   
>>>> book,  then the session value is cleared, and then the user is   
>>>> redirected  back to the browse.php page.  This still displays the  
>>>>  error, but this  way the user has a way of getting to his  
>>>> remaining  address book (which  is probably what was intended  
>>>> here anyway).   If there is more than one  browseable book, the  
>>>> session value is  cleared, but the user is not  redirected, since  
>>>> they will see an  error message as well as the source  selection  
>>>> widget.
>>>>
>>>> Does this sound reasonable before I commit it?
>>>
>>> How about clearing the session value if you delete the addressbook  
>>>  that it contains?
>>
>> That's essentially what I did, but then I redirect back to  
>> browse.php  if there is only 1 browseable source, since there would  
>> be no other  way to get at your address book if your are not  
>> viewing the side bar.   I guess my question really is, should we  
>> redirect only in this case  (when you delete the currently cached  
>> address book and have only 1  browseable source left), or redirect  
>> back to browse.php whenever we  delete the currently cached address  
>> book (regardless of the number of  browseable address books we may  
>> have)?  Now that I'm thinking about it  more, I'm leaning more  
>> towards the second case...
>
> Why do you redirect at all, instead of staying on the "My Address  
> Books" page?


I was about to respond to you that I'm not redirecting when deleting  
the address book, but when the user navigates to the browse.php page -  
then it hit me that I'm emptying the session variable at the wrong  
spot.  I'm emptying it after we try to navigate to the browse page,  
not after deletion, which is where it should be done...arggh.

Thanks for the hint ;)

Thanks,
mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 2013 bytes
Desc: PGP Public Key
Url : http://lists.horde.org/archives/dev/attachments/20061130/b580869f/attachment.bin


More information about the dev mailing list