Commit Graph

25606 Commits

Author SHA1 Message Date
Marc Véron a9cdbade43 Bug 16729: Use member-display-address-style*-includes when printing user summary
This patch replaces the address part in moremember-print.tt to print identical
address information as displayed on the screen (including street numer, formatted as required by syspref 'AddressFormat'

To test:
- Apply patch
- Search for a user with all address information filled
- Verify that 'Print summmary' displays the same information
  as displayed on the screen.
- Change value of syspref 'AdressFormat'
- Verify that address format on 'Print summary' changes
  as appropriate

Signed-off-by: mehdi <mehdi@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 555f40626a)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 546b95aee4)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 09:44:47 +02:00
Julian Maurice 3788402fd2 Bug 16693: Remove reserve/renewscript.pl
It is not used since bug 11703

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c92d0823f8)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 5fd657a8fc)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 09:42:30 +02:00
Owen Leonard f29b93e3ab Bug 16543 - Make edit and delete links styled buttons in patron attribute types administration
This patch modifies the Patron attribute types page, converting edit and
delete links to Bootstrap buttons with Font Awesome icons.

To test, apply the patch and go to Administration -> Patron attribute
types. The 'Edit' and 'Delete' buttons should look correct and work
correctly.

Signed-off-by: Jan Kissig <jkissig@th-wildau.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ae4be45444)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 1dfbe758c2)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 09:41:00 +02:00
Owen Leonard 500ab63cb7 Bug 16541 - Make edit and delete links styled buttons in cities administration
This patch modifies the cities administration page, converting edit and
delete links to Bootstrap buttons with Font Awesome icons.

To test, apply the patch and go to Administration -> Cities and towns.
The 'Edit' and 'Delete' buttons should look correct and work correctly.

Signed-off-by: rainer <archiv@a-bibliothek.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 51a11d2794)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit ef948191c6)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 09:39:52 +02:00
Owen Leonard 2d3af770db Bug 16127 - Add discharge menu item to patron toolbar
This patch changes the "Discharge" menu in the patron sidebar to read
"Discharges," and adds a "Discharge" menu item to the patron toolbar.

This adds some redunancy, but fits with the pattern of including "views"
in the sidebar and "actions" in the menu. The discharge feature can be
thought of either way.

To test you must have the 'useDischarge' system preference enabled.

- View the detail page for any patron.
- Confirm that the sidebar menu reads "Discharges."
- Confirm that the "More" menu contains a "Discharge" link which works
  correctly.

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 981302a473)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 43b4a740dc)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 09:09:13 +02:00
Jonathan Druart bcb1ecbb09 Bug 16717: Improve variable naming
$category was a categorycode, to help the readability it's better to
name it $categorycode or assign a Category to $category

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit f8b73deaec)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 8ebe3a0a42)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 09:04:43 +02:00
Marcel de Rooy 772cde5e55 Bug 16717: Remove hardcoded category from Holds.t
There is actually no need to use the hardcoded patron category S in
this test.

Test plan:
Run t/db_dependent/Holds.t.

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

Test passes OK
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit a4690353d9)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 5321959b45)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 09:04:37 +02:00
Tomas Cohen Arazi ffd86f218e Bug 16720: Remove DBIx ActionLogs.pm
The update_dbix_class_files.pl script generates ActionLog.pm instead, which is
already on the source tree.

To test:
- Apply the patch
=> SUCCESS: Koha/Schema/Result/ActionLogs.pm is removed
- Run:
  $ mysql -uroot
  > CREATE DATABASE dbic; \q
  $ mysql -uroot dbic < kohaclone/installer/data/mysql/kohastructure.sql
  $ misc/devel/update_dbix_class_files.pl --db_name dbic --db_user root
=> SUCCESS: Koha/Schema/Result/ActionLogs.pm is not re-generated
- Run:
  $ git grep ActionLogs
=> SUCCESS: There's no code using it
- Sign off

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b8c950a4c1)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit c0d3e6db11)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:50:24 +02:00
Jonathan Druart 6c65a1dce8 Bug 16670: (bug 15823 follow-up) CGI->param should not be called in list context
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 5820744675)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 302ac5e2a8)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:44:05 +02:00
Marcel de Rooy b58e8642b0 Bug 16502: Replace a few other ok-calls by is-calls
Trivial changes that speak for themselves..

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8204024f1c)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 2b7a9479b6)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:37:37 +02:00
Marcel de Rooy d1dff4c3bd Bug 16502: Adjust test for GetPlugins
The current test assumes that GetPlugins will return the test plugin
as the first one in the array. This is not correct.
This patch adjusts the test to a grep.

