The patch for bug 8437 added a system preference lookup to C4::Charset::SetMarcUnicodeFlag(), which in turn forces a dependency on C4::Context (c.f. bug 11730). This is a bit of a wart, as there's nothing else in C4::Charset that is dependent on there being a Koha database. It builds on yet another wart, introduced by commit 7eca37db, that overloads SetMarcUnicodeFlag() to set fields in the UNIMARC 100 that have nothing to do with the character encoding. This should be split apart so that - C4::Charset doesn't require a dependency on C4::Context - code that handles anything beyond setting the character set flags is moved out of SetMarcUnicodeFlag
Created attachment 38494 [details] [review] Bug 11790: Remove dependency C4::Context from C4::Charset C4::Context is only used to retrieve a syspref value. This patch moves the use of C4::Context to a require. Test plan: Try to reach the SetMarcUnicodeFlag subroutine (batchmod, add/update a biblio, etc.)
This is a quick patch and does not provide a complete fix for this issue. Feel free to provide another one.
Created attachment 39239 [details] [review] [SIGNED-OFF] Bug 11790: Remove dependency C4::Context from C4::Charset C4::Context is only used to retrieve a syspref value. This patch moves the use of C4::Context to a require. Test plan: Try to reach the SetMarcUnicodeFlag subroutine (batchmod, add/update a biblio, etc.) Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Tested on French UNIMARC install No errors adding/editing biblios No koha-qa errors
Created attachment 39958 [details] [review] [PASSED QA] Bug 11790: Remove dependency C4::Context from C4::Charset C4::Context is only used to retrieve a syspref value. This patch moves the use of C4::Context to a require. Test plan: Try to reach the SetMarcUnicodeFlag subroutine (batchmod, add/update a biblio, etc.) Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Tested on French UNIMARC install No errors adding/editing biblios No koha-qa errors Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Couldn't find any regressions.
Patch pushed to master. Thanks Jonathan!
Pushed to 3.20.x will be in 3.20.1
Patch pushed to 3.18.x will be in 3.18.08
Pushed to 3.16.x, will be in 3.16.13