Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 38050 - /lists #136

Open
wants to merge 64 commits into
base: main
Choose a base branch
from
Open

Bug 38050 - /lists #136

wants to merge 64 commits into from

Conversation

mrenvoize
Copy link
Member

No description provided.

Copy link
Member Author

@mrenvoize mrenvoize left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll also need unit tests.. examples in t/db_dependent/api


=cut

sub list {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole routine is rather custom without any real need for it to be.. please follow the patterns set in all the other API controllers... i.e. using the API helpers so we get all the search and query handling from there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to follow Tomas's example to some extent here and use:

my $lists_set = Koha::Virtualshelves->new;
$lists_set = $lists_set->filter_by_readable( { patron_id => $user->id } );

return $c->render(
    status  => 200,
    openapi => $c->objects->search($lists_set),
);

He's also got error handling in a wrapper.. you'll likely want that too for various failure cases the object searches can throw.

return $c->render(status => 201, json => { id => $list->id });
}

=head3 read
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please call this method 'get'.. 'read' is a homonym for a Perl builtin so can sometimes be confused... also, that would make this consistent with other controllers.

return $c->render(json => \@lists);
}

=head3 create
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please call this 'add' rather than 'create' for consistency with other API controllers.


=cut

sub create {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is another case where you've not used the foundations that have been laid out before you.

See the 'Cities' controller for reference as it's generally the most basic 'best practices' example... I should have pointed you to that.. assuming I didn't already.

sub add {
    my $c = shift->openapi->valid_input or return;

    return try {
        my $city = Koha::City->new_from_api( $c->req->json );
        $city->store;
        $c->res->headers->location( $c->req->url->to_string . '/' . $city->cityid );
        return $c->render(
            status  => 201,
            openapi => $c->objects->to_api($city),
        );
    }
    catch {
        $c->unhandled_exception($_);
    };
}

}
}

return $c->render(status => 201, json => { id => $list->id });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above.. by using 'json' as your output directly, you're skipping all validation... please use the 'openapi' output handler as that include validation against the specification files.


=cut

