[Koha-bugs] [Bug 20307] Language overlay for authorized values

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jan 9 14:19:30 CET 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20307

--- Comment #79 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 97075
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97075&action=edit
Bug 20307: Fix logic in search_with_localization and add tests

Maybe we will want to replace this method at some point. There was
something wrong in the logic.

I did not manage to implement what I really needed here.

The real SQL query we need is:
SELECT SELECT *,
            COALESCE( `localization_intranet`.`translation`, `me`.`lib` ) AS
`translated_description`,
            COALESCE( `localization_opac`.`translation`, `me`.`lib` ) AS
`opac_translated_description`
        FROM `authorised_values` `me`
        LEFT JOIN (SELECT localization_id, code, lang, translation FROM
localization WHERE entity='authorised_values' AND interface='intranet')
`localization_intranet` ON ( `localization_intranet`.`lang` = 'es-ES' AND
CONCAT(me.category, '_', `me`.`authorised_value`) =
`localization_intranet`.`code` )
        LEFT JOIN (SELECT localization_id, code, lang, translation FROM
localization WHERE entity='authorised_values' AND interface='opac')
`localization_opac` ON ( `localization_opac`.`lang` = 'es-ES' AND
CONCAT(me.category, '_', `me`.`authorised_value`) = `localization_opac`.`code`
)
        WHERE me.category="?" ORDER BY `translated_description`;

So 2 left join on the same table, with different on clause (to deal with
the 2 interfaces)
That would give us something like:
| id  | category | authorised_value | lib  | lib_opac | imageurl |
translated_description | opac_translated_description |

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


More information about the Koha-bugs mailing list