Ticket #393 (closed Bug: fixed)

Opened 10 months ago

Last modified 10 months ago

ORM $query->count() fails if no rows returned

Reported by: joeles Owned by: Shadowhand
Priority: major Milestone: 2.1.2
Component: Libraries:ORM Version: SVN HEAD
Keywords: ORM count result find_all Cc:

Description

The following works fine as long there are rows returned, but gives me a "Call to a member function count() on a non-object" fatal error when there are not.

$user = new User_Model;
$query = $user->find_all_by_location('Houston');

echo $query->count();

For some reason, count($query) does work, however.

Change History

Changed 10 months ago by Shadowhand

  • keywords orm count result find_all added
  • status changed from new to assigned

Changed 10 months ago by Shadowhand

  • keywords ORM added; orm removed
  • status changed from assigned to closed
  • resolution set to fixed

Fixed in r2026.

Note: See TracTickets for help on using tickets.