Bug 18833 - plugin unimarc_field_210c pagination error
Summary: plugin unimarc_field_210c pagination error
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Fridolin Somers
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-21 12:00 UTC by Fridolin Somers
Modified: 2019-10-14 19:57 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 18833 - plugin unimarc_field_210c pagination error (5.02 KB, patch)
2017-06-21 12:17 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 18833 - plugin unimarc_field_210c pagination error (5.10 KB, patch)
2017-10-19 12:15 UTC, Simon Pouchol
Details | Diff | Splinter Review
Bug 18833 - plugin unimarc_field_210c pagination error (5.19 KB, patch)
2017-11-17 09:00 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2017-06-21 12:00:15 UTC
In plugin unimarc_210c, the editors search results have pagination.
First page works but not other pages.
Comment 1 Fridolin Somers 2017-06-21 12:17:26 UTC
Created attachment 64486 [details] [review]
Bug 18833 - plugin unimarc_field_210c pagination error

In plugin unimarc_field_210c, the editors search results have pagination.
First page works but not other pages.

The main problem whas mainly because $startfrom var was missused. It is defined in C4::Output::pagination_bar as page number.
This patch corrects by using a $offset var.
Also removes dead code, obsoleted by using C4::Output::pagination_bar.
Also changes hardcoded results per page from 19 to 20.

Test plan :
- Use UNIMARC catalogue
- Define in framework value builder unimarc_field_210c on 210$c
- Create autority type EDITORS with heading 200$b
- Create 22 authorities of that type
- Index those new authorities
- Create a new biblio record
- Click on 210$c plugin
- Click on "Search"
- You see 20 results
- Click on page 2
=> Without patch you get empty table
=> With patch you get 2 results
- Check that you see "Results 21 to 22 of 22"
- Delete 2 autorities and retest
Comment 2 Simon Pouchol 2017-10-19 12:15:52 UTC
Created attachment 68295 [details] [review]
Bug 18833 - plugin unimarc_field_210c pagination error

In plugin unimarc_field_210c, the editors search results have pagination.
First page works but not other pages.

The main problem whas mainly because $startfrom var was missused. It is defined in C4::Output::pagination_bar as page number.
This patch corrects by using a $offset var.
Also removes dead code, obsoleted by using C4::Output::pagination_bar.
Also changes hardcoded results per page from 19 to 20.

Test plan :
- Use UNIMARC catalogue
- Define in framework value builder unimarc_field_210c on 210$c
- Create autority type EDITORS with heading 200$b
- Create 22 authorities of that type
- Index those new authorities
- Create a new biblio record
- Click on 210$c plugin
- Click on "Search"
- You see 20 results
- Click on page 2
=> Without patch you get empty table
=> With patch you get 2 results
- Check that you see "Results 21 to 22 of 22"
- Delete 2 autorities and retest

Works as intended.

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>
Comment 3 Marcel de Rooy 2017-11-17 09:00:17 UTC
Created attachment 69190 [details] [review]
Bug 18833 - plugin unimarc_field_210c pagination error

In plugin unimarc_field_210c, the editors search results have pagination.
First page works but not other pages.

The main problem whas mainly because $startfrom var was missused. It is defined in C4::Output::pagination_bar as page number.
This patch corrects by using a $offset var.
Also removes dead code, obsoleted by using C4::Output::pagination_bar.
Also changes hardcoded results per page from 19 to 20.

Test plan :
- Use UNIMARC catalogue
- Define in framework value builder unimarc_field_210c on 210$c
- Create autority type EDITORS with heading 200$b
- Create 22 authorities of that type
- Index those new authorities
- Create a new biblio record
- Click on 210$c plugin
- Click on "Search"
- You see 20 results
- Click on page 2
=> Without patch you get empty table
=> With patch you get 2 results
- Check that you see "Results 21 to 22 of 22"
- Delete 2 autorities and retest

Works as intended.

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2017-11-17 09:02:07 UTC
Code looks good to me. Not tested; two UNIMARC users already confirm it works. No string changes.
Comment 5 Jonathan Druart 2017-12-07 12:39:41 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 6 Nick Clemens 2017-12-14 12:30:41 UTC
Pushed to stable for 17.11.01, awesome work all!
Comment 7 Fridolin Somers 2017-12-20 08:13:42 UTC
Pushed to 17.05.x, will be in v17.05.07