Test plan:
Run the test.
Bonus: Add additional plugins. Run the test again.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 6ad5770786)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 64382be0d4)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:37:36 +02:00
Marcel de Rooy e41863bfa9 Bug 16502: Add additional test to Plugins.t
In order to verify if the delete now really works, we add one test
in Plugins.t.

Test plan:
[1] Run the test.
[2] Bonus: Comment line 63 in Plugins.t where delete is called.
    Run the test again. It should fail now.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 959d69fa01)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 0632256c1a)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:37:35 +02:00
Marcel de Rooy 752e31425e Bug 16502: Table koha_plugin_com_bywatersolutions_kitchensink_mytable not always dropped after running Plugin.t
If you run Plugin.t, the above table will still be present (when you
did not enable UseKohaPlugins). This would trigger a warning when
running the test a second time.

Why? The uninstall call does its work not completely due to a small
inconsistency in Koha::Plugins::Handler::delete when calling run
without the enable_plugins parameter.

This patch resolves that inconsistency and also removes an unneeded skip
in Plugin.t in case the KitchenSink module already exists.
Note: This is a small fix. But I wonder if the Handler routines run and
delete should not have been implemented in Koha::Plugins::Base.
Also note that plugins/plugins-uninstall.pl will not be affacted by this
change, since it checks whether the pref is enabled before calling the
delete method.

Test plan:
[1] Do not yet install this patch.
[2] Verify that plugins are enabled in koha-conf.xml.
[3] Disable UseKohaPlugins in System Preferences!
[4] Run t/db_dependent/Plugins.t.
[5] Verify that table koha_plugin_com_bywatersolutions_kitchensink_mytable
    still exists. (It should have been deleted.) Remove it manually.
[6] Apply this patch.
[7] Run the test again.
[8] Verify that the table does not exist.
[9] Run the test again (without warnings).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4263ac2b92)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 4ebe7b489c)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:37:33 +02:00
Tomas Cohen Arazi c2ef39e66e Bug 13074: (followup) remove useless diag
On running all Items-related tests some useless diag showed up. Removing it.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit de6c1375f7)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 5185adc1ba)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:34:21 +02:00
Jonathan Druart 6a6a6e40c3 Bug 13074: Use Koha::Cache to cache the defaults values of a MARC record
With the global %default_values_for_mod_from_marc variable, the changes
made to the marc_subfield_structure table and especially the links
between MARC and DB fields are not safe and might be outdated (if a
field is linked/unlinked)

Test plan:
Under Plack:
- Link the barcode field, edit a record and set a barcode.
- Remove the mapping for the barcode field and then update again the
  barcode of the record.
The items.barcode DB field must not have been updated.

Without this patch, the field should have been updated.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8c14c25521)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit a50e5f141b)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:34:12 +02:00
Jonathan Druart f44389f3a9 Bug 12748: findSerialByStatus has been renamed with findSerialsByStatus
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 30946eff3c)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 9710f07575)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:24:10 +02:00
Jonathan Druart 3943b8ca44 Bug 12748: Code tidy
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 44062c07b7)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 69e4c39c21)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:24:09 +02:00
Jonathan Druart f2156852a7 Bug 12748: Remove warning 'masks earlier declaration in same scope'
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 273d5e5328)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 67b4f25a69)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:24:08 +02:00
remi a3557bba8b Bug 12748 - Add test for step 7 and 8 and rename findSerialByStatus
https://bugs.koha-community.org/show_bug.cgi?id=12478

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1bd5a177d0)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 2351db01d3)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:24:06 +02:00
remi ee4607cda1 Bug 12748 - Fixes duplicate serials with an "expected" status bug
Added a new sub to Serials.pm to be able to get serials with their statuses.
Now the sub ModSerialStatus checks for other serials with an "expected" status before doing anything.

Also modified Serials.t to be able to test those changes.

