Commit graph

43569 commits

Author SHA1 Message Date
79e8701b1d Bug 28445: Add tests for subfields_to_prefill
I first wrote test for another thing but the code was actually correct.
So submitting the tests.

Note that the marc for more_subfields does not need to be passed, we can
build it when needed.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 10:54:42 +02:00
Andrew Nugged
1fa2afe44b Bug 27526: Fix for prefill preventing duplication 2
Prefill feature should not be in the priority
when user choose "Duplicate" for the item

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 10:54:42 +02:00
fd29c73a38 Bug 27526: Fix SubfieldsToUseWhenPrefill
my $a = "z";
my @x = split ( ' ', $a ) || ("");

@x will be [1]

Which is not at all what we are expecting here!
Be more verbose and don't introduce bug.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-28 10:48:05 +02:00
103bbf2c9a Bug 14957: DBIC changes - Remove MarcOverlayRulesModule.pm
Where is that coming from??

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-27 09:17:25 +02:00
1cefcd6e12 Bug 14957: Fix perlcritic error on admin/marc-overlay-rules.pl
Subroutine "new" called using indirect syntax at line 30, column 13.  See page 349 of PBP.  (Severity: 4)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-27 09:16:42 +02:00
3376e0d218 Bug 27526: Correct NULL vs empty string when editing
When an item is edit we must keep the NULL values in DB if the input
have been left empty.
It also fixes the "barcode cannot be unique" error when an item does not
have a barcode.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-27 09:11:45 +02:00
474f228a69 Bug 29318: Tidy the code
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
0099cff739 Bug 29318: Remove permission check from overdrive search page
This removes the 'edit_borrowers' permission from OverDrive search

To test:
1 - Enable OverDrive via koha system preferences
2 - Sign in to opac with a user with no permissions
3 - Perform a search that will return OD results, 'love' works
4 - Click thje "Found XX results in the library's OverDrive collection"
5 - Note you are logged out of Koha
6 - Apply patch
7 - Repeat
8 - Success

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

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
93822a8ca7 Bug 29286: Typo: Librarien will need the manage_auth_values subpermission.
This patch fixes a typo in the Cataloging system preferences text.

"Librarien" -> "Librarian"

To test, apply the patch and go to Administration -> System preferences
-> Cataloging.

 - Check the CreateAVFromCataloguing system preference.

Signed-off-by: David Nind <david@davidnind.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
16d2765c3c Bug 29158: (bug 22435 follow-up) Remove ref to account_offset_types.sql in intaller
Caused by
  commit 3d6a6e79f7
  Bug 22435: (follow-up) Drop account_offset_types table
that removes the file but the reference to it from the installer
process.

Test plan:
Go through the install process and notice that the following warning
does not appear in the log:
[2021/10/25 09:47:58] [WARN] Something went wrong loading file /kohadevbox/koha/installer/data/mysql/mandatory/account_offset_types.sql (Couldn't read '/kohadevbox/koha/installer/data/mysql/mandatory/account_offset_types.sql' : No such file or directory at /usr/share/perl5/DBIx/RunSQL.pm line 180.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
aab18ba056 Bug 14957: DBRev 21.06.00.038
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
38a71afebf Bug 14957: DBIC schema changes
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
3247eb9a73 Bug 14957: Add tests for subfield order
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
David Gustafsson
8425cf1e13 Bug 14957: Fix field order issue
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
f756d9534e Bug 14957: Fix record preview
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
David Gustafsson
6ab1ca2428 Bug 14957: Exclude leader from saved/updated record comparison in tests
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
David Gustafsson
d306da9f8d Bug 14957: Fix regression, rules must be refetched on add/edit/deletion
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
435abd3379 Bug 14957: Improve readbility of tests
Not saying that they were not readable before, but I had to do some
changes to compare the before/after records and it was easier that way.
Feel free to obsolete if you disagree.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
10a51487ca Bug 14957: Clean controller
Too many imports and unecessary complicated init of $rules

There are certainly other things to improve, like the "op" handling,
standardize names of "op", etc.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
78b5cd2015 Bug 14957: (QA follow-up) Fix for jQuery undefined
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
c3906bf1dc Bug 14957: (QA follow-up) Fix script name
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
f4b55db9d4 Bug 14957: (QA follow-up) Fix template indentation
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
7838c8e307 Bug 14957: (QA follow-up) Update for bug 27846
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
28aef3a525 Bug 14957: (QA follow-up) Update for bug 17858
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
a3e113977b Bug 14957: (QA follow-up) Update for bug 26703
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 14957: (QA follow-up) Update for bug 20054

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

Bug 14957: (QA follow-up) Update for bug 20053

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

Bug 14957: (QA follow-up) Update for bug 23271

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
342dae89f8 Bug 14957: (QA follow-up) Add missing filters
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
e14a2e350e Bug 14957: (QA follow-up) Comment 'bulkmarcimport' temporarily
It appears this patchset doesn't fully support bulkmarcimport (see bug
25539 for details).

At this time, to get this bug moving I think we should comment out the
ability to define rules that affect bulkmarcimport and then we can fix
and re-enable that feature at a later date.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
e9ed5b0e34 Bug 14957: (QA follow-up) Rename and move admin link
This patch renames 'MARC overlay rules' to 'Record overlay rules' and
moves it up the list to just below 'Record matching rules' to make it
more contextually ordered.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
ad1fa00ed3 Bug 14957: (QA follow-up) Fix translation issues
This patch fixes all the translation issues I could spot in the
marc-overlay-rules template.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:03 +02:00
27f3d0af63 Bug 14957: (QA follow-up) Clarify 'context' param
This patch renames the (passed through) 'context' param for
'overlay_context'. I propose doing so, because in Koha-land 'context'
has a special meaning, related to C4::Context and it reads ambigous.

