bug 2297: improve ModBiblio() to avoid duplicate item fields
Prior to this patch, ModBiblio() would append
item tags from the previous version of the bib record
to the incoming bib record before saving the results,
even if the incoming bib record already has embedded
item tags.
For example, if a bib is retrieved using GetMarcBiblio() then
saved using ModBiblio(), the caller was obliged
to delete any item tags first to avoid duplication.
ModBiblio() now deletes item tags supplied in the
incoming MARC record. This eliminates the possibility
of duplication, and removes any implication that
ModBiblio() can or should be used to modify item
records - ModItem() should be used for that.
test suite add_biblios: don't use zebraqueue_daemon
The add_biblios() routine now reindexes all bibs
in batch instead of waiting for zebraqueue_daemon - this
is moderately faster. A separate set of test
cases for zebraqueue_deamon will be witten.
No documentation changes.
Signed-off-by: Andrew Moore <andrew.moore@liblime.com> Signed-off-by: Joshua Ferraro <jmf@liblime.com>
Test cases in KohaTest/Search/SimpleSearch.pm assumed
that they were the first to call add_biblios(); as
this is not necessarily true when the entire test
suite is run, test now counts how many 'Finn Test'
bibs already exist.
No documentation changes.
Signed-off-by: Andrew Moore <andrew.moore@liblime.com> Signed-off-by: Joshua Ferraro <jmf@liblime.com>
bug 2293: better validation in overdue rules editor
If a rule should not be saved because a delay is
given but no letter or debar action is specified
for that delay, an error message is now reported.
Also:
* use "dialog alert" CSS class for confirmation
that form was saved
* if form input is saved, retrieve the settings from the
database again when displaying the form - this will
help turn up any bugs where the script is not
saving the overdue rules correctly.
* fix display of patron category in error messages
Joe Atzberger [Wed, 25 Jun 2008 23:21:28 +0000 (18:21 -0500)]
Script to correct faulty statistics table entries.
This is the first iteration of this script, likely to be expanded
if other mappings are determined. Currently it populates the
itemtype for all statistics that have itemnumbers and then pulls
borrownumbers from old_issues (or issues). This has the benign
side effect of ignoring whether or not itemtype was a different
value at the time of the transaction.
It then tries to populate null borrowernumbers using a fairly
conservative approach, only where exactly one match exists, else warns.
The process of updating statistics is needlessly complex based on the
lack of a reliable primary key. ALL such tables should have a numerical
primary key. The impression that the timestamp and any other fields
are enough to combine for a "unique enough" key is wrong. For example,
running SIP tests will add multiple transactions that might share
borrowernumber, itemnumber and timestamp. Key uniqueness should be
logically inherent, not de facto.
Andrew Moore [Mon, 23 Jun 2008 17:55:31 +0000 (12:55 -0500)]
bug: 2269 - adding a perltidyrc file
This patch adds xt/perltidyrc, a suggested perltidy configuration file.
It's in the xt directory because I'd like to eventually tie it in with Test::Perl::Critic
to run automated tests on tidyness and other Perl::Critic policies. That stuff belongs in
the xt directory since it's testing for developers use only.
I have only turned on a few directives based on the suggestions by MJ, historical discussion on
the mailing lists, and what I was told when I started contributing to koha. There are many other
directives in this file that are commented out. They are supposed to represent the defaults and
can be adjusted in the future if desired.
Use of this file is encouraged, but not required. It would be really nice if you could at least run
it on new files that you contribute. I would recommend not running it on files that are already
part of koha without writing some tests for those files and discussing your intentions to reformat
entire files in bulk.
Andrew Moore [Mon, 23 Jun 2008 17:35:58 +0000 (12:35 -0500)]
bug: 2272 - remove warning from C4::Koha::getitemtypeimagedir
I changed getitemtypeimagedir to set a default on its argument so that it would not complain if not passed 'opac'.
I improved the documentation on the method.
I edited the t/icondirecotries.t test script to explicitly pass an argument to both getitemtypeimagedir calls.
- and I adjusted one line of whitespace to make similar things look similar
I added a test module for C4::Koha
I added a test module for C4::Koha::getitemtypeimagedir.
ILS::Patron is where most of the intelligence for SIP's representation
is lodged. Currently there is difficulty with C4::Members functions.
GetMemberDetails is required for the needed flags, but it returns
empty structure on bad barcodes, where it should be undef.
Galen Charlton [Wed, 25 Jun 2008 16:30:03 +0000 (11:30 -0500)]
bug 2254 [3/3]: add authority type check
Added a test to the MARC framework checks to
verify that all authority types used in a framework
are defined.
Documentation changes: possible new screenshots
and text to describe the new test.
NOTE: This patch adds strings to the checkmarc template, and thus
violates the string freeze for 3.0. I'm submitting anyway
because 2254 is a blocker, but if no exception is made,
it is safe to not apply this patch for 3.0.
Corrected two errors found in the authority types used
in the MARC21 frameworks:
* one subfield that used "Meeting Name" instead of "MEETI_NAME"
* various subfields that used "CORP0_NAME" instead of "CORPO_NAME"
The biggest visible consequence of this change is that corporate
name headings (110, 610, 710, 810, etc.) will now link correctly
to their authority records.
In addition, brought the fr-FR MARC21 framework scripts up-to-date
with respect to the changes made to the English versions.
Galen Charlton [Wed, 25 Jun 2008 16:30:01 +0000 (11:30 -0500)]
bug 2254 [1/3]: fixed GetAuthType(); avoid crash
Improved C4::AuthoritiesMarc::GetAuthType() so that
it returns either a hashref (if the authority type exists)
or undef (if it does not exist). The same
accessor should not be used to either return a single
value or all values of a settings list. Note that
all existing clients of GetAuthType are expecting
either a single hashref or undef; none of them
expected the arrayref that could be returned by
the previous version of the accessor.
When BiblioAddsAuthorities is ON, addbiblio.pl
now checks the return value of GetAuthType and
no longer crashes as follows if the MARC framework
specifies an invalid authority type for a given subfield:
Can't coerce array into hash at .../cataloging/addbiblio.pl line 738.
Galen Charlton [Tue, 24 Jun 2008 22:12:23 +0000 (17:12 -0500)]
bug 2206: always have $9 for headings fields
If a field can be linked to an authority record (i.e.,
an authtypecode is defined for subfield $a), always
include the subfield $9 in a (readonly) input element even
if it is marked hidden per the MARC framework.
Prior to this patch, a $9 marked hidden per the framework
would not be included in the form, causing the authority record
number link to not be added when choosing a heading from the authority
finder. In other words, with BiblioAddsAuthorities OFF,
any authorized headings in bibs added via the MARC editor
would not have the subfield $9, and thus would appear
to not be used by any bibs.
Note that subfield $9 is set to be readonly, as changing the
authority number link does not currently change the
heading stored in the bib record.
Galen Charlton [Tue, 24 Jun 2008 15:21:12 +0000 (10:21 -0500)]
clean up old-style calls to GetMemberDetails
GetMemberDetails() returns only one hashref now,
not two. In all cases where the caller was
expecting two output values, the $flags return
was ignored anyway.
Galen Charlton [Mon, 23 Jun 2008 20:33:32 +0000 (15:33 -0500)]
bug 2252: item-level hold not waiting until priority = 0
When returning an item that has an item-level hold on it,
CheckReserves() will not consider it waiting unless the
priority has been set to 0 (i.e., the item has specifically
been marked as filling the request.)
Galen Charlton [Mon, 23 Jun 2008 16:15:01 +0000 (11:15 -0500)]
bug 2273: not-for-loan item should not fill hold request
If an item is not for loan (i.e., items.notforloan is not null),
do not use it to fill a title-level hold request when
item is checked in. Prior to this patch, a notforloan item
could fill a request - CheckReserves() was checking only
the item's item type's not for loan flag.
Galen Charlton [Mon, 23 Jun 2008 15:01:33 +0000 (10:01 -0500)]
new automated test for template translatability
This test verifies that the English OPAC and staff templates
can be processed by the string extractor (tmpl_process3.pl)
without error. If a template contains a parsing error
(at least as far as tmpl_process3.pl is concerned), it may
not be correctly converted when a language translation
is applied.
Galen Charlton [Fri, 20 Jun 2008 22:37:05 +0000 (17:37 -0500)]
bug 2248 [2/2]: import item status display in search results
The in transit status now displays as such in the
OPAC search results. In the non-XSLT version, the status
is checked only for bibs having 20 or fewer items to avoid
extra hits on the database during result set presentation.
In the XSLT version, all items are checked.
Note that because an item's transfer status is not
stored in the MARC record, the transfer status
has no effect when limiting a search by item
availability. For a future version, the transit status
should be added to the Zebra index.
This prevents the following log entries:
error EXPR:at pos 42: non-initialized variable OPACViewOthersSuggestions
EXPR must NOT be used unless the author can guarantee ALL names referenced
will be defined at the BEGINNING of TMPL execution. That suggests that in
.inc files, only variables populated by get_template... are valid, since
the author cannot guarantee what other templates might include the file.
Joe Atzberger [Fri, 20 Jun 2008 19:36:29 +0000 (14:36 -0500)]
Remove EXPRs. Also added all jacket images to Overdue tab.
Standardized table layout with colspan=2 for Title header,
the first being the icon or jacket image. Discovered a bug
when I fixed the "toggle/highlight" code to work (using loop
context var __odd__), namely that the highlight styling overrides
the red overdue styling. Commented out that conditional with a
FIXME.
Andrew Moore [Fri, 20 Jun 2008 19:58:42 +0000 (14:58 -0500)]
bug: 2176 - database fix
I had the create table statements in the wrong order, so they would not apply cleanly.
This is an update to database version 091, and does not take a new number.
Galen Charlton [Fri, 20 Jun 2008 18:59:33 +0000 (13:59 -0500)]
bug 1710 and 1739: availability for item-level holds
Fixed rules for determining whether an item is
available for an item-level hold request. Create a
new function in C4::Reserves, IsAvailableForItemRequest(),
that checks whether an item is potentially available for
an item-level hold request.
An item is considered available if:
* it is not lost AND,
* it is not marked not for loan AND,
* it is not withdrawn AND,
* it is not damaged (unless the AllowHoldsOnDamagedItems syspref is ON), AND
* it is not on loan (unless the AllowOnShelfHolds syspref is ON)
Preventing a hold request on withdrawn items is bug 1739, as is
the new preference on whether to allow holds on damaged items.
Removing the condition that an item cannot be requested if
it has already been requested by another patron is the topic of bug 1710.
Note that this patch does not change the behavior where if
independent branches is on and the canreservefromotherbranches
syspref is off, a staff operator is prevented from placing
an item-level hold request on an item from a different branch.
Andrew Moore [Fri, 20 Jun 2008 18:13:44 +0000 (13:13 -0500)]
bug 2176: adding new system preference to French sysprefs script.
I forot to add the new EnhancedMessagingPreferences system preference to the French SQL. I
hope I added it in the right place. The 'explanation' is untranslated.
Andrew Moore [Fri, 20 Jun 2008 18:02:04 +0000 (13:02 -0500)]
Bug 2176: adding SMS::Send to list of dependencies
SMS::Send is used by the new enhanced messaging stuff. It's a pure-perl module that
provides a consistent interface to SMS sending gateways. There are alredy
a handful of driver modules for gateways on CPAN, and adding one for a new gateway
is possible.
Andrew Moore [Fri, 20 Jun 2008 18:02:03 +0000 (13:02 -0500)]
Adding an automated test for POD correctness.
This test script checks all perl files in the C4 directory for POD correctness. It is
completely optional, and as of yet, is not actually run when you run the test suite.
It's just a handy way to check our POD documentation, which should be correct before
we release code.
This script can be invoked with 'prove -v xt/author/podcorrectness.t'
Additionally, this is the first test in the 'xt' directory. Current perl testing practices
have reserved the 'xt' directory for tests that should be run by the code authors before
release. See:
http://perl-qa.hexten.net/wiki/index.php/Oslo_QA_Hackathon_2008_:Achievements#Testing_Best_Practices
for more information.