Bug 28906 - Koha::Items->filter_by_visible_in_opac doesn't honour list context
Summary: Koha::Items->filter_by_visible_in_opac doesn't honour list context
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on: 26223
Blocks:
  Show dependency treegraph
 
Reported: 2021-08-26 12:33 UTC by Tomás Cohen Arazi
Modified: 2022-12-12 21:23 UTC (History)
3 users (show)

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


Attachments
Bug 28906: Regression tests (1.29 KB, patch)
2021-08-26 12:38 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 28906: Make Koha::Items->filter_by_visible_in_opac honour list context (969 bytes, patch)
2021-08-26 12:38 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 28906: (26223 follow-up) Remove use of as_list (1.23 KB, patch)
2021-08-26 12:44 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 28906: (26223 follow-up) Remove use of as_list (2.17 KB, patch)
2021-08-26 12:48 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 28906: Regression tests (1.34 KB, patch)
2021-09-19 20:29 UTC, David Nind
Details | Diff | Splinter Review
Bug 28906: Make Koha::Items->filter_by_visible_in_opac honour list context (1018 bytes, patch)
2021-09-19 20:29 UTC, David Nind
Details | Diff | Splinter Review
Bug 28906: (26223 follow-up) Remove use of as_list (2.22 KB, patch)
2021-09-19 20:30 UTC, David Nind
Details | Diff | Splinter Review
Bug 28906: Regression tests (1.40 KB, patch)
2021-09-24 15:12 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28906: Make Koha::Items->filter_by_visible_in_opac honour list context (1.06 KB, patch)
2021-09-24 15:12 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28906: (26223 follow-up) Remove use of as_list (2.29 KB, patch)
2021-09-24 15:12 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2021-08-26 12:33:04 UTC

    
Comment 1 Tomás Cohen Arazi 2021-08-26 12:38:12 UTC
Created attachment 124112 [details] [review]
Bug 28906: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi 2021-08-26 12:38:21 UTC
Created attachment 124113 [details] [review]
Bug 28906: Make Koha::Items->filter_by_visible_in_opac honour list context

This patch makes the method honour list context.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Items.t
=> FAIL: Tests fail! It returns [Koha::Items]. Boo!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Tomás Cohen Arazi 2021-08-26 12:44:40 UTC
Created attachment 124114 [details] [review]
Bug 28906: (26223 follow-up) Remove use of as_list

This bug makes Koha::Items->filter_by_visible_in_opac honour list
context, so this explicit call is not needed.

To test:
1. Pick a biblio in the OPAC
2. Go to the ISBD view
=> SUCCESS: It renders correctly
3. Apply this patch and restart Plack
4. Refresh the ISBD view page
=> SUCCESS: It doesn't break!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi 2021-08-26 12:48:25 UTC
Created attachment 124115 [details] [review]
Bug 28906: (26223 follow-up) Remove use of as_list

This bug makes Koha::Items->filter_by_visible_in_opac honour list
context, so this explicit call is not needed.

To test:
1. Pick a biblio in the OPAC
2. Go to the ISBD view
=> SUCCESS: It renders correctly
3. Apply this patch and restart Plack
4. Refresh the ISBD view page
=> SUCCESS: It doesn't break!
5. Check opac-reserve.pl doesn't break either
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 David Nind 2021-09-19 20:29:55 UTC
Created attachment 125035 [details] [review]
Bug 28906: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2021-09-19 20:29:59 UTC
Created attachment 125036 [details] [review]
Bug 28906: Make Koha::Items->filter_by_visible_in_opac honour list context

This patch makes the method honour list context.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Items.t
=> FAIL: Tests fail! It returns [Koha::Items]. Boo!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2021-09-19 20:30:05 UTC
Created attachment 125037 [details] [review]
Bug 28906: (26223 follow-up) Remove use of as_list

This bug makes Koha::Items->filter_by_visible_in_opac honour list
context, so this explicit call is not needed.

To test:
1. Pick a biblio in the OPAC
2. Go to the ISBD view
=> SUCCESS: It renders correctly
3. Apply this patch and restart Plack
4. Refresh the ISBD view page
=> SUCCESS: It doesn't break!
5. Check opac-reserve.pl doesn't break either
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 Martin Renvoize 2021-09-24 15:12:11 UTC
Created attachment 125258 [details] [review]
Bug 28906: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2021-09-24 15:12:15 UTC
Created attachment 125259 [details] [review]
Bug 28906: Make Koha::Items->filter_by_visible_in_opac honour list context

This patch makes the method honour list context.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Items.t
=> FAIL: Tests fail! It returns [Koha::Items]. Boo!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize 2021-09-24 15:12:19 UTC
Created attachment 125260 [details] [review]
Bug 28906: (26223 follow-up) Remove use of as_list

This bug makes Koha::Items->filter_by_visible_in_opac honour list
context, so this explicit call is not needed.

To test:
1. Pick a biblio in the OPAC
2. Go to the ISBD view
=> SUCCESS: It renders correctly
3. Apply this patch and restart Plack
4. Refresh the ISBD view page
=> SUCCESS: It doesn't break!
5. Check opac-reserve.pl doesn't break either
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize 2021-09-24 15:12:46 UTC
All works as expected, no regressions found, QA scripts happy and tests all passing.

Passing QA
Comment 12 Jonathan Druart 2021-10-08 08:50:57 UTC
Blocked by the discussion on bug 28883.
IF we decide to remove wantarray it does not make sense to have this patch.
Comment 13 Tomás Cohen Arazi 2022-01-11 16:00:06 UTC
We decided to actually drop support for wantarray altogether in Koha::Objects. See bug 29844.