Commit graph

2975 commits

Author SHA1 Message Date
28d81cb7bb Bug 17767 - DBRev 16.12.00.001
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-12-28 13:59:03 +00:00
af976a7fc6 Bug 17767: Add borrower_modification.extended_attributes
This patch changes the DB structure adding borrower_modifications.extended_attributes

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-12-28 13:53:01 +00:00
c9e95aa22e Bug 17666: Revert "Bug 16685 [QA Followup] - Use Path::Tiny::slurp instead of File::Slurp"
This reverts commit 7ac1bc3537.

On a kohadevbox:
Error flock (1) on
'/home/vagrant/kohaclone/installer/data/mysql/atomicupdate/bug_xxxx.perl':
No locks available at installer/data/mysql/updatedatabase.pl line 13637.

This is because Path::Tiny->slurp[_utf8] uses flocks which does not work
with NFS

Test plan:
Execute a .perl atomic update file on a kohadevbox
=> Without this patch you should get the flock error
=> With this patch the update should work fine

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-12-16 11:14:49 +00:00
Katrin Fischer
f0cb5c43dc Bug 17577: Improve sample notices for article requests
- Adds "Dear..."
- Fixes capitalization
- Removes 'E-mail' from the description as you could also have
  a print template

To test:
- Make sure the SQL has no errors
- Install the letters and proof read them

If you agree - sign off!

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-29 17:45:44 +00:00
6f4cbc8dad Bug 17676: Update default COLLATE of marc_subfield_structure
(This issue has been raised on bug 17216 comments 93-103)
On bug 11944 (3.19.00.006) we updated the default COLLATE for all our tables to
utf8_unicode_ci but not the marc_subfield_structure table.
Indeed we want to keep tagsubfield a utf8_bin (to allow lowercase and uppercase
of the same letter for subfields).
We should have set the default collate to utf8_unicode_ci for further changes.

This patch updates the DB entry 3.19.00.006 to set the default COLLATE to this
table (for people upgrading from prior to 3.19.00.006) and set this
default COLLATE on 16.06.00.033 (for people upgrading from after 3.19.00.006).

The error is:
DBD::mysql::db do failed: Can't create table `koha_kohadev`.`#sql-306_9f9` (errno: 150 "Foreign key constraint is incorrectly formed") [for Statement "
            ALTER TABLE marc_subfield_structure
            MODIFY COLUMN authorised_value VARCHAR(32) DEFAULT NULL,
            ADD CONSTRAINT marc_subfield_structure_ibfk_1 FOREIGN KEY (authorised_value) REFERENCES authorised_value_categories (category_name) ON UPDATE CASCADE ON DELETE SET NULL;
            "] at installer/data/mysql/updatedatabase.pl line 13175.
Upgrade to 16.06.00.033 done (Bug 17216 - Add a new table to store authorized value categories)

Test plan:
1/ git checkout v3.18.00
2/ Do an install
3/ git checkout master;
4/ perl installer/data/mysql/updatedatabase.pl
=> Without this patch, you get the error
=> With this patch applied you will not get it and the default COLLATE for
marc_subfield_structure will be correctly set. Make sure tagsubfield is
still utf8_bin

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Will put some notes on the Bugzilla report.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-29 17:41:34 +00:00
5485f10ed2 DBRev 16.12.00.000 - the road goes ever on
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-29 17:38:30 +00:00
3c9d916641 Bug 17292 Follow-up, fix typos
- wrong assignation
- reference to 'serials' table rather than 'serial'

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-28 11:54:46 +00:00
7636c68d76 DBRev 16.11.00.000
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-22 17:48:00 +00:00
312783f8fc Bug 8835 - DBRev 16.06.00.050 2016-11-22 17:45:35 +00:00
88b4baceee Bug 8835: New db rev for issn_idx
This db rev reapplies dbrev 3.15.00.049 in case that one failed due to
existence of issn_idx.

Test plan:
If you do not have index issn_idx, recreate it:
    ALTER TABLE biblioitems ADD INDEX issn_idx (issn (255))
