[Koha-bugs] [Bug 10584] Hide OPAC bibilo details if all items are hidden.

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Jul 17 05:39:10 CEST 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10584

Srdjan Jankovic <srdjan at catalyst.net.nz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |srdjan at catalyst.net.nz

--- Comment #3 from Srdjan Jankovic <srdjan at catalyst.net.nz> ---
1.
+my $sth = $dbh->prepare("SELECT * FROM items WHERE biblionumber=?;");
+$sth->execute($biblionumber);
+
+my @itemsmatchingbiblionumber;
+my $matchingitem = $sth->fetchrow_hashref;
+while ($matchingitem) {
+    push @itemsmatchingbiblionumber,$matchingitem;
+    $matchingitem = $sth->fetchrow_hashref;
+}

is perhaps better written as
my $itemsmatchingbiblionumber = $dbh->selectall_arrayref($sql, { Slice => {}},
$biblionumber)

2. Database queries should all be placed in modules (probably C4/Items.pm for
this one, maybe theres even something similar already there) so they can be
tested

3. There should be a check
if ($biblionumber) {
  get the items
  etc
}
so we do not make database calls in vain

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list