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

--- Comment #14 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 206840
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206840&action=edit
Bug 12146: Set isocode on locale-specific sample currencies, and avoid
collisions with the base currency set

pl-PL, ru-RU, nb-NO, and uk-UA's localization/custom.sql each insert
their own region-specific currencies (PLN, UAH, RUB, NOK) on top of
whatever sample data set the installer user selected. Since the
previous commit in this series added every active ISO 4217 code
(including these four) to the base "Some basic currencies" optional
dataset, an installer run in one of these locales that also selects
that optional dataset would now hit a primary key collision: the
locale file's plain INSERT would fail silently (load_sql just warns
and moves on), leaving the generic blank-symbol/inactive row from the
base set in place instead of the locale's own rate/symbol/active
values.

Switch these INSERTs to INSERT ... ON DUPLICATE KEY UPDATE so they
correctly override the base set's entry for the same currency
regardless of load order, and set isocode on each of them - the
original ask of this bug, just never delivered for anything beyond
the English dataset.

Test plan:
1) Load installer/data/mysql/en/optional/parameters.yml, then run one
   of these localization/*/custom.sql files against the same database
   and confirm no errors and the currency ends up active with its
   locale-specific rate/symbol (e.g. for pl-PL:
   SELECT * FROM currency WHERE currency = 'PLN' should show
   isocode='PLN', symbol='zł', active=1)
2) Run a fresh web installer choosing the pl-PL (or ru-RU/nb-NO/uk-UA)
   language and the "Some basic currencies..." optional dataset,
   confirm the locale's currency ends up active with the right symbol

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to