Run this db rev. You should see: Removed issn_idx.
Rerun the dbrev. You should see: Everything is fine.

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
2016-11-22 17:45:29 +00:00
0fee84690e Bug 8835: Drop issn_idx for completeness
When dbrev 3.15.00.049 failed, the still existing issn_idx must have
been the cause.
This patch only adjusts the old db rev.
Still thinking if we also need a new db rev to fix isbn and issn for
those installs where 3.15.00.049 failed too. (In that case the fields
may not have been changed to mediumtext and no indexes were added.)

Test plan:
Ideally, run an upgrade from something older than 3.15.00.49.
But running the added sql command from the command line might convince
you too.

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
2016-11-22 17:45:21 +00:00
141538fb51 Bug 17391 - DBRev 16.06.00.049
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-22 11:38:26 +00:00
0a84274f6b Bug 17391 (QA Followup) use INSERT INGORE in atomicupdate
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-22 11:36:08 +00:00
49f8e05b20 Bug 17391: Fix number of values in sysprefs.sql
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-22 11:36:07 +00:00
d785cd5b0a Bug 17391: Add atomic update file
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-22 11:36:07 +00:00
Katrin Fischer
15e57368bb Bug 17391: Add missing prefs to sysprefs.sql
Adds
- ReturnpathDefault
- ReplytoDefault
to the sysprefs.sql file.

To test:
- Run the web installer in any language
- Check all preferences are installed without error
- Check prefs listed above now exsit in your
  systempreferences table

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-22 11:36:07 +00:00
d9be9950b3 Bug 17663 - DBRev 16.06.00.048
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-21 16:34:46 +00:00
9ca72539de Bug 17663: Forgotten userpermissions from bug 14686
Bug 14686 added in a dbrev:
    (13, 'upload_general_files', 'Upload any file'),
    (13, 'upload_manage', 'Manage uploaded files');

But these were not added in userpermissions.sql somehow :)
So, what now?

This patch:
[1] adds them to userpermissions.sql as should have been done,
[2] adds a dbrev to add them for newer installs that did not run the
    14686 dbrev.

Test plan:
[1] Run this sql statement:
    DELETE FROM permissions WHERE code = 'upload_general_files' OR
        code = 'upload_manage'
[2] Run the db rev.
[3] Check if you see Tools/Upload (with sufficient perms).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-21 16:33:16 +00:00
Katrin Fischer
ccdd661851 Bug 17543: Update German web installer sample files for 16.11
Updates sample files with German translations:
- Sample notices for article requests

To test:
- Make sure the German web installer installs all
  sample files correctly.
- Bonus: check German translations.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested german installer/translation
No errors

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Amended patch:
- Authorised value HSBND_FREQ
is done by bug 17576 (and correctly translated in German)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 15:55:03 +00:00
Alex Sassmannshausen
722d045986 Bug 17576: Add housebound mandatory auth_values.
* installer/data/mysql/de-DE/mandatory/auth_values.sql: Add values.
* installer/data/mysql/es-ES/mandatory/auth_values.sql: Add values.
* installer/data/mysql/fr-CA/obligatoire/auth_values.sql: Add values.
* installer/data/mysql/fr-FR/1-Obligatoire/authorised_values.sql: Add
  values.
* installer/data/mysql/it-IT/necessari/auth_val.sql: Add values.
* installer/data/mysql/nb-NO/1-Obligatorisk/auth_values.sql: New file.
* installer/data/mysql/pl-PL/mandatory/auth_values.sql: New file.
* installer/data/mysql/ru-RU/mandatory/auth_values.sql: New file.
* installer/data/mysql/uk-UA/mandatory/auth_values.sql: New file.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 13:55:23 +00:00
ba43bdb4f9 Bug 17659: Fix sample_notices.sql for fr-CA
branchcode and is_html columns are present in this file

Test plan:
mysql < installer/data/mysql/fr-CA/obligatoire/sample_notices.sql
should not return any errors

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-18 13:54:40 +00:00
674d3875c8 Bug 17518 - DBRev 16.06.00.047
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-02 11:02:09 +00:00
de2ba75c25 Bug 17518: Displayed language name for Czech is wrong
It's "Ceština" and should be "Čeština"

