Forums / Developer / Fetch doesn't return objects of my own class

Fetch doesn't return objects of my own class

Author Message

Marcus Ilgner

Wednesday 26 November 2003 1:36:43 am

Hi all,

I have a problem concerning fetch(). For the "Contact"-section of our website I created a class called "employee" (id 14) and put a number of employee-objects in the content structure.
But when I try to display them, fetch() doesn't return them. I tried to put an "article"-object in the same folder and search for article-class objects which worked fine.
The code below doesn't work for finding "employee"-type objects but when I replace '14' with '2' it successfully finds "article"-type objects.

{let employees=fetch( content, list_count, hash( parent_node_id, $:item.node_id,
sort_by, array(published,false()),
class_filter_type, include,
class_filter_array, array(14) ))}

Can anyone tell me what I might have done wrong? Do I have to register a new class somewhere? Assign it to a section? Do whatsoever? But then creating of new employee-objects works fine... and I can see them in the admin-interface.

Greetings
Marcus

Claus Jensen

Wednesday 26 November 2003 1:53:34 am

Hi Marcus,
if this fetch manages to fetch articles and not your class, maybe you forgot to set the rights for your class? Most normal problem for this kind of behaviour, done it myself a couple of times ;)

regards,
claÜs

Marcus Ilgner

Wednesday 26 November 2003 3:07:14 am

Hi Claus,

thanks for your reply! It saved my day...
Got it working all right now.

Greetings
Marcus