sub read {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a pattern for this one too:

sub get {
    my $c = shift->openapi->valid_input or return;

    return try {
        my $city = Koha::Cities->find( $c->param('city_id') );
        return $c->render_resource_not_found("City")
            unless $city;

        return $c->render( status => 200, openapi => $c->objects->to_api($city), );
    } catch {
        $c->unhandled_exception($_);
    };
}

I think you'll likely need to use the above mentioned filter_by_readable method however to ensure only those with appropriate access permissions can 'get' the specific list.


=cut

sub update {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's another template for this:

sub update {
    my $c = shift->openapi->valid_input or return;

    my $city = Koha::Cities->find( $c->param('city_id') );

    return $c->render_resource_not_found("City")
        unless $city;

    return try {
        $city->set_from_api( $c->req->json );
        $city->store();
        return $c->render( status => 200, openapi => $c->objects->to_api($city), );
    }
    catch {
        $c->unhandled_exception($_);
    };
}

We'll want to think about how we handle adding and removing biblios to/from lists.. lets keep the basic crud at the list level only however.


=cut

sub delete {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again.. there's a template:

sub delete {
    my $c = shift->openapi->valid_input or return;

    my $city = Koha::Cities->find( $c->param('city_id') );

    return $c->render_resource_not_found("City")
        unless $city;

    return try {
        $city->delete;
        return $c->render_resource_deleted;
    }
    catch {
        $c->unhandled_exception($_);
    };
}

minusdavid and others added 26 commits January 7, 2025 15:47
This change makes $sessionID consistently return using the session
ID and not sometimes the session object.

Test plan:
0. Apply the patch
1. koha-plack --restart kohadev
2. curl -v 'http://localhost:8081/cgi-bin/koha/svc/authentication' --cookie-jar /tmp/test.cookies
3. Note the Csrf-Token header value
4. Replace the <CSRF-TOKEN>, <USERID>, and <PASSWORD> tokens in the next step
using the appropriate values (eg the CSRF-TOKEN is from the previous step)
5. curl -v -H "Content-Type: application/x-www-form-urlencoded" \
    -H "Csrf-Token: <CSRF-TOKEN>" -XPOST \
    'http://localhost:8081/cgi-bin/koha/svc/authentication' \
    -d "login_userid=<USERID>&login_password=<PASSWORD>" \
    --cookie /tmp/test.cookies --cookie-jar /tmp/test.cookies
6. curl -XGET -v 'http://localhost:8081/cgi-bin/koha/svc/bib/29' \
    --cookie /tmp/test.cookies > rec.marcxml
7. curl -v 'http://localhost:8081/cgi-bin/koha/svc/authentication' \
    --cookie /tmp/test.cookies --cookie-jar /tmp/test.cookies
8. Note the Csrf-Token header value
9. curl -H "Content-Type: text/xml" -H "Csrf-Token: <CSRF-TOKEN>" \
    -XPOST -v 'http://localhost:8081/cgi-bin/koha/svc/bib/29' \
    --cookie /tmp/test.cookies --data @rec.marcxml

Signed-off-by: Jan Kissig <[email protected]>
Signed-off-by: Nick Clemens <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
When sending a notice of a hold ready for pickup (not digest) we use the library where the hold is at.

We should also use this when setting the reply to.

To test:
1 - Set the email/replyto for a patron's library to be:
    [email protected]
2 - Set the email/replyto for another branch to be:
    [email protected]
3 - Place a hold for the patron for pickup at the other branch
4 - Check in and set hold waiting
5 - SELECT * FROM message_queue
6 - Note the message is from the hold branch, but has a null replyto
    This means we will use patron branch when sending
7 - Apply patch
8 - Revert hold waiting status
9 - Checkin and confirm hold again
10  -Check message queue
11 - Hold now has reply address of branch

Signed-off-by: David Nind <[email protected]>
Signed-off-by: Baptiste Wojtkowski <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Signed-off-by: David Nind <[email protected]>
Signed-off-by: Victor Grousset/tuxayo <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Preparation: Create additional fields for table 'subscription', visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=subscription

2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field 942$c

Test plan, apply both patches:
1) Add a new serial subscription, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and press 'Ok' on the alert box.
3) Notice the message 'This message should only show if a select input is present' only shows for select inputs, i.e. it's only closing the element when it needs to

Signed-off-by: Jonathan Druart <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
This reverts commit 395e2bd.

Signed-off-by: Katrin Fischer <[email protected]>
This reverts commit 79085c4.

Signed-off-by: Katrin Fischer <[email protected]>
This reverts commit 889455b.

Signed-off-by: Katrin Fischer <[email protected]>
When an item is checked in that should automatically return to its home
branch, AddReturn generates the appropriate transfer. In some cases, the
Print Slip button generates a second transfer, which now causes an
exception to be thrown.

In returns.pl, the op cud-dotransfer is used when a transfer was not
initiated previously and the librarian has confirmed they want to
initiate and send a transfer. The op cud-transfer is used when a
transfer has already been generated and the page needs to send or
cancel the transfer.

This patch updates the op from the modal to ensure that the correct of
the two options is generated according to whether a transfer was already
initiated or not.

To test:
1. Find or create an item that belongs to a branch other than the
   logged-in branch
2. In a new tab, check in the item - this should trigger a Return to
   Home transfer (keep the bib record tab open for later)
3. Click "Print Slip"
--> Internal server error - 'Active item transfer already exists'
4. Apply patch and restart_all
5. Check in item again and cancel the transfer
6. Check in item again to generate new transfer
7. Click "Print Slip"
--> Checkin page loads correctly
--> Refresh bib record and confirm item shows as in-transit
8. Enable syspref ShowAllCheckins
9. Repeat steps 5-7
--> Ensure item displays correctly in checkins table
--> Refresh bib record and confirm item still shows as in-transit
10. Repeat steps 5-7, except this time click "Yes" instead of "Print
    Slip"
--> Ensure item displays correctly in the checkins table
--> Refresh bib record and confirm item shows as in-transit
10. Set syspref TransfersBlockCirc to Don't Block, and set
    AutomaticConfirmTransfer to Enable
11. Check in the item again and cancel the transfer
12. Check in the item to generate new transfer
13. Click away from the modal without selecting a response
--> Ensure item displays correctly in the checkins table
--> Refresh bib record and confirm item shows as in-transit
14. Check out the item to a customer
15. Check the item in and click "Yes"
--> Ensure item displays correctly in the checkins table
--> Refresh bib record and confirm item shows as in-transit
16. Repeat steps 14-15, clicking "Print Slip" instead of "Yes"
--> Ensure item displays correctly in the checkins table
--> Refresh bib record and confirm item shows as in-transit
17. Repeat steps 14-15, clicking away from the modal without selecting a
    response
--> Ensure item displays correctly in the checkins table
--> Refresh bib record and confirm item shows as in-transit

Signed-off-by: Victor Grousset/tuxayo <[email protected]>
Signed-off-by: Baptiste Wojtkowski <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Signed-off-by: Victor Grousset/tuxayo <[email protected]>
Signed-off-by: Baptiste Wojtkowski <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Sponsored-by: Gothenburg University Library
Signed-off-by: David Nind <[email protected]>
Signed-off-by: Tomas Cohen Arazi <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Jan Kissig <[email protected]>
Signed-off-by: Victor Grousset/tuxayo <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Signed-off-by: David Nind <[email protected]>
Signed-off-by: Tomas Cohen Arazi <[email protected]>
Edit: tidied inline (tcohen)
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Jan Kissig <[email protected]>
Signed-off-by: Victor Grousset/tuxayo <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Fallback to overlay rules with wildcard filter if no match
found for exact filter match.

To test:
1. Administration => record overlay rules
2. Add this:
Module  Filter	                   Tag Preset  Added Appended Removed Deleted
Source  Z39.50 	                   245 Protect Skip  Skip     Skip    Skip
Source  * 	                   300 Protect Skip  Skip     Skip    Skip
Source  Batch record modification  245 Protect Skip  Skip     Skip    Skip
3. Add MARC modification templates:
Update existing or add new field 245$a with value CATSCATSCATSCATS
Update existing or add new field 300$a with value CATSCATSCATSCATS
4. Find a record that has those fields (likely any record would)
5. Use batch record modification on the record
6. 300$a should have been catified (expected, that's the bug)
7. 245$a is preserved
8. Change the value of the 300$a to something else.
   Temporarly disable MARCOverlayRules to be able to do so. And reenable
   it.
9. Apply the patch, restart services
10. Use batch record modification on the record
11. 300$a should be preserved, cat protection should have worked
12. Run tests: prove t/db_dependent/Biblio/MarcOverlayRules.t
13. Celebrate! :D

Sponsored-by: Gothenburg University Library
Signed-off-by: David Nind <[email protected]>
Signed-off-by: Tomas Cohen Arazi <[email protected]>
Edit: tidied inline (tcohen)
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Jan Kissig <[email protected]>
Signed-off-by: Victor Grousset/tuxayo <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Signed-off-by: Jan Kissig <[email protected]>
Signed-off-by: Victor Grousset/tuxayo <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Signed-off-by: Jan Kissig <[email protected]>
Signed-off-by: Victor Grousset/tuxayo <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
On a table using DataTables and the REST API wrapper with the column
filters, if one input is used to filter the table the query will be made
twice: when the user stopped typing and when the input will lose the
focus.

Test plan:
Search for patron
Open the dev console, "Network" tab
In the "Card" column filter enter "0000"
Notice that the table is filtered and that a request has been made
Click outside of the "Card" input
=> Without this patch another request (the same) is made and the table
updated
=> With this patch applied no request is made when the input loses the
focus.

Signed-off-by: Jake Deery <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
… cleared between requests

Account level syspref overrides in SIP will "leak" between SIP requests.

Basically an account level system preference override will may be set by a given request, but those overrides will never be cleared for the life of that SIP process thus "contaminating" that process until it reaches end of life".

This is because the code
    # Clear overrides from previous message handling first
    foreach my $key ( keys %ENV ) {
        delete $ENV{$key} if index($key, 'OVERRIDE_SYSPREF_') > 0;
    }
is checking if the env key contains the substring OVERRIDE_SYSPREF_ at an index greater than 0. The problem is that for all overrides the subtring *starts at 0* since it's always the first part of the string. If the substring is not part of the string index will return -1. TLDR we have an "off by one" error. We need to check that the return value is zero instead of any positive value.

1) Set your SIP server params so that only one SIP process should run,
  <server-params
    min_servers='1'
    min_spare_servers='0'
    max_spare_servers='0'
    max_servers='0'
    custom_tcp_keepalive='0'
    custom_tcp_keepalive_time='7200'
    custom_tcp_keepalive_intvl='75'
  />
2) Set noissuescharge to $5
3) Create two SIP accounts
4) Set an account level override for noissuescharge to $500
5) Create a patron that owes $10 in fines
6) Run a patron information request on the "normal" SIP account for the
   patron, the patron flags should show the patron being not able to
   check out items