Test plan:
1) apply the patch
1.1) update database
2) install Czech translation for Koha
3) note the language name in language switcher (in staff client and
    opac) is right: "Čeština"

Signed-off-by: radiuscz <radek.siman@centrum.cz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-02 11:00:35 +00:00
e67c202609 Bug 15581 - DBRev 16.06.00.046
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-02 10:53:35 +00:00
53dfa99727 Bug 15581: Add a circ rule to limit the auto renewals given a delay
This patch adds a new circulation rule (no_auto_renewal_after) to block/allow
auto renewals after a given delay.
For instance, if the issue date is 10 days before today, and
no_auto_renewal_after is set to 10, tomorrow the issue won't be auto
renewed.

Test plan:
0/ Execute the update DB entry
Note: You will have to manually change data in your DB, make sure you
have access to the sql cli.
1/ Define a rule with no_auto_renewal_after (10 for instance) and
norenewalbefore (5 for instance).
(This new rule will behave the same as norenewalbefore: the unit depends
on the lengthunit value).
The automatic renewals will be done from 5 to 10 days ahead.
2/ Modify the issues.issuedate, to simulate a checkout in the past:
    UPDATE issues
    SET issuedate = "yyyy-mm-dd hh:mm:ss"
    WHERE itemnumber = YOUR_ITEMNUMBER;
with issuedate = 2 days before for instance
3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl)
Confirm that the issue has not been renewed (too soon)
4/ Repeat step 2 with a due date set as 11 days before
5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl)
Confirm that the issue has not been renewed (too late)
6/ Repeat step 2 with a due date set as 7 days before
7/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl)
Confirm that the issue has been renewed (issues.renewals has been
incremented and date_due has been updated according your circ rules).

Sponsored-by: University of the Arts London
Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-02 10:28:57 +00:00
81eec722da Bug 14874: (followup) Fix typo introduced in sysprefs.sql
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-11-01 15:59:17 +00:00
10b3bb8f46 Bug 17443 - DBRev 16.06.00.045
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 16:51:58 +00:00
0a85759d33 Bug 17443: Make possible to renew patron by later of expiry and current date
Test plan
1) Apply the patch
2) Go to system preferences and find the BorrowerRenewalPeriodBase and note there is new option "the later of current and expiry date"
3) Try all three options and confirm they work as expected
   3.1) The new options should be tested et least with two patrons - one with expiry date in past and one with expiry date in future

Signed-off-by: radiuscz <radek.siman@centrum.cz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 16:45:05 +00:00
ade5362586 Bug 17397 - DBRev 16.06.00.044
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 15:43:20 +00:00
3d63c64915 Bug 17397: Show name of librarian who created circulation message
Test plan:
1) Apply the patch
2) Update DB structure
3) Run update_dbix_class_files.pl
4) Select patron for checking out
5) Try to add some circulation and opac messages
6) Note that now there is creator (you ;) ) shown by every message added (with link to creator profile)
7) Try to delete messages to confirm that everything works as expected

Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 15:37:27 +00:00
8767434021 Bug 17356: [QA Follow-up] Minor changes to skeleton.perl
Due to the way the snippet is run, there is no need to add a use for
C4::Installer or define $dbh (just like $DBVersion).
The suggested code is commented (column_exists is not defined).
Just as in updatedatabase, CheckVersion is called. The version number
does not need to contain 16.06; if we do so, we should update this
number each release. The XXX's work just fine.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 14:47:05 +00:00
Liz Rea
4be8768a6e Bug 17356 - update README
Test plan:
Look at the README and make sure it makes sense.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 14:47:04 +00:00
3f7098a02f Bug 17356: Add atomic update .perl skeleton file
To show devs how it should be written.

Test plan:
% cp installer/data/mysql/atomicupdate/skeleton.perl
installer/data/mysql/atomicupdate/bug_XXXXX.perl
% perl installer/data/mysql/updatedatabase.pl

