Koha/t
Jonathan Druart 9d6d641d1f Bug 17600: Standardize our EXPORT_OK
On bug 17591 we discovered that there was something weird going on with
the way we export and use subroutines/modules.
This patch tries to standardize our EXPORT to use EXPORT_OK only.

That way we will need to explicitely define the subroutine we want to
use from a module.

This patch is a squashed version of:
Bug 17600: After export.pl
Bug 17600: After perlimport
Bug 17600: Manual changes
Bug 17600: Other manual changes after second perlimports run
Bug 17600: Fix tests

And a lot of other manual changes.

export.pl is a dirty script that can be found on bug 17600.

"perlimport" is:
git clone https://github.com/oalders/App-perlimports.git
cd App-perlimports/
cpanm --installdeps .
export PERL5LIB="$PERL5LIB:/kohadevbox/koha/App-perlimports/lib"
find . \( -name "*.pl" -o -name "*.pm" \) -exec perl App-perlimports/script/perlimports --inplace-edit --no-preserve-unused --filename {} \;

The ideas of this patch are to:
* use EXPORT_OK instead of EXPORT
* perltidy the EXPORT_OK list
* remove '&' before the subroutine names
* remove some uneeded use statements
* explicitely import the subroutines we need within the controllers or
modules

Note that the private subroutines (starting with _) should not be
exported (and not used from outside of the module except from tests).

EXPORT vs EXPORT_OK (from
https://www.thegeekstuff.com/2010/06/perl-exporter-examples/)
"""
Export allows to export the functions and variables of modules to user’s namespace using the standard import method. This way, we don’t need to create the objects for the modules to access it’s members.

@EXPORT and @EXPORT_OK are the two main variables used during export operation.

@EXPORT contains list of symbols (subroutines and variables) of the module to be exported into the caller namespace.

@EXPORT_OK does export of symbols on demand basis.
"""

If this patch caused a conflict with a patch you wrote prior to its
push:
* Make sure you are not reintroducing a "use" statement that has been
removed
* "$subroutine" is not exported by the C4::$MODULE module
means that you need to add the subroutine to the @EXPORT_OK list
* Bareword "$subroutine" not allowed while "strict subs"
means that you didn't imported the subroutine from the module:
  - use $MODULE qw( $subroutine list );
You can also use the fully qualified namespace: C4::$MODULE::$subroutine

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-07-16 08:58:47 +02:00
..
Acquisition Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Biblio Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Budgets Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Circulation Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
data Bug 28385: Add tests 2021-05-25 09:45:22 +02:00
db_dependent Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
edi_testfiles
etc Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
External Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Koha Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
lib Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Members Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Number Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Search Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Serials Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SIP Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Test Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
00-checkdatabase-version.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
00-deprecated.t
00-load.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
00-merge-conflict-markers.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
00-testcritic.t
00-valid-xml.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Auth.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Auth_with_shibboleth.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
AuthoritiesMarc_MARC21.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
AuthoritiesMarc_UNIMARC.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Barcodes_annual.t
Barcodes_EAN13.t
Barcodes_hbyymmincr.t
Barcodes_incremental.t
Biblio.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Biblio2.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Budgets.t
Calendar.t Bug 25802: Change addDate to addDuration 2021-01-22 14:59:27 +01:00
Charset.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Circulation_barcodedecode.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSortRoutine.t
ClassSortRoutine_Dewey.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSortRoutine_Generic.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSortRoutine_LCC.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSource.t
Context.t Bug 27673: Fix t/Context.t 2021-02-17 09:21:14 +01:00
Contract.t
Creators.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
DateUtils.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
dummy.t
Edifact.t Bug 18267: (QA follow-up) fix typo: overriden => overridden 2020-11-24 09:52:36 +01:00
EdiInvoice.t Bug 18267: Refactored Edifact Price Calculations 2020-11-16 13:46:48 +01:00
Ediorder.t
Ediordrsp.t
EdiTransport.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Form_MessagingPreferences.t
HtmlTags.t
ImportBatch.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Installer_PerlModules.t Bug 27673: Replace YAML with YAML::XS 2021-02-16 14:54:50 +01:00
Installer_pm.t
ItemCirculationAlertPreference.t
Koha.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Koha_MetadataRecord.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Koha_SearchEngine_Elasticsearch_Browse.t
Koha_Template_Plugin_Cache.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Koha_Template_Plugin_HtmlId.t Bug 27336: Sanitize correctly HTML id 2021-01-11 10:27:37 +01:00
Koha_Template_Plugin_Koha.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Koha_Util_FrameworkPlugin.t
Koha_Util_MARC.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Labels.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Labels_split_ccn.t
Labels_split_ddcn.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Labels_split_lccn.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Labels_split_Regex.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Languages.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Letters.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Logger.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Makefile.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Matcher.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Members_Messaging.t
OpenLibrarySearch.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Output.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Output_JSONStream.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Patron.t
Patroncards.t
Patroncards_Batch.t
Patroncards_Lib.t
Patroncards_Patroncard.t
Patroncards_Profile.t
Patroncards_Template.t
Prices.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
RecordProcessor.t
Ris.t
Scheduler.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Scrubber.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Search.t
Search_PazPar2.t
SimpleMARC.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SMS.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SocialData.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Stats.t
SuggestionEngine.t
SuggestionEngine_AuthorityFile.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
template_filters.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
timezones.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
TmplToken.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Token.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
XSLT.t