Ticket #40 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

hasMany query fails

Reported by: adityamooley Assigned to:
Priority: major Milestone: 0.8
Component: Active Record Keywords:
Cc:

Description

I have two models, Posts and Comment associated with hasMany. Now, when I try to display the post which has no comments then I get a FATAL Error

Fatal error: Call to a member function getId() on a non-object in /home/****/blog/app/views/post/compiled/show.tpl.php on line 4

The same thing works fine for posts with comments.

Attaching the a tarball with test, post and comments installer and the proposed patch file.

Attachments

hasManyQuery.tar.gz (1.7 kB) - added by adityamooley on 08/20/07 07:30:32.
Tarball with test and patch
find_and_include_should_return_unrelated_items.patch (9.2 kB) - added by bermi on 08/20/07 19:41:18.

Change History

08/20/07 07:30:32 changed by adityamooley

  • attachment hasManyQuery.tar.gz added.

Tarball with test and patch

08/20/07 19:41:18 changed by bermi

  • attachment find_and_include_should_return_unrelated_items.patch added.

08/20/07 19:41:46 changed by bermi

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone set to 0.8.

Aditya,

Thanks for the test and files, it has definitely helped on removing an old Akelos annoyance.

Please have a look at the attached patch to get an idea of what I've changed. Patches using this standard format will be considered faster once we start to get more tickets, as we can test them faster (supposing that everything is included).

This issue has been fixed at [315]