Test Plan
1) Apply patch
2) Run ./t/db_dependent/Serials.t
3) Validate that there are no errors
4) Go on "Serial collection information" page for a serial of your choice
5) Click on "Generate next"
6) Change the status of the original serial from "late" to "expected"
7) Change the newly generated serial from "expected" to "delete"
8) Validate that there are no new serials created by instruction 7 and that the serial was deleted
9) Run ./t/db_dependent/Serials.t

With QA Fixes

- Use the constant instead of the code (1 vs EXPECTED)
- Avoid interpolation in query
- use selectall_arrayref instead of fetchall_arrayref

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 10fd9f5ec0)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 695dc4c370)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:24:00 +02:00
Julian Maurice 64d2995789 Bug 10459: Update DB rev (3.22.08.001) 2016-07-01 08:19:50 +02:00
Jonathan Druart 341343a860 Bug 10459: Add tests for borrowers.updated_on
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit ff9de4138a)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit b68e1038fe)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:13:24 +02:00
Mark Tompsett b49dddc04a Bug 10459 renamed timestamp to updated_on
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit f863e478b9)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 947690e232)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:08:31 +02:00
Marcel de Rooy 15041b7b3f Bug 10459: Borrowers should have a timestamp
This patch adds a timestamp column to the borrowers table in kohastructure
and updatedatabase. (And also to the deletedborrowers table.)
A timestamp may be useful in synchronizing with external systems (among other
reasons).

Test plan:
Run updatestructure on an existing database, or install a new one.
Verify that the borrowers table has a timestamp now.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested updatestructure and running kohastructure.sql.
Passed t/db_dependent/Members.t.

updatedatabase.pl did not apply. I edited and then run it. Columns were added as expected.
Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

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

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>

Bug 10459: Follow up to update to atomic update methodology

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
New column created, no errors.

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

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 255596ae6c)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit b4d40f7d00)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-07-01 08:07:10 +02:00
Julian Maurice 978f8aedf3 Increment version for 3.22.8 release
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-24 13:47:31 +02:00
Julian Maurice f153cedd6f Translation updates for Koha 3.22.8
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-24 13:47:17 +02:00
Julian Maurice 316576d6d0 Update release notes for 3.22.8 release
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-24 13:47:02 +02:00
Marcel de Rooy 7db08616f2 Bug 16412: Cache undef in L1 only
No need to cache undef in L2.
Prevent numerous warnings like:
Use of uninitialized value in subroutine entry at /usr/share/koha/masterclone/Koha/Cache.pm line 284

Test plan:
Run t/Cache.t
Run t/db_dependent/sysprefs.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended patch: remove trailing space char and replace 'you' with 'we' to
match existing wordings.

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

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
(cherry picked from commit 7a452ac414)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-23 09:28:53 +02:00
Jonathan Druart 337e887460 Bug 16412: Make sure Koha::Cache->set_in_cache will not warn anymore
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

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

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
(cherry picked from commit 53e410b14e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-23 09:28:49 +02:00
Jonathan Druart ecf6928194 Bug 16221: follow-up for changes made by bug 16229
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 7f52638129)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-23 09:26:53 +02:00
Jacek Ablewicz d64d83732e Bug 16221: Use Storable::dclone() instead of Clone::clone() for L1 cache deep-copying mode
Storable dclone() is over 3x faster then Clone::clone() when used for
creating a deep copies of the big, complex data structures like MARC
frameworks. See also Bug 16044 comments #18 & #20.

