Bug 12675

Summary: Remove CGI::scrolling_list from labeledMARCdetail.pl
Product: Koha Reporter: Bernardo Gonzalez Kriegel <bgkriegel>
Component: TemplatesAssignee: Bernardo Gonzalez Kriegel <bgkriegel>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 12675: Remove CGI::scrolling_list from labeledMARCdetail.pl
Bug 12675: Remove CGI::scrolling_list from labeledMARCdetail.pl
Bug 12675: Add unit test to GetFrameworksLoop
Bug 12675: Add unit test to GetFrameworksLoop
[SIGNED-OFF] Bug 12675: Remove CGI::scrolling_list from labeledMARCdetail.pl
[SIGNED-OFF] Bug 12675: Add unit test to GetFrameworksLoop
[SIGNED-OFF] Bug 12675: Add unit test to GetFrameworksLoop
[PASSED QA] Bug 12675: Remove CGI::scrolling_list from labeledMARCdetail.pl
[PASSED QA] Bug 12675: Add unit test to GetFrameworksLoop

Description Bernardo Gonzalez Kriegel 2014-07-29 20:14:22 UTC
One instance in this file
Comment 1 Bernardo Gonzalez Kriegel 2014-07-29 20:20:05 UTC Comment hidden (obsolete)
Comment 2 Bernardo Gonzalez Kriegel 2014-07-29 20:21:12 UTC
This still needs a unit test, trying to figure out how to write it :)
Comment 3 Bernardo Gonzalez Kriegel 2014-07-31 14:29:09 UTC Comment hidden (obsolete)
Comment 4 Bernardo Gonzalez Kriegel 2014-07-31 14:31:40 UTC Comment hidden (obsolete)
Comment 5 Bernardo Gonzalez Kriegel 2014-07-31 16:26:44 UTC Comment hidden (obsolete)
Comment 6 Bernardo Gonzalez Kriegel 2014-07-31 16:27:43 UTC
Ready to sign
Comment 7 Owen Leonard 2014-07-31 19:35:34 UTC Comment hidden (obsolete)
Comment 8 Owen Leonard 2014-07-31 19:40:13 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2014-08-02 21:07:49 UTC
Hm Bernardo, could you take a look at the test file? It works, but I wonder if  $dbh->rollback(); should not be outside of the last subtest. Also, the new subtests are the only ones not printing anything when doing
perl t/db_dependent/Koha.t - but I can see there are comments in the file.

Please switch back to Signed off if the changes are not too big.
Comment 10 Bernardo Gonzalez Kriegel 2014-08-02 23:32:18 UTC Comment hidden (obsolete)
Comment 11 Bernardo Gonzalez Kriegel 2014-08-02 23:43:15 UTC
(In reply to Katrin Fischer from comment #9)
> Hm Bernardo, could you take a look at the test file? It works, but I wonder
> if  $dbh->rollback(); should not be outside of the last subtest. Also, the
> new subtests are the only ones not printing anything when doing
> perl t/db_dependent/Koha.t - but I can see there are comments in the file.
> 
> Please switch back to Signed off if the changes are not too big.

Katrin, I moved the roolback() to the end of file outside subtest. 
It's the only change.

Now, messages. Using perl t/db_dependent/Koha.t I got

    # Subtest: GetFrameworksLoop() tests
    1..6
    ok 1 - No frameworks
    ok 2 - All frameworks
    ok 3 - None selected
    ok 4 - One selected
    ok 5 - Ordered result
    ok 6 - Full check, sorted by description with selected val (Bug 12675)
ok 8 - GetFrameworksLoop() tests

Do they not shown to you?
Comment 12 Katrin Fischer 2014-08-03 07:49:03 UTC
You are right, I think I miread it expecting it to be below the last line seeing it as the heading. Sorry!
Comment 13 Katrin Fischer 2014-08-03 09:50:37 UTC
Created attachment 30507 [details] [review]
[PASSED QA] Bug 12675: Remove CGI::scrolling_list from labeledMARCdetail.pl

This patch removes only instance in this file.

Also updates getframework POD on C4/Koha.pm,
adds new GetFrameworksLoop() func on same file from
suggested code, but with ordered result.

To test:
1. Apply the patch
2. Enable viewLabeledMARC syspref
3. On staff, search for a record, goto detail view
4. Clic on Labeled MARC
5. Framework pulldown was replaced, check changing
framework.

A bug was fixed, because selecting any fw and then Default
tries to load values from 'Default' fw code, which does not
exists.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes tests and QA script.
Comment 14 Katrin Fischer 2014-08-03 09:50:49 UTC
Created attachment 30508 [details] [review]
[PASSED QA] Bug 12675: Add unit test to GetFrameworksLoop

to test:
1. Apply the patch
2. Run the test, prove t/db_dependent/Koha.t
3. Check that it pass

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 15 Tomás Cohen Arazi (tcohen) 2014-08-03 20:40:23 UTC
Patches pushed to master.

New function, proper unit tests!
Thanks Bernardo!