7) Run a patron information request of the "overridden" SIp account for
   the patron, the patron flags should show the patron being allowed to
   check out items
8) Run a second patron information request on the "normal" SIP account
   for the patron, the patron flags should show the patron being able to
   check out even though they should not be able to check out
9) Apply this patch
10) Restart all the things!
11) Repeast steps 6-8
12) The flags should be correct!

Signed-off-by: Jake Deery <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
It seems that "Edit" was not picked by the translator script because there was a TT tag
on the same line.

See comment 0 for a test plan.

Signed-off-by: David Nind <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
This patch updates the EDI code to use the Koha::Logger wrapper in
preference to the bare Log::Log4perl module.

Signed-off-by: Victor Grousset/tuxayo <[email protected]>
Signed-off-by: Kyle M Hall <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
This patch adds the Log4perl configurations required to match the
existing prior use of Log4perl in EDI code.

Signed-off-by: Victor Grousset/tuxayo <[email protected]>
Signed-off-by: Kyle M Hall <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Signed-off-by: Kyle M Hall <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
We re-arrange the logic of process_invoice a little here to ensure we
skip order lines in invoices that do not have corresponding bib records.

Signed-off-by: Kyle M Hall <[email protected]>
Signed-off-by: Victor Grousset/tuxayo <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Sponsored-by: PTFS Europe <https://ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <[email protected]>
Signed-off-by: Kyle M Hall <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
This patch adds proper coverage of getLanguages() to the existing test
file.

