[dev] renameCategory() question

Hans Lellelid hans at appliedsec.com
Thu Jan 30 14:08:53 PST 2003


Hi Chuck,

Thanks for committing the Group.php fix.  I had another question about 
renameCategory().  I'd like the renameCategory() method to refresh the 
category cache  -- at least for the modified category Id.  In the 
renameCategory() method the following code changes the name in 
$_categories[] array:

    $this->_categories[$old_category_id]['name'] = $new_category_name;

Unfortunately, this isn't really enough -- since the old category name 
still exists in $_nameMap[].  Furthermore, if it is a parent category 
being renamed, then there are a number of changes that need to be 
changed in $_nameMap.

Is there a method that I can call to update $_categories and $_nameMap 
for a particular category Id?  When I used _loadById() it simply 
returned true (because it detected that $_categories[$cid] was already set).

Thanks,
Hans


Chuck Hagenbuch wrote:

>Quoting Hans Lellelid <hans at appliedsec.com>:
>
>  
>
>>I've attached a patch to Group.php.  The Group::renameGroup() method was
>>passing a CategoryObject_Group object as the second param to
>>Category::renameCategory() which was expecting a string (new category
>>name).
>>    
>>
>
>Committed, thanks!
>
>-chuck
>
>--
>Charles Hagenbuch, <chuck at horde.org>
>must ... find ... acorns ... *thud*
>
>  
>



More information about the dev mailing list