[dev] Share names in kronolith not displayed: share_object->get('name') vs share_object->getName()

Jan Schneider jan at horde.org
Sun Apr 1 10:50:03 UTC 2012


Zitat von Michael J Rubinsky <mrubinsk at horde.org>:

> Quoting Ralf Lang <lang at b1-systems.de>:
>
>> Am 31.03.2012 18:33, schrieb Michael J Rubinsky:
>>>
>>> Quoting Ralf Lang <lang at b1-systems.de>:
>>>
>>>> Hi,
>>>>
>>>> in develop I spotted that share names are not displayed in most
>>>> places like kronolith.
>>>>
>>>> I found out a lot of templates use
>>>> $some_share_object->get('name') while others use ->getName();
>>>>
>>>> 'name' is not supported by the get method, at least not for the
>>>> sql driver.
>>>>
>>>> What's the proper fix? Converting all templates/views to use
>>>> getName or to ass the get('name') case to the backend driver?
>>>>
>>>> If it's the former I will fix any occurence at sight.
>>>
>>>
>>> It depends on what information you are trying to get;
>>> $share_object->get('name') is the correct form to use when trying
>>> to get the share's *display* name (in the sql driver, this would
>>> map to the attribute_name field). If you are trying to get the
>>> share's internal share_name then you want
>>> $share_object->getName().
>>
>> OK, then it's the latter. Currently, get('name') returns nothing from
>> the sql backend, probably because the set method saves it to the
>> share_name and the getter reads it from attribute_name.
>
> Ah. Yeah, that's a bug then. $share->set('name', $name) should set  
> attribute_name.

Doh, that would have been me breaking this. I didn't think of the  
"name" *attribute* when I implemented share renaming.

-- 
Jan Schneider
The Horde Project
http://www.horde.org/




More information about the dev mailing list