You should see:
DEV atomic update: bug_xxxxx.perl
Upgrade to 16.06.00.XXX done (Bug XXXXX - description)

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Very good. I'll submit a patch for the readme to make the instructions better.

Signed-off-by: Liz Rea <liz@catalyst.net.nz>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 14:47:04 +00:00
25adf52334 Bug 13323 - DBRev 16.06.00.043
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 14:28:40 +00:00
9beffec5aa Bug 13321 - DBRev 16.06.00.042
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 14:23:24 +00:00
Jonathan Druart
1204a7269f Bug 13323: Tax rate can change on receiving - DB changes
This patch adds 4 new DB fields to the aqorders table:
 * tax_rate_on_ordering
 * tax_rate_on_receiving
 * tax_value_on_ordering
 * tax_value_on_receiving

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Francois Charbonnier <francois.charbonnier@inlibro.com>

Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 13:46:40 +00:00
Alex Arnaud
6eaf0c0d20 Bug 13321: Adds renaming of gstrate column in kohastructure.sql
Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 13:46:09 +00:00
Jonathan Druart
43f93f2ee8 Bug 13321: Tax and prices calculation - DB Changes
This patch adds 7 columns to the aqorders table:
 * unitprice_tax_excluded
 * unitprice_tax_included
 * rrp_tax_excluded
 * rrp_tax_included
 * ecost_tax_excluded
 * ecost_tax_included
 * tax_value

It also renames:
 * aqorders.gstrate with aqorders.tax_rate
 * aqbooksellers.gstrate with aqbooksellers.tax_rate

The new columns are filled with the previous calculation method.

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Francois Charbonnier <francois.charbonnier@inlibro.com>

Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 13:46:07 +00:00
c7bc14cead Bug 14629 - DBRev 16.06.00.041
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:59:55 +00:00
0790de1321 Bug 14629 - (QA Followup) sysprefs.sql changes
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:58:14 +00:00
68ced964fd Bug 14629 - Add aggressive ISSN matching feature equivalent to the aggressive ISBN matcher
This patch adds a syspref "AggressiveMatchOnISSN" allowing for a match
of ISSNs with or without hyphens. It uses Business::ISSN in order to
follow the use of Business::ISBN and allow for validation of ISSNs

To test:
1 - Find a record in your system with an ISSN (or add one)
2 - Stage a record containing the same ISSN but lacking a hyphen
3 - Matching on ISSN should find 0 matches
4 - Repeat with no hyphen ISSN in system and hyphen ISSN in import
5 - Matching should find 0
6 - Apply patch
7 - Update datbase and install Business::ISSN
8 - Leave AggressiveMatchOnISSN as don't and repeat original tests- no
change
9 - Set AggressiveMatchOnISSN as do and repeat original test
10 - You should find a match
11 - prove t/Koha.t - all tests pass

Sponsored by North Central Regional Library System (NCRL) www.ncrl.org

Signed-off-by: Chad Roseburg <croseburg@ncrl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:58:14 +00:00
2354e41b61 Bug 5260 - DBRev 16.06.00.040
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:54:58 +00:00
28ef209c81 Bug 5260: Insert the new letter for existing installs
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:52:27 +00:00
Katrin Fischer
f8472e1686 Bug 5260: QA follow-up - Add sample ACQORDER notice to sample notices
Adds the new notice ACQORDER to all web installers.

Verify by testing the SQL contains no errors and by running:
perl xt/sample_notices.t

NOTE:
- de-DE is already translated, others are in English.
- xt/sample_notices.t doesn't check fr-CA yet. I didn't fix this here
  as the file is missing other notices as well which should be fixed
  separately.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:52:27 +00:00
Katrin Fischer
9af64aa7d5 Bug 5260 - Add option to send an order by e-mail to the acquisition module
With this patch it will be possible to send order information
to the vendor by e-mail. For now this feature can be triggered
manually with a button before closing the basket.
The order e-mail is based on the acquisition claim feature, but
uses a new notice template.

Test plan:

1) Vendors
A new checkbox "Contact when ordering?" was added to the vendor
page.
- Add a vendor and/or edit an existing vendor
- Verify the new option is saved correctly
- Verify the new option displays on the vendor summary page
  after saving

2) Notices
The feature works with a new notice template: ACQORDER
It works with the same formatting/fields etc. as the acq claim
notice.
- Add a new notice template ACQORDER in module
  'Claim/order aquisition'
- Make sure to use fields from the various offered tables
  in your notice
- Verify it is saved correctly

3) Basket
- Turn on LetterLog system preference
- Create multiple order lines
- Click the 'Send order' button in the toolbar
- Verify error or success message
- Verify you received the e-mail
- Verify there is a new entry with about the sent
  notice in your action_logs table

4) Regression testing...
- Verify order claims still work
- Verify serial claims still work
- Verify new serial issue notices still work
...
(I can provide additional test plans if needed)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:52:25 +00:00
5d5a1509d1 Bug 14598 - DBRev 16.06.00.039
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:30:38 +00:00
3660c451a3 Bug 14598: [QA Follow-up] Small changes
[1] Renames the dbrev version to XXX; adding a my for $sth, although
    not strictly necessary it feels better.
[2] Circulation.t stumbles over:
    Undefined subroutine &C4::Circulation::GetItem called at ... line 1283.
    Somehow this is related to use_ok instead of a regular use.
    Worked around this by require_ok and adding a regular use.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:29:59 +00:00
Tomas Cohen Arazi
3fa514133b Bug 14598: (QA followup) use deleted{items|biblioitems} during upgrade
If the 'statistics' table contains circulation information about items
that are no longer on the DB it will raise a warning. This patch
makes the updatedatabase.pl script use the deleteditems and deletedbiblioitems
tables to get information for those items on the statistics table.

To reproduce:
- Have your sample DB contain some circulation data on the statistics table
- Make sure some of them have NULL itemtype:
> UPDATE statistics SET itemtype = NULL WHERE type='return';
- Check the upgrade query catches them:
> SELECT s.itemnumber, i.itype, b.itemtype FROM  ( SELECT DISTINCT itemnumber    FROM statistics    WHERE ( type = "return" OR type = "localuse" ) AND itemtype IS NULL ) s  LEFT JOIN  ( SELECT itemnumber,biblionumber, itype      FROM items    UNION    SELECT itemnumber,biblionumber, itype      FROM deleteditems ) i  ON (s.itemnumber=i.itemnumber)  LEFT JOIN  ( SELECT biblionumber, itemtype      FROM biblioitems    UNION    SELECT biblionumber, itemtype      FROM deletedbiblioitems ) b  ON (i.biblionumber=b.biblionumber);
+------------+-------+----------+
| itemnumber | itype | itemtype |
+------------+-------+----------+
|        732 | BK    | BK       |
|        731 | BK    | BK       |
+------------+-------+----------+
2 rows in set (0.00 sec)

- Delete the items, and some biblio too.
- Re-run the query
=> SUCCESS: Same results
- Go reset to NULL the itemtypes
> UPDATE statistics SET itemtype = NULL WHERE type='return';
- Run the updatedatabase.pl script:
 $ sudo koha-shell koahdev ; cd kohaclone
 $ perl installer/data/mysql/updatedatabase.pl
=> SUCCESS: No warnings

Note: It is possible that on production sites, if the sysadmin is cleaning the
deleted{items|biblioitems|biblio} tables, there will be warnings. This is expected
as they need to know some data lacks information.

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:29:59 +00:00
c042307db3 Bug 14598 [QA Followup] - Update localuse statistics also
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:29:58 +00:00
2cdec7ff91 Bug 14598: (DB update) fix NULL itemtypes in statistics on 'return' rows
This patch introduces an updatedatabase.pl entry that takes care of
updating existing statistics rows.

It does so by looping on the statistics rows, collecting itemnumber occurences
that are have NULL itemtypes.
It then chooses the right itemtype following what is proposed on bug 14651, and
then updates the rows in statistics using the calculated itemtype.

Regards

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-10-28 11:29:57 +00:00