I've just spend almost 1 hour to understand a bug... He's due to the redundance of _itemcount_ sub : it exists in Search.pm AND in Catalogue.pm (aka Acquisition.pm for MARC). In newbasket2.pl, in 1.2 branch it uses the Search.pm one, and that's what wanted. In newbasket2.pl, in main branch, it uses the Catalogue.pm one, and THAT'S not the right one... It can be fixed by C4::Search::itemcount innstead of itemcount. My question is : * why does it use Search in 1.2 and Catalogue in main ? you must know that the use at the beginning of the script is the same, so it's not a declaration order problem. * is it good to have the same function name in 2 packages ? I know the answer : no ! can someone propose a new name for one of those itemcounts ? (katipo/chris maybe ?) Next mail in a few minuts for sure ;-) (as kiwis are sleeping and USA are in holiday, i can send as many mails as i want, without being disturbed by an answer ;-))) ) -- Paul
On Thu, 4 Jul 2002, paul POULAIN wrote:
He's due to the redundance of _itemcount_ sub : it exists in Search.pm AND in Catalogue.pm (aka Acquisition.pm for MARC).
It looks to like the itemcount in Search.pm should be able to fill the function of the one in Catalogue/Acquisition. The first returned value is the total item count in both cases. Then there's the issue of itemcounts2 which returns a hash reference. In the future, we probably want to go with itemcounts2, renaming it to itemcounts and fixing all the scripts that call it to use the hash reference. Steve.
participants (2)
-
paul POULAIN -
Tonnesen Steve