It should pass prior to applying the rest of the patchset of this bug

Signed-off-by: Katrin Fischer <[email protected]>
…le SQL query

My profiling with NYTProf has found that the call to C4::Languages::getLanguages is unreasonably slow, taking over 100 ms (and that's just on a single call of it apparently!!!). Indeed, the way it's coded, it'd run over 540 SQL queries for no good reason, slowing the already slow catalog search page loading further down.

This patch is gonna replace the inefficient and complicated function logic with proper SQL statement that joins the relevant functions. It also fixes the bug where user's native language would be displayed with native language in the parenthesis as well, such as "Polski (Polski)" instead of just "Polski".

The whole query is pretty fast and it gets cached by MySQL server, meaning its runtime is measured in microseconds instead of hundreds of miliseconds, making it easily a 1000x+ improvement.

Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
We can use a plain AND in the WHERE clause here rather than requireing a
HAVING.

Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
joubu and others added 29 commits January 10, 2025 19:19
Signed-off-by: David Nind <[email protected]>
Signed-off-by: Pedro Amorim <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
To test:
1. FinesMode on
2. CircConfirmItemParts on
3. have an item with a materials specified note (952$3)
4. Check in item with 'forgive overdue charge' selected, no materials note, box stays checked.
5. Check in item with 'forgive overdue charge' selected, with a material note, Materials note checkin deselects the box.
6. APPLY PATCH
7. Try steps 4-5 again, the correct value should be retained in the 'forgive overdue charge' checkbox.

Signed-off-by: David Nind <[email protected]>
Signed-off-by: Brendan Lawlor <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
A few notes:
- I grabbed this list by looking for things in misc/ that had cronlogaction
- I didn't touch scripts that aren't in the cronjobs directory, except
  fix_invalid_dates where I follow import_patrons and only log if confirmed
  since they aren't crons, I figure this seems reasonable
- purge_suggestions I moved the logggin up and changed the addition of
  effective days to a verbose message - this seems more consistent

To test:
 1 - Enable CronjobLog
 2 - On command line:
     perl misc/cronjobs/cleanup_database.pl --old_reservers 550
 3 - Error on command line
 4 - In staff client, go to Tools->Log viewer, check 'Cronjobs' and submit
 5 - No entries
 6 - Apply patch
 7 - Repeat and see run is logged with wrong parameter
 8 - Fix parameter and confirm
 9 - Spot check other files until you are satisfied
10 - Sign it off!

Signed-off-by: William Lavoie <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
This change makes it so that C4::Languages::getLanguages is only
called for the advanced search pages and not the search result pages
where the output is not used.

Test plan:
0. Apply the patch and koha-plack --restart kohadev
1. Go to http://localhost:8081/cgi-bin/koha/catalogue/search.pl?expanded_options=1
2. Note that the "Language" and "Language of original" dropdowns appear with language
options
3. Go to the following
http://localhost:8081/cgi-bin/koha/catalogue/search.pl?advsearch=1
&idx=kw&q=test&sort_by=relevance
4. Note that the page loads normally

5. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?expanded_options=1
6. Note that the "Language" dropdown appears with language options
7. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1
8. Note that the page loads normally

Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
This updates the extended_attributes method to also act as setter.
Additionally, it'll skip adding any attribute that result in error,
preventing an ugly error 500.

Test plan:
1) Enable ILLModule sys pref
2) Attempt to create the following openurl request through the OPAC:
   http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?DOI=10.1001%2Fjama.2024.11146&atitle=Interventions%20for%20High%20Body%20Mass%20Index%20in%20Children%20and%20Adolescents%3A%20US%20Preventive%20Services%20Task%20Force%20Recommendation%20Statement.&aulast=Nicholson%2C%20Wanda%20K.&backend=FreeForm&cardnumber=53807898&date=20240716&genre=article&id=DOI%3A10.1001%2Fjama.2024.11146&issn=00987484&issue=3&method=create&opac=1&openurl=1
