Bug 22420: Remove wrong calculation on approved tags
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 27 Feb 2019 10:09:12 +0000 (07:09 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 8 May 2019 14:15:10 +0000 (15:15 +0100)
commitab351fdb42bcae228aa82e8f0655e4be3a231551
treef6668fec54f760d8ea9650395b4132ec318b547d
parent3477fc785fef1ca60051709509f05e296d320061
Bug 22420: Remove wrong calculation on approved tags

Before the patch from bug 14385, the passed structure (that is returned
by get_approval_rows() looks like:

\ [
    [0] {
        approved           1,
        approved_by        51,
        approved_by_name   undef,
        date_approved      "2019-02-26 15:36:42",
        term               "another",
        weight_total       3
    },
    [1] {
    ...

After the introduced 'filtering', we loose the information about the
term weight!:

\ [
    [0] {
        approved               1,
        author                 "Heylin, Clinton.",
        biblionumber           1,
        borrowernumber         51,
        date_created           "2019-02-26 15:36:37",
        language               undef,
        subtitle               [],
        tag_id                 1,
        term                   "word",
        time_created_display   "15:36:37",
        title                  "E Street shuffle :",
        visible                1,
        XSLTBloc               "
            <<<BUNCH OF GENERATED HTML HERE>>>
    ...

The code even calls GetMarcBiblio. This needs to be reverted as it is
plain wrong. If it was worth removing *some* biblios from the
weight_total value, then this calculation should be done somewhere else,
without fetching the MARC data again.

Signed-off-by: Claudio <costalc@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 28bcc5aa68733e41d50a6a801088b06857968f42)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
opac/opac-tags.pl