Note that some are caused by CGI, see bug 18632
Test plan:
Confirm there are less warnings with this patch applied
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Test plan:
prove t/db_dependent/Search/History.t
should not display any warnings
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Test plan:
Read the changes and make sure they make sense
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
The mapping structure is cached and may be wrong if already populated.
We need to clear the cache when a framework is modified
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Works as described in test plan and passes QA tools.
This patch modifies the automatic item modification by age template to
correct errors in form validation:
- Age in days should not be required
- A value should not be required in substitutions.
To test, apply the patch and clear your browser cache if necessary.
- Go to Tools -> Automatic item modification by age.
- Confirm that when editing or creating a rule the only required field
is the substitutions field name.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch replaces the TRUNCATE statement in ModOAISetsBiblios by a
DELETE statement. A truncate will cause an implicit commit and will
therefore commit the transaction started in the test script.
Also simplifying the module load in the test script.
Test plan:
Do not apply this patch and observe that biblio records are added to your
database by running t/db_dependent/OAI/Sets.t.
Apply this patch, run the test again and verify that it does no longer
add records to your biblio table.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug Description:
When performing a unit test on xt/sample_notices.t with the command
'prove xt/sample_notices.t' 11 tests fail with the error message
"No sample notice to delete".
Cause of bug:
The failures are caused by an incorrect file path on Line 25 of
xt/sample_notices.t.
Patch Description:
This patch corrects the failures by changing $base_notices_file from
"en/default/sample_notices.sql" to "en/mandatory/sample_notices.sql"
Test Plan:
1) Drop into koha-shell and run the command 'prove xt/sample_notices.'
2) 11 unit tests fail.
3) Apply the patch.
4) Re-run 'prove xt/sample_notices.t'
5) All of the tests pass now.
6) Quit out of koha-shell
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This test may fail on slow servers, it compares the response date with
'now', but both can differ a bit.
https://jenkins.koha-community.org/job/Koha_Master_D8/198/consoleFull
Failed test 'ListMetadataFormats'
at t/db_dependent/OAI/Server.t line 150.
Structures begin differing at:
$got->{responseDate} = '2017-06-12T14:31:51Z'
$expected->{responseDate} = '2017-06-12T14:31:50Z'
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Removed trailing spaces at line 182 of C4::Accounts.
Test plan:
1. Edit C4/Accounts.pm and verify trailing spaces
2. Apply patch
3. Verify that trailing spaces in C4/Accounts have been removed
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Code exposed is:
%s %s %s [%%- FOREACH field IN row; field IF !loop.last; ItemTypes.GetDescription(field) IF loop.last; sep IF !loop.last; END %%] %s TOTAL [%%- FOREACH field IN total; field; sep IF !loop.last; END %%]
Similar for: csv/orders_by_budget.tt
To test:
- Apply patch
- In staff client, verify that Cash register statistics work as before
(Home > Reports > Cash register statistics)
- Verify the same for Home > Reports > Orders by fund (triggers orders_by_budget.tt)
- Bonus test: Create a "language" aa-AA (perl translate create aa-AA
from folder misc/translator, verify that lines mentioned above do
no longer appear in aa-AA-staff-prog.po )
- Run QA tools (newest version with test for newlines in tt directives)
Rebased on top of Bug 18734 2017-12-06 / mv
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
To test:
Output cash reigster stats report to file
Internal server error
Apply patch
Export to file
File is generated and correctly formed
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch adds a JavaScript confirm to the deletion of files. It also
styles the file deletion link as a Bootstrap button.
To test, apply the patch and open the "Files" page for a patron who has
files attached.
- Verify that clicking any "delete" link prompts for a confirmation.
- Verify that confirming the dialog triggers the deletion of the correct
file.
- Verify that canceling the confirmation dialog aborts the deletion.
- Confirm that the "Delete" button looks correct.
Signed-off-by: David Roberts <david.roberts@ptfs-europe.com>
Revision for QA: Replaced '.click(function' with '.on("click",function'
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
changed get() to get_ok() and increased test count to match.
Now the master build will only fail on search_utf8.t
TEST PLAN
---------
assuming KOHA_CONF is set.
$ export KOHA_INTRANET_URL=...
$ export KOHA_OPAC_URL=...
$ prove -v t/db_dependent/www/history.t
run koha qa test tools
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Works correctly using text plan provided and passes QA tools.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
TEST PLAN
---------
export KOHA_INTRANET_URL=...
prove -v t/db_dependent/www/search_utf8.t
something like seen before failure:
t/db_dependent/www/search_utf8.t .. 9/66 Error GETing http://koha_16_11:8080/cgi-bin/koha/tools/background-job-progress.pl?jobID=741d649f9d4472fe75f30761ba2488c0: Bad Request at t/db_dependent/www/search_utf8.t line 170.
apply this patch
prove -v t/db_dependent/www/search_utf8.t
Now it is the marc staging that is failing.
And that is failing in master for me.
So, I don't think it is the test that is a problem at this point,
but the actual staged marc records process.
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
I'm not sure why you had problems. All 66 tests passed
after patch application and the patch also passes QA Tools.
I tested this patch on a brand new kohadevbox without issue.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Test plan:
1. Start a normal install using the web installer
2. When asked to select data to load, verify that
'message_transport_types' is checked, and check some optional data
files
3. Continue the install to the end
4. Verify that message_transport_types is not empty, and that the
optional data you checked is there
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Whe checking a subfield to be deleted, the code
$(this).val($(this).siblings("[name='subfield']").val());
is useless, the checkbox already contains the subfield code :
<input type="checkbox" ... name="disable_input" value="[% ite.subfield %]" />
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
In Tools > Batch item modification, one can click a checkbox to delete a subfield.
This click use to disable the input to change the field value.
This comes from the patch : Bug 13501: Move "Required" and checkbox after input/select
Because input is found using JQuery next().
This patch replaces with $(this).parent().find("[name='field_value']").
Test plan :
- Go to Tools > Batch item modification
- Enter a barcode and submit
- Click on a checkbox on a non-mandatory subfield
=> Without patch the input or select is not disabled
=> With patch the input or select is disabled
- Submit
=> Check that subfield is deleted
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This script floods the logs with this kind of warnings.
To test:
- Run:
$ koha-plack-err
- Edit a vendor in the acquisitions module
- Save
=> FAIL: Logs show lots of warnings that look like:
CGI::param called in list context from package CGI::Compile::ROOT::home_vagrant_kohaclone_acqui_updatesupplier_2epl
- Apply this patch
- Run:
$ restart_all
$ koha-plack-err
- Edit a vendor, add/delete vendor contacts
=> SUCESS: No more warnings
- Verify editing and storing vendor contacts works as expected.
- Sign off :-D
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This tests print useless debugging info.
To test:
- Run:
$ sudo koha-shell kohadev
k$ cd kohaclone
k$ prove t/db_dependent/Koha/GetDailyQuote.t
=> FAIL: Some output telling what is doing on each step is printed.
- Apply the patch
- Run
k$ prove t/db_dependent/Koha/GetDailyQuote.t
=> SUCCESS: No output, YAY!
- Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
System preferences do not display values of text fields properly if they
contain doulbe quotes.
To recreate:
- Go to Home > Administration > System preferences , then tab Acquisitions
- Enter values to both system preferences like proposed in the example (o=5|a="bar foo" and o=5|a="foo bar")
- Save
- Click on tab Acquisitions to reload
- Wrong result: Both preferences show a value of: o=5|a=
(parts with double quotes are truncated)
- Edit any of the email addresses (Bug 9814):
KohaAdminEmailAddress, NoticeBcc, ReplytoDefault, PayPalUser
- Set value to: "The Library" <thelibrary@example.com>
- Search for this email address syspref to re-display it
- Wrong result:
Use [ ] " autocomplete="off" /> as the email address for the
administrator of Koha.
To test:
- Apply patch
- Try to recreate issues above
- Additionally, edit other system preferences that could contain double
quotes, e.g. LibraryName or UsageStatsLibraryName
- Set value to: Bibliothek "Zur Leseratte"
(Note: patch contains a tiny fix for a typo in acquisitions.pref)
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch fixes the calendar display with holidays having double qoutes in
title or description.
To test:
- Apply patch
- Go to Home > Tools > Calendar
- Create new holidays of each type (Day only, repeated wekly/yearly,
range, yearly repeated range and enter double qoutes in their titles and
descriptions
- Verify that calendar displays and works as expected
- Verify that you can edit the holidays
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Test plan:
1) Go to acquisition and receive some orders
2) Show the receive summary for invoice
--> without patch, the fund name in subtotal is not shown
--> with patch the name is shown as expected
Signed-off-by: Michael Cabus <michael@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
[tag] [reply] [−] Description M. Tompsett 2017-06-05 16:30:21 UTC
Know the barcode of an existing item.
Home -> Tools -> Batch Item Modification
Enter the barcode
Click
View Page source
select and copy it into validator.w3.org direct input.
There will be complaints about <labels>.
Apply this patch
refresh the page.
select and copy it into validator.w3.org direct input.
There will be no complaints about <labels>.
This is intended to be a highly focused HTML bug, as the
missing form tag which will fix the <div> issues at the bottom
is corrected on bug 18710.
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
This patch fixes a small mistake on that test file (itype vs. itemtype
in itemtypes table)
To test:
- Run:
$ sudo koha-shell kohadev
k$ cd kohaclone
k$ prove t/db_dependent/ArticleRequests.t
=> FAIL: itemtype-related warning displayed
- Apply the patch
- Run
k$ prove t/db_dependent/ArticleRequests.t
=> SUCCESS: No warnings, YAY!
- Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
While it might be an idea to just delete it,
this patch attempts to catch everything and make it
clear that Text::CSV::Unicode (binary) is the parser
that should be used.
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Running 'prove xt/author/Text_CSV_Various.t' passes
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Template directives should not be exposed in translation, but lines like the following pop up in the translation tool:
Cancel [% IF TransferWhenCancelAllWaitingHolds %]and Transfer [% END %] All
This patch fixes it.
To test:
- Apply patch
- Verify that code changes make sense
- Verify that submit buttons of pendingreserves.tt and waitingreserves.tt
still work and display the same string as before
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 18641: (RM-followup) for waitingreserves.tt
Code changed for waitingreserves.tt as asked for in comment #7
Bug 18641: Followup for pendingreserves.tt (less %s)
Change as of comment #13 to reduce %s
After creating a new translation for a "language" aa-AA, we have
the following in the file aa-AA-staff-prog.po
msgid ""
"(Inclusive, default is %s days ago to %s days ahead. Set other date ranges "
"as needed.)"
msgstr ""
msgid ""
"(Inclusive, default is %s days ago to today. Set other date ranges as "
"needed.)"
msgstr ""
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Circulation.t is failing randomly on our CI
https://jenkins.koha-community.org/job/Koha_Master_D8/192/console
# Failed test at t/db_dependent/Circulation.t line 1147.
# got: '1'
# expected: '0'
# Failed test at t/db_dependent/Circulation.t line 1152.
# got: '1'
# expected: '0'
# Failed test at t/db_dependent/Circulation.t line 1156.
# got: '1'
# expected: '0'
# Failed test at t/db_dependent/Circulation.t line 1170.
# got: '1'
# expected: '0'
# Failed test at t/db_dependent/Circulation.t line 1184.
# got: '1'
# expected: '0'
# Looks like you failed 5 tests of 23.
Sometimes one of the alert or impossible flags is set.
This patch guesses that it's because of the 'restricted' value of the item that is evaluated to 1.
If it is not fixed by this patch, we will have more info next time (at least know
if alert or impossible is set).
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The fix is trivial. Using random data will lead to this situations. The good thing is that
it lets us spot places in which tests need more fine-grained data.
"$itemnumbers_of_biblioitem" is declared but not used at line 314,
column 5. Unused variables clutter code and make it harder to read.
(Severity: 3)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
At this point this subroutine is only used once, from reserve/request.pl.
Since we already have the items, it's easy to populate the different
hashes as the rest of the code is expecting it.
Test plan:
You need to create analytical record relationships (
EasyAnalyticalRecords needs to be set). Link an item to a biblio using
the 'Edit > Link to host item' menu from the biblio detail page.
From the staff interface place a hold on the biblio. You should see the
items from the biblio and the one you just linked
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
REPLICATE ISSUE:
perl t/Prices.t -> fails
AFTER THIS PATCH AND DEPENDENCIES:
perl t/Prices.t -> OK
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
REPLICATE ISSUE:
perl t/SocialData.t -> fails
AFTER THIS PATCH AND DEPENDENCIES:
perl t/SocialData.t -> OK
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
REPLICATE ISSUE:
perl t/Koha.t -> fails
AFTER THIS PATCH AND DEPENDENCIES:
perl t/Koha.t -> OK
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
See also follow-up on bug 18286.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Is 'instantiations' even a word?
Use a Test::DBIx::Class defaults instead.
Save your keyboard and prevent horrible bugs from emerging from rampant code duplication.
This change doesn't seem to have any impact on the speed of executing those tests.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Couldn't make the tests pass using Test::DBIx::Class, so reverted to the "usual way" since these tests are
in db_dependent anyway.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/00-load.t already checks if all of the perl modules can be compiled.
The tests deleted in this commit do a duplicate test with t/00-load.t
Hence they have become unnecessary.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
A test in db_dependent should not make assumptions on the number of
branches in the database. If you need one, create one. Removing the
assumption of a non-zero count.
Removing the library count statement outside the subtest.
Replacing C4::Context by Koha::Database.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
We need this file here already.
Copied from bug 18226 and adjusted in order to keep qa tools quiet.
Test plan:
Run t/db_dependent/01-test_dbic.t again.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
If Koha::Database->schema gets called before
use Test::DBIx::Class
The DB connection from $KOHA_CONF is cached.
This happens most of the time because when C4::Context and friends are loaded
(in compile-time?), they already access the DB.
After Test::DBIx::Class is instantiated and hooks put in place to overload
Koha::Schema connection, those hooks are never called due to getting the old
connection from cache.
This feature introduces a test case to replicate the behaviour and shows how
flushing the connection cache solves the problem.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Safe way of getting and flushing the $database->{schema} -cache.
This is needed by Test::DBIx::Class to overcome pre-initialization connection
caching from C4::Context and others.
See Bug 18286.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Translation tool for file csv-profiles.tt picks following line:
%s [%% IF csv_profile.encoding == encoding OR NOT csv_profile AND encoding == 'utf8' %%]
It is is due to a line break inside a template directive. This patch removes it.
To test:
- Verify that code change makes sense
- Apply patch
- Verify that csv exports behave as before
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This string patch fixes typos in kohastructure.sql as described in initial
comment.
To test:
- Carefully verify that string changes make sense
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Test plan same as in previous patch
Run QA tools in newest version (test for line breaks in tt directives)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>