https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20307
Martin Renvoize <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #97075|0 |1 is obsolete| | --- Comment #94 from Martin Renvoize <[email protected]> --- Created attachment 98876 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98876&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 | Signed-off-by: Martin Renvoize <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
