From 9af8f6803b5783ed046456a31a8c17a1d9a8334c Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@biblibre.com>
Date: Mon, 17 Dec 2012 11:04:07 +0100
Subject: [PATCH] Bug 7919: FIX the "all" categories method

The C4::Category->all method must return fields from the categories
table only.
Without this patch, there is 2 "categorycode" values, the second one is
sometimes undef (if no branch limitation).
---
 C4/Category.pm |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/C4/Category.pm b/C4/Category.pm
index fcb3ed8..255db2b 100644
--- a/C4/Category.pm
+++ b/C4/Category.pm
@@ -79,7 +79,7 @@ sub all {
     my $dbh = C4::Context->dbh;
     # The categories table is small enough for
     # `SELECT *` to be harmless.
-    my $query = "SELECT * FROM categories";
+    my $query = "SELECT categories.* FROM categories";
     $query .= qq{
         LEFT JOIN categories_branches ON categories_branches.categorycode = categories.categorycode
         WHERE categories_branches.branchcode = ? OR categories_branches.branchcode IS NULL
-- 
1.7.10.4