3) Notice it fails with a Duplicate ID error and the OPAC blows up.
   This is because Koha is trying to add the 'DOI' illrequestattribute
   twice and that is resulting in a duplicate ID
4) Apply patches, repeat test plan, notice the error no longer happens,
   the request is created correctly and all successful attribute have
   been added.

Signed-off-by: David Nind <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
prove t/db_dependent/Koha/ILL/Request.t

Signed-off-by: David Nind <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Make use of newly updated ILL::Request->extended_attributes method instead of
creating the query manually

Signed-off-by: David Nind <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Make use of newly updated ILL::Request->extended_attributes method instead of creating the query manually

The test plan in bug 38819 fails without this patch (page explodes with duplicate ID error).
It's the same cause as the one being fixed here in bug 38751 so I'm submitting this here.

Signed-off-by: David Nind <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
…mounts of data for development and testing

Test Plan:
1) Apply this patch
2) Run: misc/devel/create_test_data.pl -n 99 -s Borrower -d surname=Hall  -d zipcode=111111
3) Search patrons' for the name "Hall"
4) Note there are 99 Hall's in your results!

Signed-off-by: Kyle M Hall <[email protected]>
Signed-off-by: Pedro Amorim <[email protected]>

Bug 37448: Make use of build_sample_biblio and build_sample_item

The script is brilliant, but for biblios and items we should make use of build_sample_biblio and build_sample_item or this data does not get indexed + linked tables rows get missed

To test, before this patch, run:
1) misc/devel/create_test_data.pl -n 5 -s Biblio -d title=Test
  Notice the 'Test' biblio is created on the database, but doesnt show on searches, and accessing it directly through URL throws a 500 error (because metadata does not exist for the biblio)
2) Apply this patch. Repeat the step above. Notice it now shows on searches and visiting the biblio directly shows no errors

Signed-off-by: Pedro Amorim <[email protected]>

Signed-off-by: Kyle M Hall <[email protected]>

Bug 37448: (QA follow-up) Tidy script

Signed-off-by: Kyle M Hall <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
The linked biblio_id of a generated test ILL request needs to be created by build_sample_biblio->AddBiblio.
Or else the related biblio is created by just 'build' and is not indexed + its related metadata is missing.

To test:
1) Apply the [DONT PUSH] patch and enable ILLModule
2) Run the script for ILL requests:
  misc/devel/create_test_data.pl -n 5 -s Illrequest -d backend=Standard
3) Visit the ILLModule:
  http://<intra_url>/cgi-bin/koha/ill/ill-requests.pl
4) Notice it loads 5 test ILL requests correctly

Signed-off-by: Pedro Amorim <[email protected]>
Signed-off-by: Kyle M Hall <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
This particular script has POD at the end rather than inline POD. This
patch simply moves the POD addition for this patchset into the bottom
section.

Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
prove t/db_dependent/Circulation.t

Signed-off-by: Ray Delahunty <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
…code is falsy

Before applying this patch, apply the CanBookBeIssued preparation: tests patch and run that,
Verify it fails, apply this patch. Run that same tests file again.