This is a trivial version of Bug 16166. Performance test
results (see Bug 16140 comment #23 for test setup description):

   master
   146.29 (14.64+14.53+14.51+14.57+14.72+14.56+14.53+15.06+14.56+14.61)

   master + Bug 16221
   96.5 (9.77+9.63+9.77+9.77+9.68+9.05+9.68+9.83+9.63+9.69)

   master + Bug 16166
   90.7 (9.15+9.10+9.16+8.41+9.19+9.19+9.11+9.19+9.02+9.18)

Bug 16166 is a bit faster and more comprehensive implementation, but
also more complex and harder to test/evaluate.

Test plan:

1) apply patch
2) profile GetMarcStructure() calls before / after patch, e.g. by
running some script which calls it often (like catalogue search
w/ XSLT processing turned on, etc.)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 0c6f23a6ce)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-23 09:26:04 +02:00
Tomas Cohen Arazi 9208f25119 Bug 16229: (QA) POD fixes
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
(cherry picked from commit 40ec26dc6c)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-23 09:25:42 +02:00
Jonathan Druart 2430d35926 Bug 16229: Add the unsafe flag to set_in_cache
Could be useful later.

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
(cherry picked from commit 22c907230a)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-23 09:25:38 +02:00
Jonathan Druart a54774cbf2 Bug 16229: Deep copy on setting in cache
Koha::Cache->set_in_cache should deep copy (if needed) to avoid the
value which has been set in cache to be unintentionally modified later.

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
(cherry picked from commit 33ad907a82)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-23 09:23:55 +02:00
Jonathan Druart 6599ae3ddc Bug 16229: Deep copy on first L2 fetch
When a value exists in L2 cache but not in L1 cache, it should be deep
copied if needed (i.e. not a scalar). Otherwise the calling code is able
to modify the value in cache.
Note that is theoretical, it's possible that no code does that.

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
(cherry picked from commit 956dc953b5)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-23 09:22:34 +02:00
Galen Charlton c4be9951a7 Bug 16675: fix breakage of t/Languages.t
This patch fixes test breakage introduced by the patch for bug 16088,
which added caching of getlanguages().  Upon inspection, it looks like
the patch for 16088 does not introduce a regression on bug 10560,
so this patch adds a couple cache-clearings.

To test
-------
[1] Verify that t/Languages.t passes.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b9b4eeb849)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 14:00:20 +02:00
Jonathan Druart 620023209f Bug 16088: Introduce Koha::Cache::Memory::Lite to cache the language
The goal of this patch is to avoid unecessary flush of the L1 cache on
creating a new CGI object each time C4::Languages::getlanguage is called
without a CGI object.

The new class Koha::Cache::Memory::Lite must be flushed by the CGI
constructor overide done in the psgi file. This new class will ease
caching of specific stuffs used by running script.

Test plan:
At the OPAC and the intranet interfaces:
Open 2 different browser session to simulate several users
- Clear the cookies of the browsers
- User 1 (U1) an User 2 (U2) should be set to the default language
  (depending on the browser settings)
- U1 chooses another language
- U2 refreshes and the language used must be the default one
- U2 chooses a third language
- U1 refreshes and must be still using the one he has choosen.

Try to use a language which is not defined:
Add &language=es-ES (if es-ES is not translated) to the url, you should
not see the Spanish interface.

Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit f01a07a25e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 13:46:28 +02:00
Jonathan Druart 6c360763e8 Bug 16044: Populate the L1 cache when L2 is fetched
The whole patch set is not very pertinent if the L1 cache is not
populated when L2 is fetched!
This patch fixes this inconsistency.

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Jacek Ablewicz <abl@biblos.pk.edu.pl>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit c75271a741)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 13:44:45 +02:00
Jonathan Druart bc2a946f7c Bug 16044: Add an unsafe flag to Koha::Cache->get_from_cache
If the caller/developer knows what he is doing, he can decide not to
deep copy the structure. It will be faster but unsafe!
If the structure is modified, the cache will also be updated.
This option must be used with care and is not the default behavior.

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit b0bbace4dd)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 13:44:43 +02:00
Jonathan Druart acb6f4ba41 Bug 16044: Add deep cloning
To avoid the cache to be modified unfortunately, the default behavior of
get_from_cache will be to deep copy if we are getting a structure.
If the item is a scalar, it's simply returned.

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 2e0af6e6df)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 13:44:41 +02:00
Jonathan Druart 0f082e6583 Bug 16044: Add tests to make sure structures will be copied
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit 3bfe541d0d)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 13:44:38 +02:00
Jonathan Druart 7040625691 Bug 16044: Make tests from t/Cache.t pass
The timeout does not impact the L1 cache (it would be to time consuming
and not really useful to do that for this cache).
To simulate the real timeout, we need to flush this L1 cache when
needed.
It would be also done adding a disable_L1_cache method.

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit bbfe394bb6)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 13:44:34 +02:00
Jonathan Druart af168f1706 Bug 16044: Use the L1 cache for any objects set in cache
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit dda7a0a25f)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 13:44:30 +02:00
Claire Gravely 6236084603 Bug 16165 - Include link to ILS-DI documentation page in ILS-DI system preference
There is no clue in the system preference about the nice ILS-DI documentation
once you turn it on. We should include a note and the link, similar to how we
do it for the web self checkout.

