Bug 6043: SQL error when IndependantBranches=ON on suggestion
authorPaul Poulain <paul.poulain@biblibre.com>
Mon, 4 Apr 2011 13:19:32 +0000 (15:19 +0200)
committerChris Cormack <chrisc@catalyst.net.nz>
Mon, 4 Apr 2011 21:54:19 +0000 (09:54 +1200)
On suggestion page, when IndependantBranch=ON, the SQL built is wrong:
branchcode is ambiguous

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
C4/Suggestions.pm

index 9cb2c18..779cc7c 100644 (file)
@@ -127,7 +127,7 @@ sub SearchSuggestion  {
             if ($userenv) {
                 if (($userenv->{flags} % 2) != 1 && !$suggestion->{branchcode}){
                 push @sql_params,$$userenv{branch};
-                push @query,q{ and (branchcode = ? or branchcode ='')};
+                push @query,q{ and (suggestions.branchcode = ? or suggestions.branchcode ='')};
                 }
             }
     }