Bug 27266

Summary: Move C4::Biblio::GetMarcAuthors to Koha namespace
Product: Koha Reporter: Aleisha Amohia <aleisha>
Component: Architecture, internals, and plumbingAssignee: Aleisha Amohia <aleisha>
Status: Passed QA --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, martin.renvoize
Version: master   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 3150    
Attachments: Bug 27266: Move GetMarcAuthors to Koha namespace
Bug 27266: Move GetMarcAuthors to Koha namespace
Bug 27266: Move GetMarcAuthors to Koha namespace
Bug 27266: Move GetMarcAuthors to Koha namespace
Bug 27266: Move GetMarcAuthors to Koha namespace

Description Aleisha Amohia 2020-12-17 23:07:58 UTC

    
Comment 1 Aleisha Amohia 2020-12-18 01:11:49 UTC Comment hidden (obsolete)
Comment 2 Aleisha Amohia 2020-12-21 21:38:54 UTC
Created attachment 114580 [details] [review]
Bug 27266: Move GetMarcAuthors to Koha namespace

This patch moves C4::Biblio::GetMarcAuthors to
Koha::Biblio->get_authors_from_MARC. This is so the method can be
used in templates and notices.

To test:
1. Find a record that has an author in the added entry field (700-720).
2. Add the record to the cart and a list.
3. View your cart and click 'more details'. Confirm authors show as
normal.
4. Click 'send' and confirm the email sent shows the authors as normal.
5. Go to the list you added the record to and click 'send list'. Confirm
the email sent shows the authors as normal.
6. Set the OPACXSLTDetailsDisplay system preference to empty (for no
xslt)
7. Log in to the OPAC. Find the record and add it to the cart and a list
8. View the cart and click 'more details'. Confirm authors show as
normal.
9. Click 'send' and confirm the email sent shows the authors as normal.
10. Go to the list you added the record to and click 'send list'.
Confirm the email sent shows the authors as normal.
11. View the record detail page and confirm the authors show as normal.
12. Confirm tests pass:
- t/Biblio.t
- t/db_dependent/Koha/Biblio.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Comment 3 David Nind 2021-02-24 06:24:33 UTC
Created attachment 117239 [details] [review]
Bug 27266: Move GetMarcAuthors to Koha namespace

This patch moves C4::Biblio::GetMarcAuthors to
Koha::Biblio->get_authors_from_MARC. This is so the method can be
used in templates and notices.

To test:
1. Find a record that has an author in the added entry field (700-720).
2. Add the record to the cart and a list.
3. View your cart and click 'more details'. Confirm authors show as
normal.
4. Click 'send' and confirm the email sent shows the authors as normal.
5. Go to the list you added the record to and click 'send list'. Confirm
the email sent shows the authors as normal.
6. Set the OPACXSLTDetailsDisplay system preference to empty (for no
xslt)
7. Log in to the OPAC. Find the record and add it to the cart and a list
8. View the cart and click 'more details'. Confirm authors show as
normal.
9. Click 'send' and confirm the email sent shows the authors as normal.
10. Go to the list you added the record to and click 'send list'.
Confirm the email sent shows the authors as normal.
11. View the record detail page and confirm the authors show as normal.
12. Confirm tests pass:
- t/Biblio.t
- t/db_dependent/Koha/Biblio.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2021-02-24 06:43:08 UTC
Notes from testing with koha-testing-docker:

- I couldn't send email (it comes up with an error message when you click on the send buttons - problem sending email). I didn't have this issue when testing bug 3150, so I applied that and everything worked as expected with the test plan.

- To review the email I copied the HTML from the database (koha-mysql kohadev, select * from message_queue;) and saved it as an HTML file.
Comment 5 Martin Renvoize 2021-03-16 11:24:00 UTC
Sorry, this no longer applies.
Comment 6 Martin Renvoize 2021-03-16 11:31:45 UTC
Created attachment 118311 [details] [review]
Bug 27266: Move GetMarcAuthors to Koha namespace

This patch moves C4::Biblio::GetMarcAuthors to
Koha::Biblio->get_authors_from_MARC. This is so the method can be
used in templates and notices.

To test:
1. Find a record that has an author in the added entry field (700-720).
2. Add the record to the cart and a list.
3. View your cart and click 'more details'. Confirm authors show as
normal.
4. Click 'send' and confirm the email sent shows the authors as normal.
5. Go to the list you added the record to and click 'send list'. Confirm
the email sent shows the authors as normal.
6. Set the OPACXSLTDetailsDisplay system preference to empty (for no
xslt)
7. Log in to the OPAC. Find the record and add it to the cart and a list
8. View the cart and click 'more details'. Confirm authors show as
normal.
9. Click 'send' and confirm the email sent shows the authors as normal.
10. Go to the list you added the record to and click 'send list'.
Confirm the email sent shows the authors as normal.
11. View the record detail page and confirm the authors show as normal.
12. Confirm tests pass:
- t/Biblio.t
- t/db_dependent/Koha/Biblio.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2021-03-16 11:35:33 UTC
Created attachment 118312 [details] [review]
Bug 27266: Move GetMarcAuthors to Koha namespace

This patch moves C4::Biblio::GetMarcAuthors to
Koha::Biblio->get_authors_from_MARC. This is so the method can be
used in templates and notices.

To test:
1. Find a record that has an author in the added entry field (700-720).
2. Add the record to the cart and a list.
3. View your cart and click 'more details'. Confirm authors show as
normal.
4. Click 'send' and confirm the email sent shows the authors as normal.
5. Go to the list you added the record to and click 'send list'. Confirm
the email sent shows the authors as normal.
6. Set the OPACXSLTDetailsDisplay system preference to empty (for no
xslt)
7. Log in to the OPAC. Find the record and add it to the cart and a list
8. View the cart and click 'more details'. Confirm authors show as
normal.
9. Click 'send' and confirm the email sent shows the authors as normal.
10. Go to the list you added the record to and click 'send list'.
Confirm the email sent shows the authors as normal.
11. View the record detail page and confirm the authors show as normal.
12. Confirm tests pass:
- t/Biblio.t
- t/db_dependent/Koha/Biblio.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2021-03-16 11:35:52 UTC
Rebased
Comment 9 Martin Renvoize 2021-03-16 11:37:29 UTC
Tests pass, QA scripts pass and the code looks reasonable.

I'm not entirely sure about the method name.. we now have:

Koha::Biblio->get_marc_notes;

and

Koha::Biblio->get_authors_from_MARC;

For consistency, I think I'd prefer this patch to introduce

Koha::Biblio->get_marc_authors;

But... I think we can leave that decision to the RM.. so Passing QA :)