Test plan:
Syspreference ILS-DI should now include URL in description.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 9066ae153b)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 903d0432c3)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 12:09:43 +02:00
Mark Tompsett 7ebf5feec9 Bug 16637: Dependency for C4::Tags not listed
Added optional dependency, so as to explain why testing
explodes when the Enhanced Content system preference
TagsExternalDictionary is set. It is optional, because not only
does TagsExternalDictionary have to be set, but TagsEnabled
must be 'Allow'.

Also tweaked C4/Tags.pm to ignore TagsExternalDictionary,
if Lingua::Ispell is not installed. A warning is given.

TEST PLAN
---------
 1) Set the Enhanced Content system preference
    TagsExternalDictionary to /usr/bin/ispell

 2) sudo apt-get install liblingua-ispell-perl
    -- should be a new install

 3) prove t/db_dependent/Tags.t
    -- should work fine

 4) sudo apt-get remove liblingua-ispell-perl

 5) prove t/db_dependent/Tags.t
    -- should explode

 6) Clear the Enhanced Content system preference
    TagsExternalDictionary

 7) prove t/db_dependent/Tags.t
    -- should work fine

 8) apply patch

 9) prove t/db_dependent/Tags.t
    -- should work fine

10) Set the Enhanced Content system preference
    TagsExternalDictionary to /usr/bin/ispell

11) prove t/db_dependent/Tags.t
    -- should work, with warning.

12) sudo apt-get install liblingua-ispell-perl

13) prove t/db_dependent/Tags.t
    -- should work fine

14) run koha qa test tools.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Post-hackfest hotel Olympia lobby signoff. Kalimera!
Works as expected.
At this moment the Tags.t test does not need the database btw,
but the module should have much more test coverage.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit c91b16bd9e)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 358e7a6d61)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 12:07:29 +02:00
Kyle M Hall 7c2ed6d486 Bug 16636 [QA Followup] - Move tests to t/External
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1fda4105a8)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit fcbb59f25e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 12:06:15 +02:00
Marcel de Rooy 9b3e91c218 Bug 16636: [QA Follow-up] Move External_BakerTaylor.t to t
When we mock the preferences completely now, we do not need
db access anymore.

Test plan:
Run the test without exporting KOHA_CONF.
The test passes with some warns about koha-conf.xml.
If you point KOHA_CONF to etc/koha-conf.xml, you have no warns.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 7f4682df0d)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit af029c8655)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 12:05:45 +02:00
Marcel de Rooy 17bd3a5deb Bug 16636: [QA Follow-up] Make BakerTaylor plack safe
Initialize file level lexicals each call. Do not call _initialize
outside the module.
Adjust test by mocking preferences.

Test plan:
Run t/db_dependent/External_BakerTaylor.t.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested module with trivial script under Plack/memcached by toggling
the associated preferences.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 5361440f65)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit c8ef873ee9)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 12:05:38 +02:00
Mark Tompsett cd8fc9afcd Bug 16636: t/00-load.t warning from C4/External/BakerTaylor.pm
Since the tests are expecting an initialize function, the
initialize call was just moved outside of the INIT block.

TEST PLAN
---------
1) prove t/00-load.t
   -- warnings about INIT for BakerTaylor
2) prove `git grep -l BakerTaylor | grep [.]t$`
   -- should all run okay
3) apply patch
4) repeat steps 1 and 2
   -- warning should be gone, and everything else run okay
5) run koha qa test tools

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Signed-off-by: Florent Mara <florent.mara@gmail.com>

NOTE: Tweaked test plan based on comment #4,
      Added sign off based on comment #6.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b4479624de)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 9c7c4f02dd)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 12:04:27 +02:00
Marcel de Rooy fbc8114f54 Bug 16635: [QA Follow-up] Eliminate some global package vars
[1] $branch is only related to line 123 as fallback.
[2] $width moved to a constant; sub width is not used.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested the corresponding plugin in item editor.
Test t/db_dependent/Barcodes.t and Barcodes_ValueBuilder.t still pass.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 4fc8b3d6cf)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 94d77bd9c2)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-06-16 12:03:37 +02:00