The patch itself is pretty trivial.

Tests should pass:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Biblio/MarcOverlayRules.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 14957: (follow-up) Clarify 'context' param

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
702af7ac68 Bug 14957: (follow-up) marc_merge_rules_modules removed
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
59e0473051 Bug 14957: DBIC changes
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
66157286ad Bug 14957: Feature hidden in menues if no other 'cagaloguing' permissions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
02720d423c Bug 14957: (QA follow-up) Rename 'merge' => 'overlay'
This patch acknowledges the fact that 'merging' has a different meaning
in Koha than the behavior this great patchset introduces. The more
idiomatic way of describing the behavior is to talk about 'overlay rules'.

This patch also:
- Fixes kohastructure.sql missing table encoding a collation
- Fixes the atomic update completely missing a table
- Moves the syspref entry to 'Importing', probably a rebase issue

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 14957: (QA follow-up) Fix syntax error in atomicupdate

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

Bug 14957: Fix imports in tests

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

Bug 14957: Fix imports in marc-overlay-rules.pl

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

Bug 14957: Fix syspref's values

It didn't switch off when set to "don't use"

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

JD amended patch: Fix license statement

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
f4725b6427 Bug 14957: (QA follow-up) Add tooltips
This patch adds an info-tooltip to the field rules in the table header
to expand on their meaning to reduce the need to read the documentation
each time you come to use the configuration tool

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
2d323cdb12 Bug 14957: (QA follow-up) Button styling
This patch updates the action buttons to include btn-default and
switched from btn-sm to btn-xs to match other similar UI's found in
datatable based admin pages.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
David Gustafsson
0e8b67e1ed Bug 14957: fix context for batchmod and batchimport
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
Aleisha Amohia
859396b804 Bug 14957: Updated schema files
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
David Gustafsson
139e6c30d6 Bug 14957: Merge rules system for merging of MARC records
Add a rule based system for merging MARC records to for example
prevent field data from being overwritten.

To test:
    1. Apply this patch.
    2. Log in to staff client.
    3. Enable new syspref MARCMergeRules.
    4. Click the new link "MARC merge rules" in the "Catalog"
       section of the Koha administration page.
    5. Create a new rule:
       Module: source, Filter: *, Tag: 245, Preset: Protect.
    6. Clicking "Edit" should allow you to edit corresponding rule.
    7. Clicking "Delete" should remove corresponding rule after confirmation.
    8. Selecting one or more rules followed by clicking "Delete
       selected" should remove all selected rules after confirmation.
    9. Try creating a rule with tag set to "**", the other options does
       not matter. Verify that saving this rule produces an error
       message complaining about invalid tag regular expression.
    10. Try creating a rule with tag set to "008" (or other control
        field) and set Appended: Append and Removed: Skip, the other
        options does not matter. Verify that saving this rule produces
        an error message complaining about invalid combination of actions
        for control field.
    11. With the 245 rule in step 5 in place, edit a bibliographic record,
        change 245a for example (which should be Title for MARC21) and save.
    12. Verify that the changes has not been saved.
    13. Create a new rule:
        Module: source, Filter: intranet, Tag: 245, Preset: Overwrite.
    14. Repeat step 12, and verify that the changes has now been saved.
    15. Run tests in t/db_dependent/Biblio/MarcMergeRules.t and very
        that all tests pass.

Sponsored-by: Halland County Library
Sponsored-by: Catalyst IT
Sponsored-by: Gothenburg University Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
c0a03d34ca Bug 11175: DBRev 21.06.00.037
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
9b05b534b9 Bug 11175: Add tests
Add coverage for the message set by get_marc_components when the search
fails.
Also cleans a bit the weird return comparisons.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
2ecbf3a346 Bug 11175: (QA follow-up) Test message contents for analytics error
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
012d2333b2 Bug 11175: (QA follow-up) Restore bug 29284
This patch restores the functional fixes introduced in bug 29284 and
also prevents the 'Show analytics' link from displaying when no
component parts are found and inline display is enabled.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: Fixed error with $err vs $error(s) :)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
dfce3d3c0c Bug 11175: (QA follow-up) Do not fetch twice
We were fetching components in the first call of XSLTParse4Display
(opac-detail around L220). And again (opac-detail around L660).
Same for catalogue/detail.pl.
Moving the XSLT block in both scripts and removing the code from
XSLT.pm which again makes the tests obsolete.

Not hiding the link when there are components. Might be helpful too.

Also fixing biblionumber in the XSLTParse4Display call for parts.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
936e86366c Bug 11175: (QA follow-up) Remove caching _components
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
7502f4182e Bug 11175: Uniformize ComponentParts in template
More robust as it takes empty array into account

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
8e87270076 Bug 11175: Add syspref MaxComponentRecords to remove hardcoded limit
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
919523a524 Bug 11175: (QA follow-up) Restore link to more results
This patch restores the link to 'more results' should you exceed the
hard coded limit of 300 component parts.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
ca6ef8ddaf Bug 11175: (QA follow-up) Be more specific with title fields
We were using the MARC::Record title accessor, but that just stringifies
all the subfields of field 245. The indexer, and the XSLT, specifically
use 245a so we need to do the same.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00
304247d326 Bug 11175: (QA follow-up) Display components tab if no holdings
This patch updates the default details tab selection to components for
the case when there are no holdings attached to the record and there is
no HTML5 content to display in preference.

Bug 11175: (QA follow-up) OPAC - Display components tab if no holdings

As for the staff client, this selects the default tab to be 'Components'
for the case where no holdings are found.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-10-26 16:46:02 +02:00