eZ Community » Forums » Developer » Problems when using ezcomments
expandshrink

Problems when using ezcomments

Problems when using ezcomments

Tuesday 14 September 2010 2:45:12 pm - 3 replies

Hi.

I need to present the latest comments which have been added to the system. I would not like to sort results based on contentobjectids and this should all be possible by using ezcomFunctionCollection::fetchCommentListByContentObjectIDList(null,null,null,null,null,null,0,100,array());

When I do this however i only get an empty result back.

it also produces an sql query error.

Is anyone able to reproduce this?

I am running ezcomments v 1.1 (the function was not available in preveious releases.)

Update 1: I managed to get the fetch function to work, but only when used as a template fetch on my 4.4beta3 installation of eZPublish.

I now made the extension work for ezPublish 4.2 as wellhappy.gif Emoticon

Any one who can help me out with an example of calling the fetchCommentListByContentObjectIDList which fetches all comments regardless of user or contentobjectid?

Update 2: I tried to use the fetchLatestComments instead as a funciton in php and this seems to work as i was hopinghappy.gif Emoticon

Modified on Tuesday 14 September 2010 3:45:54 pm by Lars Eirik Roenning

Tuesday 14 September 2010 10:08:22 pm

Hi, Lars,

The fetch functions were designed to be used in template, so it will be safe to use them in template.

But if you try to use fetchCommentListByContentObjectIDList in php, I think the problem is that the sortby field missing(which can be seen as a inconvenient issue happy.gif Emoticon ). So if you use fetchCommentListByContentObjectIDList(null,null,null,null,'modified',null,0,100,array()), it should work.

But still fetch function in template is recommended.

Documentation: http://ez.no/doc/extensions/ez_co...nctions/comment_list_by_content_list

Thanks.

Chen

Modified on Tuesday 14 September 2010 10:08:41 pm by Chen Xiongjie

Tuesday 14 September 2010 11:06:15 pm

Thanks for responding Chen!

I have not used the fetchCommentLIstByContentObjectIDList after encountering the problem of calling it from php.. Also i have successfully been using fetchLatestCommentshappy.gif Emoticon

I will try to use the other function just to test if it works with adding the sortby fieldhappy.gif Emoticon

Once again, thanks

Tuesday 28 September 2010 7:57:31 am

Hello Lars,

As Jerom said, you can call a fetch function from PHP as easier as inside a template. Just make a call to eZFunctionHandler::execute with the appropiate parameters. In your case it would be something like:

eZFunctionHandler::execute('comment', 'comment_list_by_content_list', array(
  'sort_field' => 'modified',
  'sort_order' => 'desc'
));
expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from