[Koha-bugs] [Bug 17600] Standardize the EXPORT

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Jul 26 16:55:03 CEST 2021


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

--- Comment #114 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
(In reply to Katrin Fischer from comment #108)
> Just wondering about the implications of this as I did some easy rebases
> today. Should we ask for new use statements always having the methods used
> added with qw? Should there be a coding guideline/QA test?

I've tried to explain in the commit message.
Basically you need to
1. Use EXPORT_OK instead of EXPORT in modules
2. either
  use Module qw( method_1 method_2 );
  method_1();

or 
  use Module;
  Module::method_1();

Ideally we should pick one version and stick to that. But there is still a mix
of both everywhere in the codebase.

We don't really need a guideline because:
- We must not add new modules to C4
- The EXPORT_OK should be there now, so you have to write the imports/calls
correctly of the execution will explode.

(In reply to Marcel de Rooy from comment #109)
> [WARN] Prototype mismatch: sub Koha::I18N::LC_MESSAGES: none vs () at
> /usr/share/koha/Koha/I18N.pm line 36.
> 
> Locale::Messages exports a sub LC_MESSAGES without prototype.
> And after we do 'use POSIX;' with a default import that probably includes
> LC_MESSAGES from locale_h ?

Last patch fixes that.

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


More information about the Koha-bugs mailing list