getByHandle is not specific to category ?

Permalink
I already have a Page attribute called "is_featured".
I'm also want to use a File attribute that will be called the same "is_featured"

When calling FileAttributeKey::getByHandle('is_featured') to verify that this FileAttribute doesn't already exists, it returns true (which is incorrect, I didn't create it yet).

I think it's because getByHandle doesn't filter with akCategoryID field when querying the DB.

Is that a bug ? Just want to make sure. thanks
francoiscote
View Replies:
francoiscote replied on at Permalink Reply
francoiscote
more clearly, without the example.

getByHandle() should validate against the attribute category. Currently, calling both following functions seems to do the exact same thing:

FileAttributeKey::getByHandle();
CollectionAttributeKey::getByHandle();

which means you cannot have a File Attribute Key with the same handle as a Collection Attribute Key ?
adavis replied on at Permalink Reply
adavis
Did you make any progress with this? I am just starting out with C5 and curious about this myself.
francoiscote replied on at Permalink Reply
francoiscote
sadly no

If my memory is correct, I think I went around the problem by naming my two handles differently based on the type.

I will log this as a bug instead of here in the forum.
andrew replied on at Permalink Reply
andrew
I think this actually is already logged:

http://www.concrete5.org/developers/bugs/5-4-1-1/system-doesnand039...

Would you mind testing on the latest version in github.com? I think we have fixed this.
francoiscote replied on at Permalink Reply
francoiscote
great!
I search the bugs for "getByHandle" and couldn't find anything.

I will check it out on github. By the way, it doesn't seem easy to find the link to the github repo from concrete5.org.