----- About this change -----

CanBookBeIssued wants to find one item given a barcode.
If a falsy (undef, empty) barcode is supplied, UNKNOWN_BARCODE should be returned.

Ensure this change does not introduce any regressions:
prove t/db_dependent/Circulation*
prove t/db_dependent/DecreaseLoanHighHolds.t
prove t/db_dependent/rollingloans.t
prove t/db_dependent/api/v1/checkouts.t
prove t/db_dependent/Patron/Borrower_PrevCheckout.t

Signed-off-by: Ray Delahunty <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Cosmetic changes only.

Signed-off-by: Ray Delahunty <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
Test plan, before applying patches:
1) Enable ILLModule system preferece.
2) Create a book ILL request:
  <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) After creating a Book ILL request, go to its detail page and click on the newly created linked biblio
4) On the biblio detail, click 'NEW' -> 'New item', add type and home library + current library (dont enter a barcode)
5) Repeat 2) -> Click confirm request and continue.
6) Click "Check out" -> If theres a problem with the patron (expired or max checkouts hit) it'll say "A problem with patron occurred". Fix that adn click c"check out" again.
7) Notice the message "An unknown error occurred while trying to checkout the item"
8) Apply patches. Repeat. Notice the message you now get is 'The bibliographic record's item contains an unknown (or empty) barcode.'.

This patch also adds a link to the respective biblio for Staff members'
convenience.

Signed-off-by: Ray Delahunty <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
prove t/db_dependent/Koha/ILL/Requests.t

Signed-off-by: Ray Delahunty <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
This should have been removed by bug 22056

Signed-off-by: William Lavoie <[email protected]>

Signed-off-by: Marcel de Rooy <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
test plan:
    1. check run order of scripts in the cron
    2. apply patch
    3. koha-run-backups is now at the beginning of the cron

Signed-off-by: David Nind <[email protected]>

Signed-off-by: Marcel de Rooy <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
…staff interface advanced search

This patch makes it so that the noItemTypeImages system preference is
the one that controls the display of item type images in the staff
interface advanced search page. It was previously erroneously managed by
the OpacNoItemTypeImages system preference.

To test:

1. Add images to item types, if there aren't any already (KTD has them by default)
   1.1. Go to Administration > Item types
   1.2. Click 'Edit' next to one of the item types
   1.3. Choose an icon
   1.4. Click 'Save changes'

2. Disable OpacNoItemTypeImages

3. Enable noItemTypeImages (already enabled in KTD)

4. Go to the advanced search page
   --> The item types don't have any images next to them

5. Apply patch and refresh the page
   --> The item type images should be displayed

Signed-off-by: David Nind <[email protected]>

Signed-off-by: Marcel de Rooy <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
This fixes some database update messages to improve their
consistency with the database update guidelines
https://wiki.koha-community.org/wiki/Database_updates

Test plan:
1. Apply the patch.
2. Review the differences to make sure the messages make
   sense and are consistent with the database update
   guidelines:
   2.1 Review the diff attached to the bug
   or
   2.2 Run: git show
3. Sign off D:

Signed-off-by: David Nind <[email protected]>
Signed-off-by: Leo Stoyanov <[email protected]>

Signed-off-by: Marcel de Rooy <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
updates "Field suppresion" to "Field suppression"

to test:
- go to Administration/Authority types/Default framework/Tag 090
- verify description for subfield t is Field suppresion, FSP (RLIN)

- apply patch
- reset database or reset_all
- verify description has changed to Field suppression,FSP (RLIN)

Signed-off-by: William Lavoie <[email protected]>
Signed-off-by: Brendan Lawlor <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
This patch fixes a typo in the description of the
EmailAddressForPatronRegistrations system preference.

To test:
1. Apply patch
2. Go to Administration > System preferences
3. Search for EmailAddressForPatronRegistrations
4. Read the description (2nd line) and make sure the spelling is correct

Signed-off-by: Magnus Enger <[email protected]>
Works as advertised.

Signed-off-by: Marcel de Rooy <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
This patch creates the yaml definitions for the CRUD enpoints for virtualshelves/lists
This patch implements the methods for the admin CRUD endpoints for lists/virtualshelves
This patch creates the yaml definitions for the public CRUD enpoints for lists/virtualshelves
This patch creates the methods for the public CRUD enpoints for lists/virtualshelves
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.