Koha-clms/Koha
Jonathan Druart 7847081c52 Bug 15446: Rename Koha::Object[s]->type with _type
In a few case (at least systempreferences and export_format (csv profiles),
the type method of Koha::Object and Koha::Objects can be in conflict with the
column names.
Indeed systempreferences.type exists and so the method will return
'Systempreference' (the name of the module) instead of the value of the row in
DB.

I have found at least 1 place where it can cause issue:
In C4::Context->set_preference:
 601     my $syspref = Koha::Config::SysPrefs->find( $var );
 602     my $type = $syspref ? $syspref->type() : undef;
 603
 604     $value = 0 if ( $type && $type eq 'YesNo' && $value eq '' );

type will always be 'Systempreference' and the YesNo pref will be set to an
empty string '' instead of 0.

I am not sure about the consequences of this, but it is preferable to
fix it ASAP.

To reproduce:
0/ Do not apply this patch
1/ Edit a YesNo prefs, AutoEmailOpacUser for instance
2/ Set it to "Don't sent"
3/ Check the value in DB, it should be set to an empty string, instead
of 0
4/ Apply this patch and try again. Now the value should be 0

Followed test plan, value is now 0 as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
(cherry picked from commit de3289506d)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Conflicts:
	Koha/Branch.pm
	Koha/Branches.pm
2016-03-14 11:10:25 +01:00
..
Acquisition Bug 13319: Fix Koha::Acq::Order should set parent_ordernumber 2015-02-10 11:24:08 -03:00
Borrower Bug 14368: Add discharges history. 2015-09-28 11:56:33 -03:00
Cache Bug 12041 - improve Koha::Cache 2014-06-19 13:05:04 -03:00
Config Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Exporter Bug 14722: Refactor the export tool 2015-10-27 17:01:28 -03:00
Filter/MARC Bug 14456: EmbedSeeFromHeadings record filter shouldn't process MARC holding fields 2015-07-24 13:39:53 -03:00
Indexer Bug 10143 - Fixing license headers 2013-05-01 06:47:50 -04:00
Item/Search Bug 11425: Add unit tests 2014-11-04 19:10:28 -03:00
List Bug 15065: (follow-up) update license header 2013-10-14 21:50:10 +00:00
Misc Bug 13813: Remove deprecated module C4::Dates from system 2015-09-18 12:40:55 -03:00
Number Bug 13836: Does not separate symbol and value if symbol is not displayed. 2015-03-19 14:10:21 -03:00
Patron Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Plugins Bug 14467: Security updates break some Koha plugins 2015-07-07 14:50:43 -03:00
QueryParser/Driver Bug 15258: Fix Perl scripts declaring unused variables 2015-12-31 14:32:53 +01:00
REST Bug 13799: Reword 'borrower' to 'patron' 2015-11-04 13:47:33 -03:00
RecordProcessor Bug 15777 - Fix base class to prove refactor and fix required 2016-02-26 16:30:45 +01:00
Schema/Result Bug 15517: Update DB rev (3.22.03.003) 2016-02-26 15:19:33 +01:00
Sitemapper Bug 11190: (QA followup) for tests on jenkins 2015-08-31 10:32:34 -03:00
SuggestionEngine Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
Template/Plugin Bug 15135: Remove Warning Subroutine HasOverdues redefined 2016-01-29 11:50:14 +01:00
Util Bug 8064: Merge several biblios 2015-11-09 15:08:57 -03:00
AdditionalField.pm Bug 10855: Remove additional field values when subscription is removed 2015-10-02 15:10:31 -03:00
AudioAlert.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
AudioAlerts.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
AuthUtils.pm Bug 11944: Authentication 2015-01-13 13:07:14 -03:00
AuthorisedValue.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
AuthorisedValues.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Authority.pm Bug 5202: QA follow-up - correct license and POD errors 2013-10-10 21:39:15 +00:00
Biblio.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Biblioitem.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Biblioitems.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Biblios.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Borrower.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Borrowers.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Branch.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Branches.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Cache.pm Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
Calendar.pm Bug 14522: (QA followup) Remove POD and fix tests 2015-10-02 12:08:04 -03:00
Cities.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
City.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Database.pm Bug 15760: Avoid SQL injections 2016-02-12 09:35:32 +01:00
DateUtils.pm Bug 12072: Add system preference for New dateformat dd.mm.yyyy (dmydot) 2015-11-19 13:12:00 -03:00
Email.pm Bug 9530: Adding a new Koha::Email module 2014-10-27 10:38:14 -03:00
Exceptions.pm Bug 14544: QA fixes - some minor bug fixes 2015-11-05 10:00:31 -03:00
FrameworkPlugin.pm Bug 9006: Remove AUTOLOAD in C4::Context 2015-07-20 10:11:41 -03:00
Hold.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Holds.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
I18N.pm Bug 11848: (follow-up) update license statment 2014-05-05 04:51:42 +00:00
Item.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Items.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Linktracker.pm Bug 8917 : [ Sign followup ] Track clicks to links external to Koha 2013-03-07 11:14:25 -05:00
Localization.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Localizations.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Logger.pm Bug 14167: (QA followup) use warn instead of just STDERR 2015-07-21 10:50:17 -03:00
MetaSearcher.pm Bug 15258: Fix Perl scripts declaring unused variables 2015-12-31 14:32:53 +01:00
MetadataRecord.pm Bug 15578: Make sure all params will be taken into account when instantiating 2016-02-17 19:50:46 +01:00
NorwegianPatronDB.pm Bug 14403: Remove warn in Koha::NorwegianPatronDB 2015-06-19 11:34:16 -03:00
Object.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Objects.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Plugins.pm Bug 15743: Allow plugins to embed Perl modules 2016-02-26 16:26:39 +01:00
RecordProcessor.pm Bug 15777 - Refactor and fix the RecordProcessor class 2016-02-26 16:30:46 +01:00
Schema.pm Bug 11891: (follow-up) remove custom storage class 2014-06-19 11:55:03 -03:00
SimpleMARC.pm Bug 14098: Implement the copy_and_replace action for MTT 2015-09-07 11:17:13 -03:00
Sitemapper.pm Bug 11190: (QA followup) for tests on jenkins 2015-08-31 10:32:34 -03:00
SuggestionEngine.pm Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
Upload.pm Bug 14893: Separate temporary storage per instance in Upload.pm 2016-02-01 17:25:31 +01:00
Virtualshelf.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Virtualshelfcontent.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Virtualshelfcontents.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Virtualshelfshare.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Virtualshelfshares.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
Virtualshelves.pm Bug 15446: Rename Koha::Object[s]->type with _type 2016-03-14 11:10:25 +01:00
XSLT_Handler.pm Bug 13262 - Add parameters to XSLT Handler transform method 2015-02-05 15:24:29 -03:00