Bug 35570 - Add a generic master form in ILL
Summary: Add a generic master form in ILL
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low new feature
Assignee: Pedro Amorim
QA Contact: Tomás Cohen Arazi (tcohen)
URL:
Keywords: roadmap_24_11
Depends on: 35581 35681
Blocks: 38288 38289 38339 38340 38341 35725 38276
  Show dependency treegraph
 
Reported: 2023-12-14 12:57 UTC by Pedro Amorim
Modified: 2024-12-05 21:14 UTC (History)
15 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This incorporates the ILL backend previously known as "FreeForm" (https://github.com/PTFS-Europe/koha-ill-freeform) into core Koha, now labeled as "Standard". This allows the ILL module to be used as soon as the ILLModule system preference is enabled, without the need to install additional third-party backends, although the option to do so still exists. Upon upgrading, all prior "FreeForm" ILL requests, attributes, and comments will be transferred to the new "Standard" backend.
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 35570: Put 'FreeForm' backend into core as 'Standard' (81.66 KB, patch)
2023-12-18 11:35 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Consider 'Standard' core backend (3.98 KB, patch)
2023-12-18 11:35 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Atomicupdate (4.01 KB, patch)
2023-12-18 11:35 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed (4.85 KB, patch)
2023-12-18 11:35 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): (45.37 KB, patch)
2023-12-18 11:36 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: QA follow-up: (2.80 KB, patch)
2024-01-03 11:19 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): (1.16 KB, patch)
2024-01-03 12:07 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Put 'FreeForm' backend into core as 'Standard' (81.68 KB, patch)
2024-01-08 20:46 UTC, David Nind
Details | Diff | Splinter Review
Bug 35570: Consider 'Standard' core backend (4.02 KB, patch)
2024-01-08 20:46 UTC, David Nind
Details | Diff | Splinter Review
Bug 35570: Atomicupdate (4.06 KB, patch)
2024-01-08 20:46 UTC, David Nind
Details | Diff | Splinter Review
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed (4.90 KB, patch)
2024-01-08 20:46 UTC, David Nind
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): (44.40 KB, patch)
2024-01-08 20:46 UTC, David Nind
Details | Diff | Splinter Review
Bug 35570: QA follow-up: (2.85 KB, patch)
2024-01-08 20:46 UTC, David Nind
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): (1.20 KB, patch)
2024-01-08 20:47 UTC, David Nind
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Fix action button links. Use url filter instead of uri. (3.41 KB, patch)
2024-01-09 09:56 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Put 'FreeForm' backend into core as 'Standard' (81.72 KB, patch)
2024-01-26 12:56 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Consider 'Standard' core backend (4.02 KB, patch)
2024-01-26 12:56 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Atomicupdate (4.11 KB, patch)
2024-01-26 12:56 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed (4.91 KB, patch)
2024-01-26 12:56 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Follow QA script on Standard backend (44.18 KB, patch)
2024-01-26 12:56 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Show appropriate error message when type is missing (1.27 KB, patch)
2024-01-26 12:56 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Bug 36243 compatibility (2.08 KB, patch)
2024-03-07 10:46 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Fix OPAC CSRF (2.25 KB, patch)
2024-03-07 11:20 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Put 'FreeForm' backend into core as 'Standard' (81.72 KB, patch)
2024-03-07 11:50 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Consider 'Standard' core backend (4.02 KB, patch)
2024-03-07 11:50 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Atomicupdate (4.11 KB, patch)
2024-03-07 11:50 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed (4.93 KB, patch)
2024-03-07 11:51 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Follow QA script on Standard backend (44.18 KB, patch)
2024-03-07 11:51 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Show appropriate error message when type is missing (1.27 KB, patch)
2024-03-07 11:51 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Bug 36243 compatibility (2.08 KB, patch)
2024-03-07 11:51 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Fix OPAC CSRF (2.25 KB, patch)
2024-03-07 11:51 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Put 'FreeForm' backend into core as 'Standard' (81.72 KB, patch)
2024-04-02 14:18 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Consider 'Standard' core backend (3.94 KB, patch)
2024-04-02 14:18 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Atomicupdate (4.11 KB, patch)
2024-04-02 14:18 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed (4.93 KB, patch)
2024-04-02 14:18 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Follow QA script on Standard backend (44.18 KB, patch)
2024-04-02 14:18 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Show appropriate error message when type is missing (1.27 KB, patch)
2024-04-02 14:18 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Bug 36243 compatibility (2.08 KB, patch)
2024-04-02 14:19 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Fix OPAC CSRF (2.25 KB, patch)
2024-04-02 14:19 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Put 'FreeForm' backend into core as 'Standard' (81.72 KB, patch)
2024-04-19 13:53 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Consider 'Standard' core backend (3.96 KB, patch)
2024-04-19 13:53 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Atomicupdate (4.11 KB, patch)
2024-04-19 13:53 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed (4.93 KB, patch)
2024-04-19 13:54 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Follow QA script on Standard backend (44.18 KB, patch)
2024-04-19 13:54 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Show appropriate error message when type is missing (1.27 KB, patch)
2024-04-19 13:54 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Bug 36243 compatibility (2.08 KB, patch)
2024-04-19 13:54 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Fix OPAC CSRF (2.25 KB, patch)
2024-04-19 13:54 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Put 'FreeForm' backend into core as 'Standard' (81.72 KB, patch)
2024-04-22 13:52 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Consider 'Standard' core backend (3.99 KB, patch)
2024-04-22 13:52 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Atomicupdate (4.11 KB, patch)
2024-04-22 13:52 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed (4.71 KB, patch)
2024-04-22 13:52 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Follow QA script on Standard backend (43.59 KB, patch)
2024-04-22 13:52 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Show appropriate error message when type is missing (1.27 KB, patch)
2024-04-22 13:52 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Bug 36243 compatibility (2.08 KB, patch)
2024-04-22 13:52 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Fix OPAC CSRF (2.25 KB, patch)
2024-04-22 13:52 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Rebase on final state of bug 35681 (3.27 KB, patch)
2024-05-22 15:57 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Rebase on final state of bug 35681 (3.10 KB, patch)
2024-05-22 15:59 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Put 'FreeForm' backend into core as 'Standard' (81.68 KB, patch)
2024-09-11 13:20 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Consider 'Standard' core backend (3.99 KB, patch)
2024-09-11 13:21 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Atomicupdate (4.11 KB, patch)
2024-09-11 13:22 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Put 'FreeForm' backend into core as 'Standard' (81.68 KB, patch)
2024-09-11 13:44 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Consider 'Standard' core backend (3.99 KB, patch)
2024-09-11 13:44 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Atomicupdate (4.11 KB, patch)
2024-09-11 13:44 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed (4.70 KB, patch)
2024-09-11 13:44 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Follow QA script on Standard backend (43.56 KB, patch)
2024-09-11 13:44 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Show appropriate error message when type is missing (1.27 KB, patch)
2024-09-11 13:44 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Bug 36243 compatibility (2.08 KB, patch)
2024-09-11 13:44 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Fix OPAC CSRF (2.25 KB, patch)
2024-09-11 13:44 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Rebase on final state of bug 35681 (3.10 KB, patch)
2024-09-11 13:44 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA Follow-up: Standard backend: Biblio creation: Add UNIMARC support (2.44 KB, patch)
2024-09-30 10:13 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Biblio creation: Add UNIMARC support (2.44 KB, patch)
2024-09-30 10:14 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: Put 'FreeForm' backend into core as 'Standard' (81.72 KB, patch)
2024-10-14 14:37 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: Consider 'Standard' core backend (3.99 KB, patch)
2024-10-14 14:37 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: Atomicupdate (4.11 KB, patch)
2024-10-14 14:37 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed (4.71 KB, patch)
2024-10-14 14:38 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Follow QA script on Standard backend (43.59 KB, patch)
2024-10-14 14:38 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Show appropriate error message when type is missing (1.27 KB, patch)
2024-10-14 14:38 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Bug 36243 compatibility (2.08 KB, patch)
2024-10-14 14:38 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Fix OPAC CSRF (2.25 KB, patch)
2024-10-14 14:38 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Rebase on final state of bug 35681 (3.11 KB, patch)
2024-10-14 14:38 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Biblio creation: Add UNIMARC support (2.44 KB, patch)
2024-10-14 14:38 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: (QA follow-up) Tidy (2.67 KB, patch)
2024-10-14 14:38 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: Make strings in Standard.pm translatable (4.34 KB, patch)
2024-10-14 14:38 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: Use ->extended_attributes() (2.33 KB, patch)
2024-10-14 14:38 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: Do not unbless iterator (1.58 KB, patch)
2024-10-14 14:38 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: Put 'FreeForm' backend into core as 'Standard' (81.77 KB, patch)
2024-10-14 18:01 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: Consider 'Standard' core backend (4.04 KB, patch)
2024-10-14 18:01 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: Atomicupdate (4.17 KB, patch)
2024-10-14 18:01 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed (4.76 KB, patch)
2024-10-14 18:01 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Follow QA script on Standard backend (43.65 KB, patch)
2024-10-14 18:01 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Show appropriate error message when type is missing (1.33 KB, patch)
2024-10-14 18:01 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Bug 36243 compatibility (2.14 KB, patch)
2024-10-14 18:01 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Fix OPAC CSRF (2.30 KB, patch)
2024-10-14 18:01 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Rebase on final state of bug 35681 (3.16 KB, patch)
2024-10-14 18:01 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Standard backend: Biblio creation: Add UNIMARC support (2.50 KB, patch)
2024-10-14 18:01 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: (QA follow-up) Tidy (2.67 KB, patch)
2024-10-14 18:01 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: Make strings in Standard.pm translatable (4.34 KB, patch)
2024-10-14 18:01 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: Use ->extended_attributes() (2.33 KB, patch)
2024-10-14 18:01 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: Do not unbless iterator (1.58 KB, patch)
2024-10-14 18:02 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: Revert some strings translatability (4.02 KB, patch)
2024-10-15 14:39 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Fix DVD type (3.52 KB, patch)
2024-10-16 09:57 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Update UNIMARC author to 200$f (2.51 KB, patch)
2024-10-16 10:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Fix styling of confirmation buttons (3.82 KB, patch)
2024-11-04 13:17 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Fix terminology (3.29 KB, patch)
2024-11-04 13:17 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 35570: (QA follow-up): Fix translatability of 'Delete' (2.13 KB, patch)
2024-11-04 13:18 UTC, Pedro Amorim
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2023-12-14 12:57:50 UTC
The idea is to:

1) Have a generic master form in ILL based on current FreeForm's form at:
https://github.com/PTFS-Europe/koha-ill-freeform
2) Deprecate the above FreeForm backend
3) Perhaps rethink the name to "Standard", "Default", something like that?
4) Migrate FreeForm requests for this new "Standard backend" built in core on upgrade

Reasoning behind this:
- The ILL module does not work out of the box, it requires at least one backend to work. This is not great as ideally enabling the system preference should be enough to make use of the module, without additional work being needed.
- This master form in core would allow for future extensions of the ILL module, could be used as baseline for future work that will optionally not require the user (Staff/OPAC) to pick the backend beforehand if several backends are installed 
 - the user may not know which backend to pick, they likely just know what they're looking for.

Thoughts?
Comment 1 Tomás Cohen Arazi (tcohen) 2023-12-14 13:18:52 UTC
I love the idea.
Comment 2 Magnus Enger 2023-12-18 07:56:57 UTC
(In reply to Pedro Amorim from comment #0)
> Thoughts?

Sounds like a great idea!
Comment 3 Pedro Amorim 2023-12-18 11:35:49 UTC
Created attachment 159942 [details] [review]
Bug 35570: Put 'FreeForm' backend into core as 'Standard'

FreeForm copied as is from HEAD 369dffb159f1e70162b685b473dcf26c76f7e7e7
At https://github.com/PTFS-Europe/koha-ill-freeform/commits/reorganize_ILL/

Only edits made were 'freeform' -> 'standard' in the markup of the .inc files
and some occurrences of FreeForm in Standard.pm (previous Base.pm) file.
Comment 4 Pedro Amorim 2023-12-18 11:35:52 UTC Comment hidden (obsolete)
Comment 5 Pedro Amorim 2023-12-18 11:35:54 UTC Comment hidden (obsolete)
Comment 6 Pedro Amorim 2023-12-18 11:35:58 UTC Comment hidden (obsolete)
Comment 7 Pedro Amorim 2023-12-18 11:36:02 UTC Comment hidden (obsolete)
Comment 8 Pedro Amorim 2023-12-18 11:36:39 UTC
I have named the new core backend 'Standard' but I don't feel strongly about this, opinions/suggestions welcomed.
Comment 9 David Nind 2024-01-02 21:24:53 UTC Comment hidden (obsolete)
Comment 10 Pedro Amorim 2024-01-03 09:29:20 UTC Comment hidden (obsolete)
Comment 11 Pedro Amorim 2024-01-03 11:19:04 UTC Comment hidden (obsolete)
Comment 12 Pedro Amorim 2024-01-03 12:07:50 UTC Comment hidden (obsolete)
Comment 13 David Nind 2024-01-07 23:30:30 UTC Comment hidden (obsolete)
Comment 14 Pedro Amorim 2024-01-08 09:25:00 UTC Comment hidden (obsolete)
Comment 15 David Nind 2024-01-08 20:46:41 UTC
Created attachment 160654 [details] [review]
Bug 35570: Put 'FreeForm' backend into core as 'Standard'

FreeForm copied as is from HEAD 369dffb159f1e70162b685b473dcf26c76f7e7e7
At https://github.com/PTFS-Europe/koha-ill-freeform/commits/reorganize_ILL/

Only edits made were 'freeform' -> 'standard' in the markup of the .inc files
and some occurrences of FreeForm in Standard.pm (previous Base.pm) file.

Signed-off-by: David Nind <david@davidnind.com>
Comment 16 David Nind 2024-01-08 20:46:44 UTC
Created attachment 160655 [details] [review]
Bug 35570: Consider 'Standard' core backend

Added File::Basename qw( dirname )
Sorted Koha:: dependencies alphabetically
DRYed load_backend a bit and included 'Standard' backend check

Signed-off-by: David Nind <david@davidnind.com>
Comment 17 David Nind 2024-01-08 20:46:47 UTC
Created attachment 160656 [details] [review]
Bug 35570: Atomicupdate

Move stuff out of 'FreeForm' into 'Standard'

This atomicupdate will printout the changes it made, if any.
It will also print out the report IDs of reports that may contain occurrences of 'FreeForm'.
This is to give the sys admin the chance to fix those reports before users.

To test, empty k-t-d:
1) Run updatedatabase, notice nothing happens
2) Install FreeForm, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Create a new 'FreeForm' ILL batch (requires a metadata enrichment plugin like https://github.com/PTFS-Europe/koha-plugin-api-pubmed)
4) Add '123' to the pubmedid list of identifiers and finish creating the batch
5) Upon creating the batch, you will now have 1 request, 1 batch and a few illrequestattributes in the 'FreeForm' backend
6) Run the updatedatabase again, notice the print outs.
7) Create a saved sql report like:
'Select * from illrequests where backend="FreeForm";'
8) Run the updatedatabase again, notice you get a warning for the above report

Signed-off-by: David Nind <david@davidnind.com>
Comment 18 David Nind 2024-01-08 20:46:50 UTC
Created attachment 160657 [details] [review]
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed

Test plan:
1) This patch should not be applied in order to be able to go through the previous patch's test plan
2) Install FreeForm, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Please note that you need to be using FreeForm's reorganize_ILL branch at:
https://github.com/PTFS-Europe/koha-ill-freeform/commits/reorganize_ILL/
4) Visit ILL page:
/cgi-bin/koha/ill/ill-requests.pl
5) Notice there's a configuration error preventing the use of the ILL module.
6) Click the 'about page' link and verify there is a warning about
   FreeForm
7) Remove FreeForm from /kohadevbox/koha/Koha/Illbackends and refresh the page
8) Repeat 4), notice the requests are listed as expected and you can now
   use the ILL module again.

Signed-off-by: David Nind <david@davidnind.com>
Comment 19 David Nind 2024-01-08 20:46:54 UTC
Created attachment 160658 [details] [review]
Bug 35570: (QA follow-up):

Make QA script green, fix:
- Variables declared in condition
- Use of DateTime->now should certainly be replaced with dt_from_string (bug 24840)
- missing_filter
- forbidden pattern: Do not use line breaks inside template tags (bug 18675)
- Attribute type should not be used for script tags (bug 20053)
- File must have the exec flag
- forbidden pattern: trailing space char
- valid_template: /shared-includes/custom_fields.inc: not found

Signed-off-by: David Nind <david@davidnind.com>
Comment 20 David Nind 2024-01-08 20:46:57 UTC
Created attachment 160659 [details] [review]
Bug 35570: QA follow-up:

Update updatedatabase report colors to base on bug 35681

Signed-off-by: David Nind <david@davidnind.com>
Comment 21 David Nind 2024-01-08 20:47:00 UTC
Created attachment 160660 [details] [review]
Bug 35570: (QA follow-up):

Add FreeForm fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/9c9da5ff2815fb6ce0af0181341dea5ce8c3bb2e into this work.
This is to keep this work up to date with latest FreeForm's fixes.
See bug 35685 for context and test plan.

Signed-off-by: David Nind <david@davidnind.com>
Comment 22 David Nind 2024-01-08 20:49:17 UTC
(In reply to Pedro Amorim from comment #14)
...
> 
> I believe the error you're getting is because you may have skipped this step:
> 3) Please note that you need to be using FreeForm's reorganize_ILL branch at:
> https://github.com/PTFS-Europe/koha-ill-freeform/commits/reorganize_ILL/
> 
> After you git checkout reorganize_ILL in FreeForm you may have to koha-plack
> --restart. Would you please try again? Reach out to me on IRC, I'm always
> available. Thanks!

Thanks Pedro. That was the issue!
Comment 23 David Nind 2024-01-08 20:55:18 UTC
Testing notes (using KTD):

1. Apply the first three patches:
   - Bug 35570: Put 'FreeForm' backend into core as 'Standard'
   - Bug 35570: Consider 'Standard' core backend
   - Bug 35570: Atomicupdate
   
   Notes:
   - Apply all the dependent bugs
   - For 35570 (this bug) use i (for interactive) and add a # hash in front of the patches not to apply at this time

2. Run the database update: updatedatabase
   => Output:

Upgrade to 23.12.00.003  [18:41:32]: Bug 35681 - Test DB Rev output
	Something in red is a warning
	Somthing in yellow is a call to action
	Something in blue is for information only
	You could use 'WHITE' too?
	Or leave color off and stick to default
DEV atomic update /kohadevbox/koha/installer/data/mysql/atomicupdate/bug_35570.pl  [18:41:32]: Bug 35570 - Update 'FreeForm' ILL backend to 'Standard'
	Bug 35570: Finished database update.
DEV atomic update /kohadevbox/koha/installer/data/mysql/atomicupdate/bug_35681.pl  [18:41:32]: Bug 35681 - Test Atomic update output
	Something in red is a warning
	Somthing in yellow is a call to action
	Something in blue is for information only
	You could use 'WHITE' too?
	Or leave color off and stick to default

3. Install the FreeForm backend. Run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)

4. Change the FreeForm branch to reorganize_ILL. From within the Koha/Illbackends/FreeForm directory: git checkout reorganize_ILL

5. Run flush_memcached and restart_all (not sure whether these are required here, but I ran them anyway).

6. Install the Pubmed plugin: 
   - Download from https://github.com/PTFS-Europe/koha-plugin-api-pubmed
   - Upload the plugin: Koha administration > Plugins > Manage plugins
   - Run restart_all

7. Create a new 'FreeForm' ILL batch:
   - + New ILL requests batch
   - Select the 'FreeForm' option
   - Batch details:
     . Batch name: BZ35570
     . Card number...: 42 (koha)
     . Library: Centerville
    - Select 'Continue'
    - Add '123' to the PubMed ID list of identifiers
    - Click 'Process identifiers'
    - Once processed, click 'Add items to batch'
    - Click 'Finish and view batch'
    => You now have 1 request, 1 batch and a few ILL request attributes in the 'FreeForm' backend

8. Run updatedatabase again, notice that there are now extra messages from the previous database update - "Updated ILL batches from 'FreeForm' to 'Standard'...":

DEV atomic update /kohadevbox/koha/installer/data/mysql/atomicupdate/bug_35570.pl  [19:26:57]: Bug 35570 - Update 'FreeForm' ILL backend to 'Standard'
	Bug 35570: Updated ILL batches from 'FreeForm' to 'Standard
	Bug 35570: Updated ILL request attributes from 'FreeForm' to 'Standard
	Bug 35570: Updated ILL requests from 'FreeForm' to 'Standard
	Bug 35570: Finished database update.
DEV atomic update /kohadevbox/koha/installer/data/mysql/atomicupdate/bug_35681.pl  [19:26:57]: Bug 35681 - Test Atomic update output
	Something in red is a warning
	Somthing in yellow is a call to action
	Something in blue is for information only
	You could use 'WHITE' too?
	Or leave color off and stick to default

9. Create a saved SQL report with this SQL (note that if you run the report you get no results): Select * from illrequests where backend="FreeForm"

10. Run the updatedatabase again. Note that there is a warning about the report you created "Bug 35570: **ACTION REQUIRED**: Saved SQL reports containing occurrences of 'FreeForm' were found.....":

DEV atomic update /kohadevbox/koha/installer/data/mysql/atomicupdate/bug_35570.pl  [19:30:47]: Bug 35570 - Update 'FreeForm' ILL backend to 'Standard'
	Bug 35570: **ACTION REQUIRED**: Saved SQL reports containing occurrences of 'FreeForm' were found.
	The following reports MUST be updated accordingly ('FreeForm' -> 'Standard'):
		Report ID: 1 | Edit link: http://kohadev-intra.koha-testing:8081/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Edit%20SQL
DEV atomic update /kohadevbox/koha/installer/data/mysql/atomicupdate/bug_35681.pl  [19:30:47]: Bug 35681 - Test Atomic update output
	Something in red is a warning
	Somthing in yellow is a call to action
	Something in blue is for information only
	You could use 'WHITE' too?
	Or leave color off and stick to default

11. Apply the remainder of the patches for this bug:
    - Say no for all the dependencies, as they are already installed
    - For 35570 (this bug) use i (for interactive) and add a # hash in front of the first three patches
    - There is no need to run the databaseupdate again
    - Run flush_memcached and restart_all (not sure if this is required, but is what I normally do after applying a patch)

12. Go to the ILL page: Administration > ILL requests

13. Notice that there is a configuration error preventing the use of the ILL module. The message displayed is "ILL module configuration problem. Take a look at the about page".

14. Click the 'about page' link and verify there is a warning about the FreeForm backend:

     The ILL module is enabled, but the deprecated 'FreeForm' backend is installed.
     'FreeForm' has since become part of core Koha as 'Standard'.
     All 'FreeForm' ILL content should've been migrated to 'Standard' upon upgrading Koha to 24.05.
     To avoid confusion or redundancy, please uninstall the 'FreeForm' backend before using the ILL module.

15. Remove the FreeForm backend from /kohadevbox/koha/Koha/Illbackends (sudo rm -R /kohadevbox/koha/Koha/Illbackends/FreeForm) and refresh the page.

16. Repeat step 12. Note that:
    - The requests are listed as expected, and you can now use the ILL module again.
    - For '+ New ILL requests batch', 'Standard' is now the only option shown.
Comment 24 David Nind 2024-01-08 20:57:59 UTC
Additional testing
==================

I created a new ILL request and tested the various options available on the ILL requests page (this wasn't part of the test plan):

- Confirm request: page not found (404) error when confirming request (URL was /cgi-bin/koha/ill/%2Fcgi-bin%2Fkoha%2Fill%2Fill-requests.pl%3Fmethod%3Dconfirm%26stage%3Dconfirm%26illrequest_id%3D2) - presume something else is required to configure this?

- All the other areas seemed to work as expected:
  . Edit request
  . Place request with partner libraries (add a couple of patrons to the Inter-Library Loan patron category, make sure they have an email address)
  . Delete request
  . Edit item metadata
  . Send notice to patron (I added an email to the patron used to create the request, updated patron message preferences, and added an email address to the various email system preferences)
  . Display supplier metadata (found this confusing - it shows the request metadata, but this is the existing terminology)
  . ILL request log (changes made to the request show after enabling the IllLog system preference)
Comment 25 Pedro Amorim 2024-01-09 09:56:53 UTC
Created attachment 160686 [details] [review]
Bug 35570: (QA follow-up): Fix action button links. Use url filter instead of uri.

Before applying this patch:
1) Click 'Manage Request' for a request, then on the top toolbar click 'Confirm request'.
2) Click the 'Confirm request' button on the bottom of the text. Notice it fails with a 404. Use the browser to go back.
3) Click the 'Cancel' button on the bottom of the text. Notice it fails with a 404. Use the browser to go back.

4) Set all the requests to status to 'REQ' (relevant for next test), ktd kshell, run:
   echo 'update illrequests set status = 'REQ';' | koha-mysql kohadev
5) Click 'Manage Request' for a request, then on the top toolbar click 'Revert request'.
6) Click the 'Revert request' button on the bottom of the text. Notice it fails with a 404. Use the browser to go back.
7) Click the 'Cancel' button on the bottom of the text. Notice it fails with a 404. Use the browser to go back.

8) Apply patch. Repeat test plan. Notice all the action buttons now work.
Comment 26 Pedro Amorim 2024-01-09 09:58:36 UTC
(In reply to David Nind from comment #24)
> Additional testing
> ==================
> 
> I created a new ILL request and tested the various options available on the
> ILL requests page (this wasn't part of the test plan):
> 
> - Confirm request: page not found (404) error when confirming request (URL
> was
> /cgi-bin/koha/ill/%2Fcgi-bin%2Fkoha%2Fill%2Fill-requests.
> pl%3Fmethod%3Dconfirm%26stage%3Dconfirm%26illrequest_id%3D2) - presume
> something else is required to configure this?

Hi David, nice catch. This was an oversight ('uri' instead of 'url') and an actual bug. 
I've submitted a patch. Thank you so much for your extensive testing!
Comment 27 David Nind 2024-01-10 19:24:17 UTC
(In reply to Pedro Amorim from comment #26)
> 
> Hi David, nice catch. This was an oversight ('uri' instead of 'url') and an
> actual bug. 
> I've submitted a patch. Thank you so much for your extensive testing!

Thanks Pedro! Can confirm that this now works as expected.
Comment 28 Marcel de Rooy 2024-01-26 10:20:53 UTC
Could we do a cleanup here first?
Seeing various (QA follow-up) without any further text. Does not look good.
Comment 29 Pedro Amorim 2024-01-26 10:49:00 UTC
(In reply to Marcel de Rooy from comment #28)
> Could we do a cleanup here first?
> Seeing various (QA follow-up) without any further text. Does not look good.

Hi Marcel, thank you. I agree, I'll rewrite the commit messages to have proper titles and resubmit. There's a minor rebase needed as well. Having said that, here's an explanation of the 3 qa follow-up commits without further text on the title:

https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160658&action=diff
First qa follow-up is required because it records all the QA work done on FreeForm after it has become Standard in Koha core.

https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160659&action=diff
Second qa follow-up was an update on the work done in bug 35681 (I need to revisit this patch again)

https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160660&action=diff
Third qa follow-upn was a bugfix submitted to the FreeForm repo, but I'm also adding here to keep both in sync while this is not pushed to core.
Comment 30 Pedro Amorim 2024-01-26 12:56:34 UTC Comment hidden (obsolete)
Comment 31 Pedro Amorim 2024-01-26 12:56:38 UTC Comment hidden (obsolete)
Comment 32 Pedro Amorim 2024-01-26 12:56:41 UTC Comment hidden (obsolete)
Comment 33 Pedro Amorim 2024-01-26 12:56:44 UTC Comment hidden (obsolete)
Comment 34 Pedro Amorim 2024-01-26 12:56:47 UTC Comment hidden (obsolete)
Comment 35 Pedro Amorim 2024-01-26 12:56:51 UTC Comment hidden (obsolete)
Comment 36 Pedro Amorim 2024-01-26 12:58:16 UTC
(In reply to Marcel de Rooy from comment #28)
> Could we do a cleanup here first?
> Seeing various (QA follow-up) without any further text. Does not look good.

Hi Marcel, I've improved the commit messages titles and squashed 2 QA follow-ups to their respective original commits. Kept 2 of the QA follow-up commits as they are important history.
Comment 37 Pedro Amorim 2024-03-07 10:46:55 UTC Comment hidden (obsolete)
Comment 38 Pedro Amorim 2024-03-07 11:20:08 UTC Comment hidden (obsolete)
Comment 39 Pedro Amorim 2024-03-07 11:50:45 UTC Comment hidden (obsolete)
Comment 40 Pedro Amorim 2024-03-07 11:50:49 UTC Comment hidden (obsolete)
Comment 41 Pedro Amorim 2024-03-07 11:50:54 UTC Comment hidden (obsolete)
Comment 42 Pedro Amorim 2024-03-07 11:51:00 UTC Comment hidden (obsolete)
Comment 43 Pedro Amorim 2024-03-07 11:51:04 UTC Comment hidden (obsolete)
Comment 44 Pedro Amorim 2024-03-07 11:51:09 UTC Comment hidden (obsolete)
Comment 45 Pedro Amorim 2024-03-07 11:51:14 UTC Comment hidden (obsolete)
Comment 46 Pedro Amorim 2024-03-07 11:51:19 UTC Comment hidden (obsolete)
Comment 47 Pedro Amorim 2024-04-02 14:18:40 UTC Comment hidden (obsolete)
Comment 48 Pedro Amorim 2024-04-02 14:18:44 UTC Comment hidden (obsolete)
Comment 49 Pedro Amorim 2024-04-02 14:18:47 UTC Comment hidden (obsolete)
Comment 50 Pedro Amorim 2024-04-02 14:18:51 UTC Comment hidden (obsolete)
Comment 51 Pedro Amorim 2024-04-02 14:18:54 UTC Comment hidden (obsolete)
Comment 52 Pedro Amorim 2024-04-02 14:18:58 UTC Comment hidden (obsolete)
Comment 53 Pedro Amorim 2024-04-02 14:19:01 UTC Comment hidden (obsolete)
Comment 54 Pedro Amorim 2024-04-02 14:19:05 UTC Comment hidden (obsolete)
Comment 55 Pedro Amorim 2024-04-02 14:20:19 UTC
Rebased after recent changes to bug 19605
Comment 56 Pedro Amorim 2024-04-19 13:53:49 UTC Comment hidden (obsolete)
Comment 57 Pedro Amorim 2024-04-19 13:53:54 UTC Comment hidden (obsolete)
Comment 58 Pedro Amorim 2024-04-19 13:53:57 UTC Comment hidden (obsolete)
Comment 59 Pedro Amorim 2024-04-19 13:54:01 UTC Comment hidden (obsolete)
Comment 60 Pedro Amorim 2024-04-19 13:54:06 UTC Comment hidden (obsolete)
Comment 61 Pedro Amorim 2024-04-19 13:54:12 UTC Comment hidden (obsolete)
Comment 62 Pedro Amorim 2024-04-19 13:54:15 UTC Comment hidden (obsolete)
Comment 63 Pedro Amorim 2024-04-19 13:54:20 UTC Comment hidden (obsolete)
Comment 64 Pedro Amorim 2024-04-19 13:54:45 UTC
Rebase after a follow-up submitted to bug 19605 was required.
Comment 65 Pedro Amorim 2024-04-22 13:52:07 UTC
Created attachment 165286 [details] [review]
Bug 35570: Put 'FreeForm' backend into core as 'Standard'

FreeForm copied as is from HEAD 369dffb159f1e70162b685b473dcf26c76f7e7e7
At https://github.com/PTFS-Europe/koha-ill-freeform/commits/reorganize_ILL/

Only edits made were 'freeform' -> 'standard' in the markup of the .inc files
and some occurrences of FreeForm in Standard.pm (previous Base.pm) file.

Signed-off-by: David Nind <david@davidnind.com>
Comment 66 Pedro Amorim 2024-04-22 13:52:11 UTC
Created attachment 165287 [details] [review]
Bug 35570: Consider 'Standard' core backend

Added File::Basename qw( dirname )
Sorted Koha:: dependencies alphabetically
DRYed load_backend a bit and included 'Standard' backend check

Signed-off-by: David Nind <david@davidnind.com>
Comment 67 Pedro Amorim 2024-04-22 13:52:14 UTC
Created attachment 165288 [details] [review]
Bug 35570: Atomicupdate

Move stuff out of 'FreeForm' into 'Standard'

This atomicupdate will printout the changes it made, if any.
It will also print out the report IDs of reports that may contain occurrences of 'FreeForm'.
This is to give the sys admin the chance to fix those reports before users.

To test, empty k-t-d:
1) Run updatedatabase, notice nothing happens
2) Install FreeForm, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Create a new 'FreeForm' ILL batch (requires a metadata enrichment plugin like https://github.com/PTFS-Europe/koha-plugin-api-pubmed)
4) Add '123' to the pubmedid list of identifiers and finish creating the batch
5) Upon creating the batch, you will now have 1 request, 1 batch and a few illrequestattributes in the 'FreeForm' backend
6) Run the updatedatabase again, notice the print outs.
7) Create a saved sql report like:
'Select * from illrequests where backend="FreeForm";'
8) Run the updatedatabase again, notice you get a warning for the above report

Signed-off-by: David Nind <david@davidnind.com>
Comment 68 Pedro Amorim 2024-04-22 13:52:17 UTC
Created attachment 165289 [details] [review]
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed

Test plan:
1) This patch should not be applied in order to be able to go through the previous patch's test plan
2) Install FreeForm, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Please note that you need to be using FreeForm's reorganize_ILL branch at:
https://github.com/PTFS-Europe/koha-ill-freeform/commits/reorganize_ILL/
4) Visit ILL page:
/cgi-bin/koha/ill/ill-requests.pl
5) Notice there's a configuration error preventing the use of the ILL module.
6) Click the 'about page' link and verify there is a warning about
   FreeForm
7) Remove FreeForm from /kohadevbox/koha/Koha/Illbackends and refresh the page
8) Repeat 4), notice the requests are listed as expected and you can now
   use the ILL module again.

Signed-off-by: David Nind <david@davidnind.com>
Comment 69 Pedro Amorim 2024-04-22 13:52:21 UTC
Created attachment 165290 [details] [review]
Bug 35570: (QA follow-up): Follow QA script on Standard backend

Make QA script green, fix:
- Variables declared in condition
- Use of DateTime->now should certainly be replaced with dt_from_string (bug 24840)
- missing_filter
- forbidden pattern: Do not use line breaks inside template tags (bug 18675)
- Attribute type should not be used for script tags (bug 20053)
- File must have the exec flag
- forbidden pattern: trailing space char
- valid_template: /shared-includes/custom_fields.inc: not found

Signed-off-by: David Nind <david@davidnind.com>
Comment 70 Pedro Amorim 2024-04-22 13:52:25 UTC
Created attachment 165291 [details] [review]
Bug 35570: (QA follow-up): Standard backend: Show appropriate error message when type is missing

Add FreeForm fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/9c9da5ff2815fb6ce0af0181341dea5ce8c3bb2e into this work.
This is to keep this work up to date with latest FreeForm's fixes.
See bug 35685 for context and test plan.

Signed-off-by: David Nind <david@davidnind.com>
Comment 71 Pedro Amorim 2024-04-22 13:52:30 UTC
Created attachment 165292 [details] [review]
Bug 35570: (QA follow-up): Standard backend: Bug 36243 compatibility

Add FreeForm CSRF fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/c34be16ba34c840193ed5e043e6736fa0b1cb646 into this work.
This is to keep this work up to date with latest FreeForm's fixes.
Comment 72 Pedro Amorim 2024-04-22 13:52:37 UTC
Created attachment 165293 [details] [review]
Bug 35570: (QA follow-up): Standard backend: Fix OPAC CSRF

Add FreeForm CSRF fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/6a37ce0daba8aab13130dacd055c9ca5876b7df4 into this work.
This is to keep this work up to date with latest FreeForm's fixes.

The test plan to demonstrate the issue this patch fixes:
Test plan, k-t-d:

1) Install FreeForm, enable ILL module, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
2) You'll have to switch the FreeForm branch to the one compatible with this work, i.e.:
cd /kohadevbox/koha/Koha/Illbackends/FreeForm
git checkout b_36243
3) Restart plack:
koha-plack --restart kohadev
4) Go to OPAC ILL requests, login and visit:
<opac_url>/cgi-bin/koha/opac-illrequests.pl
5) Click "Create new request"
6) Change the 'type'. Notice you get a 403 error. Logs say:
Programming error - op 'add_form' must start with 'cud-' for POST
7) Apply patch. Restart plack. Repeat 6)
8) Notice the change type works as expected. Click "Create".
9) Notice the request is created as expected.
Comment 73 Pedro Amorim 2024-04-22 13:54:10 UTC
Rebased required after bug 35151 and bug 32693pushed to main.
Comment 74 Pedro Amorim 2024-04-22 13:54:39 UTC
The patchset includes the following string:

All 'FreeForm' ILL content should've been migrated to 'Standard' upon upgrading Koha to 24.05.

This needs to be revisited/update if not pushed in time for 24.05.
Comment 75 Pedro Amorim 2024-05-22 15:57:45 UTC Comment hidden (obsolete)
Comment 76 Pedro Amorim 2024-05-22 15:59:30 UTC
Created attachment 167051 [details] [review]
Bug 35570: (QA follow-up): Rebase on final state of bug 35681
Comment 77 Paul Derscheid 2024-09-10 16:25:04 UTC
Hi Pedro, just wanted to QA Bug 35725 but this one doesn't apply anymore unfortunately.
Comment 78 Paul Derscheid 2024-09-10 16:26:39 UTC
Huh, this one was already pushed to main? Sorry for the noise then.
Comment 79 Pedro Amorim 2024-09-10 17:57:24 UTC
(In reply to Paul Derscheid from comment #78)
> Huh, this one was already pushed to main? Sorry for the noise then.

No, this has not yet been pushed to main. I'm putting this back to 'Patch doesn't apply' to look back at tomorrow. Thanks.
Comment 80 Pedro Amorim 2024-09-11 13:20:27 UTC
Created attachment 171312 [details] [review]
Bug 35570: Put 'FreeForm' backend into core as 'Standard'

FreeForm copied as is from HEAD 369dffb159f1e70162b685b473dcf26c76f7e7e7
At https://github.com/PTFS-Europe/koha-ill-freeform/commits/reorganize_ILL/

Only edits made were 'freeform' -> 'standard' in the markup of the .inc files
and some occurrences of FreeForm in Standard.pm (previous Base.pm) file.

Signed-off-by: David Nind <david@davidnind.com>
Comment 81 Pedro Amorim 2024-09-11 13:21:00 UTC
Created attachment 171313 [details] [review]
Bug 35570: Consider 'Standard' core backend

Added File::Basename qw( dirname )
Sorted Koha:: dependencies alphabetically
DRYed load_backend a bit and included 'Standard' backend check

Signed-off-by: David Nind <david@davidnind.com>
Comment 82 Pedro Amorim 2024-09-11 13:22:42 UTC
Created attachment 171314 [details] [review]
Bug 35570: Atomicupdate

Move stuff out of 'FreeForm' into 'Standard'

This atomicupdate will printout the changes it made, if any.
It will also print out the report IDs of reports that may contain occurrences of 'FreeForm'.
This is to give the sys admin the chance to fix those reports before users.

To test, empty k-t-d:
1) Run updatedatabase, notice nothing happens
2) Install FreeForm, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Create a new 'FreeForm' ILL batch (requires a metadata enrichment plugin like https://github.com/PTFS-Europe/koha-plugin-api-pubmed)
4) Add '123' to the pubmedid list of identifiers and finish creating the batch
5) Upon creating the batch, you will now have 1 request, 1 batch and a few illrequestattributes in the 'FreeForm' backend
6) Run the updatedatabase again, notice the print outs.
7) Create a saved sql report like:
'Select * from illrequests where backend="FreeForm";'
8) Run the updatedatabase again, notice you get a warning for the above report

Signed-off-by: David Nind <david@davidnind.com>
Comment 83 Pedro Amorim 2024-09-11 13:44:24 UTC
Created attachment 171315 [details] [review]
Bug 35570: Put 'FreeForm' backend into core as 'Standard'

FreeForm copied as is from HEAD 369dffb159f1e70162b685b473dcf26c76f7e7e7
At https://github.com/PTFS-Europe/koha-ill-freeform/commits/reorganize_ILL/

Only edits made were 'freeform' -> 'standard' in the markup of the .inc files
and some occurrences of FreeForm in Standard.pm (previous Base.pm) file.

Signed-off-by: David Nind <david@davidnind.com>
Comment 84 Pedro Amorim 2024-09-11 13:44:28 UTC
Created attachment 171316 [details] [review]
Bug 35570: Consider 'Standard' core backend

Added File::Basename qw( dirname )
Sorted Koha:: dependencies alphabetically
DRYed load_backend a bit and included 'Standard' backend check

Signed-off-by: David Nind <david@davidnind.com>
Comment 85 Pedro Amorim 2024-09-11 13:44:31 UTC
Created attachment 171317 [details] [review]
Bug 35570: Atomicupdate

Move stuff out of 'FreeForm' into 'Standard'

This atomicupdate will printout the changes it made, if any.
It will also print out the report IDs of reports that may contain occurrences of 'FreeForm'.
This is to give the sys admin the chance to fix those reports before users.

To test, empty k-t-d:
1) Run updatedatabase, notice nothing happens
2) Install FreeForm, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Create a new 'FreeForm' ILL batch (requires a metadata enrichment plugin like https://github.com/PTFS-Europe/koha-plugin-api-pubmed)
4) Add '123' to the pubmedid list of identifiers and finish creating the batch
5) Upon creating the batch, you will now have 1 request, 1 batch and a few illrequestattributes in the 'FreeForm' backend
6) Run the updatedatabase again, notice the print outs.
7) Create a saved sql report like:
'Select * from illrequests where backend="FreeForm";'
8) Run the updatedatabase again, notice you get a warning for the above report

Signed-off-by: David Nind <david@davidnind.com>
Comment 86 Pedro Amorim 2024-09-11 13:44:35 UTC
Created attachment 171318 [details] [review]
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed

Test plan:
1) This patch should not be applied in order to be able to go through the previous patch's test plan
2) Install FreeForm, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Please note that you need to be using FreeForm's reorganize_ILL branch at:
https://github.com/PTFS-Europe/koha-ill-freeform/commits/reorganize_ILL/
4) Visit ILL page:
/cgi-bin/koha/ill/ill-requests.pl
5) Notice there's a configuration error preventing the use of the ILL module.
6) Click the 'about page' link and verify there is a warning about
   FreeForm
7) Remove FreeForm from /kohadevbox/koha/Koha/Illbackends and refresh the page
8) Repeat 4), notice the requests are listed as expected and you can now
   use the ILL module again.

Signed-off-by: David Nind <david@davidnind.com>
Comment 87 Pedro Amorim 2024-09-11 13:44:39 UTC
Created attachment 171319 [details] [review]
Bug 35570: (QA follow-up): Follow QA script on Standard backend

Make QA script green, fix:
- Variables declared in condition
- Use of DateTime->now should certainly be replaced with dt_from_string (bug 24840)
- missing_filter
- forbidden pattern: Do not use line breaks inside template tags (bug 18675)
- Attribute type should not be used for script tags (bug 20053)
- File must have the exec flag
- forbidden pattern: trailing space char
- valid_template: /shared-includes/custom_fields.inc: not found

Signed-off-by: David Nind <david@davidnind.com>
Comment 88 Pedro Amorim 2024-09-11 13:44:43 UTC
Created attachment 171320 [details] [review]
Bug 35570: (QA follow-up): Standard backend: Show appropriate error message when type is missing

Add FreeForm fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/9c9da5ff2815fb6ce0af0181341dea5ce8c3bb2e into this work.
This is to keep this work up to date with latest FreeForm's fixes.
See bug 35685 for context and test plan.

Signed-off-by: David Nind <david@davidnind.com>
Comment 89 Pedro Amorim 2024-09-11 13:44:46 UTC
Created attachment 171321 [details] [review]
Bug 35570: (QA follow-up): Standard backend: Bug 36243 compatibility

Add FreeForm CSRF fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/c34be16ba34c840193ed5e043e6736fa0b1cb646 into this work.
This is to keep this work up to date with latest FreeForm's fixes.
Comment 90 Pedro Amorim 2024-09-11 13:44:50 UTC
Created attachment 171322 [details] [review]
Bug 35570: (QA follow-up): Standard backend: Fix OPAC CSRF

Add FreeForm CSRF fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/6a37ce0daba8aab13130dacd055c9ca5876b7df4 into this work.
This is to keep this work up to date with latest FreeForm's fixes.

The test plan to demonstrate the issue this patch fixes:
Test plan, k-t-d:

1) Install FreeForm, enable ILL module, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
2) You'll have to switch the FreeForm branch to the one compatible with this work, i.e.:
cd /kohadevbox/koha/Koha/Illbackends/FreeForm
git checkout b_36243
3) Restart plack:
koha-plack --restart kohadev
4) Go to OPAC ILL requests, login and visit:
<opac_url>/cgi-bin/koha/opac-illrequests.pl
5) Click "Create new request"
6) Change the 'type'. Notice you get a 403 error. Logs say:
Programming error - op 'add_form' must start with 'cud-' for POST
7) Apply patch. Restart plack. Repeat 6)
8) Notice the change type works as expected. Click "Create".
9) Notice the request is created as expected.
Comment 91 Pedro Amorim 2024-09-11 13:44:54 UTC
Created attachment 171323 [details] [review]
Bug 35570: (QA follow-up): Rebase on final state of bug 35681
Comment 92 Pedro Amorim 2024-09-30 10:13:36 UTC
Created attachment 172218 [details] [review]
Bug 35570: (QA Follow-up: Standard backend: Biblio creation: Add UNIMARC support

Add FreeForm UNIMARC enhancement from https://github.com/PTFS-Europe/koha-ill-freeform/commit/5d07c68f8058a9a1f35e3193699605240741ff0c into this work.
This is to keep this work up to date with latest FreeForm's work.

To test, k-t-d:
1) (Skip if using sandboxes) Start off by ensuring this is a UNIMARC installation, run:
$ reset_all_unimarc
2) (Skip if using sandboxes) Apply this bug 35570
3) Create a new Standard ILL request:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm
4) Select type: book, input different values for title+author+isbn (the remaining fields are optional
   for this test)
5) Put in a cardnumber ('42' is kohaadmin if k-t-d/sandboxes). Select any library.
   Click 'Create'.
6) You should now see the ILL request details page. Click on the
   'Bibliographic record ID' link.
7) Ensure the newly created biblio record has the title+author+isbn from
   the metadata originally submitted.

Raised by Sonia Bouis at KohaCon's 2024 ILL workshop
Comment 93 Pedro Amorim 2024-09-30 10:14:34 UTC
Created attachment 172219 [details] [review]
Bug 35570: (QA follow-up): Standard backend: Biblio creation: Add UNIMARC support

Add FreeForm UNIMARC enhancement from https://github.com/PTFS-Europe/koha-ill-freeform/commit/5d07c68f8058a9a1f35e3193699605240741ff0c into this work.
This is to keep this work up to date with latest FreeForm's work.

To test, k-t-d:
1) (Skip if using sandboxes) Start off by ensuring this is a UNIMARC installation, run:
$ reset_all_unimarc
2) (Skip if using sandboxes) Apply this bug 35570
3) Create a new Standard ILL request:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm
4) Select type: book, input different values for title+author+isbn (the remaining fields are optional
   for this test)
5) Put in a cardnumber ('42' is kohaadmin if k-t-d/sandboxes). Select any library.
   Click 'Create'.
6) You should now see the ILL request details page. Click on the
   'Bibliographic record ID' link.
7) Ensure the newly created biblio record has the title+author+isbn from
   the metadata originally submitted.

Raised by Sonia Bouis at KohaCon's 2024 ILL workshop
Comment 94 Tomás Cohen Arazi (tcohen) 2024-10-14 14:37:51 UTC
Created attachment 172722 [details] [review]
Bug 35570: Put 'FreeForm' backend into core as 'Standard'

FreeForm copied as is from HEAD 369dffb159f1e70162b685b473dcf26c76f7e7e7
At https://github.com/PTFS-Europe/koha-ill-freeform/commits/reorganize_ILL/

Only edits made were 'freeform' -> 'standard' in the markup of the .inc files
and some occurrences of FreeForm in Standard.pm (previous Base.pm) file.

Signed-off-by: David Nind <david@davidnind.com>
Comment 95 Tomás Cohen Arazi (tcohen) 2024-10-14 14:37:56 UTC
Created attachment 172723 [details] [review]
Bug 35570: Consider 'Standard' core backend

Added File::Basename qw( dirname )
Sorted Koha:: dependencies alphabetically
DRYed load_backend a bit and included 'Standard' backend check

Signed-off-by: David Nind <david@davidnind.com>
Comment 96 Tomás Cohen Arazi (tcohen) 2024-10-14 14:37:59 UTC
Created attachment 172724 [details] [review]
Bug 35570: Atomicupdate

Move stuff out of 'FreeForm' into 'Standard'

This atomicupdate will printout the changes it made, if any.
It will also print out the report IDs of reports that may contain occurrences of 'FreeForm'.
This is to give the sys admin the chance to fix those reports before users.

To test, empty k-t-d:
1) Run updatedatabase, notice nothing happens
2) Install FreeForm, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Create a new 'FreeForm' ILL batch (requires a metadata enrichment plugin like https://github.com/PTFS-Europe/koha-plugin-api-pubmed)
4) Add '123' to the pubmedid list of identifiers and finish creating the batch
5) Upon creating the batch, you will now have 1 request, 1 batch and a few illrequestattributes in the 'FreeForm' backend
6) Run the updatedatabase again, notice the print outs.
7) Create a saved sql report like:
'Select * from illrequests where backend="FreeForm";'
8) Run the updatedatabase again, notice you get a warning for the above report

Signed-off-by: David Nind <david@davidnind.com>
Comment 97 Tomás Cohen Arazi (tcohen) 2024-10-14 14:38:03 UTC
Created attachment 172725 [details] [review]
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed

Test plan:
1) This patch should not be applied in order to be able to go through the previous patch's test plan
2) Install FreeForm, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Please note that you need to be using FreeForm's reorganize_ILL branch at:
https://github.com/PTFS-Europe/koha-ill-freeform/commits/reorganize_ILL/
4) Visit ILL page:
/cgi-bin/koha/ill/ill-requests.pl
5) Notice there's a configuration error preventing the use of the ILL module.
6) Click the 'about page' link and verify there is a warning about
   FreeForm
7) Remove FreeForm from /kohadevbox/koha/Koha/Illbackends and refresh the page
8) Repeat 4), notice the requests are listed as expected and you can now
   use the ILL module again.

Signed-off-by: David Nind <david@davidnind.com>
Comment 98 Tomás Cohen Arazi (tcohen) 2024-10-14 14:38:07 UTC
Created attachment 172726 [details] [review]
Bug 35570: (QA follow-up): Follow QA script on Standard backend

Make QA script green, fix:
- Variables declared in condition
- Use of DateTime->now should certainly be replaced with dt_from_string (bug 24840)
- missing_filter
- forbidden pattern: Do not use line breaks inside template tags (bug 18675)
- Attribute type should not be used for script tags (bug 20053)
- File must have the exec flag
- forbidden pattern: trailing space char
- valid_template: /shared-includes/custom_fields.inc: not found

Signed-off-by: David Nind <david@davidnind.com>
Comment 99 Tomás Cohen Arazi (tcohen) 2024-10-14 14:38:11 UTC
Created attachment 172727 [details] [review]
Bug 35570: (QA follow-up): Standard backend: Show appropriate error message when type is missing

Add FreeForm fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/9c9da5ff2815fb6ce0af0181341dea5ce8c3bb2e into this work.
This is to keep this work up to date with latest FreeForm's fixes.
See bug 35685 for context and test plan.

Signed-off-by: David Nind <david@davidnind.com>
Comment 100 Tomás Cohen Arazi (tcohen) 2024-10-14 14:38:14 UTC
Created attachment 172728 [details] [review]
Bug 35570: (QA follow-up): Standard backend: Bug 36243 compatibility

Add FreeForm CSRF fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/c34be16ba34c840193ed5e043e6736fa0b1cb646 into this work.
This is to keep this work up to date with latest FreeForm's fixes.
Comment 101 Tomás Cohen Arazi (tcohen) 2024-10-14 14:38:18 UTC
Created attachment 172729 [details] [review]
Bug 35570: (QA follow-up): Standard backend: Fix OPAC CSRF

Add FreeForm CSRF fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/6a37ce0daba8aab13130dacd055c9ca5876b7df4 into this work.
This is to keep this work up to date with latest FreeForm's fixes.

The test plan to demonstrate the issue this patch fixes:
Test plan, k-t-d:

1) Install FreeForm, enable ILL module, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
2) You'll have to switch the FreeForm branch to the one compatible with this work, i.e.:
cd /kohadevbox/koha/Koha/Illbackends/FreeForm
git checkout b_36243
3) Restart plack:
koha-plack --restart kohadev
4) Go to OPAC ILL requests, login and visit:
<opac_url>/cgi-bin/koha/opac-illrequests.pl
5) Click "Create new request"
6) Change the 'type'. Notice you get a 403 error. Logs say:
Programming error - op 'add_form' must start with 'cud-' for POST
7) Apply patch. Restart plack. Repeat 6)
8) Notice the change type works as expected. Click "Create".
9) Notice the request is created as expected.
Comment 102 Tomás Cohen Arazi (tcohen) 2024-10-14 14:38:22 UTC
Created attachment 172730 [details] [review]
Bug 35570: (QA follow-up): Rebase on final state of bug 35681
Comment 103 Tomás Cohen Arazi (tcohen) 2024-10-14 14:38:25 UTC
Created attachment 172731 [details] [review]
Bug 35570: (QA follow-up): Standard backend: Biblio creation: Add UNIMARC support

Add FreeForm UNIMARC enhancement from https://github.com/PTFS-Europe/koha-ill-freeform/commit/5d07c68f8058a9a1f35e3193699605240741ff0c into this work.
This is to keep this work up to date with latest FreeForm's work.

To test, k-t-d:
1) (Skip if using sandboxes) Start off by ensuring this is a UNIMARC installation, run:
$ reset_all_unimarc
2) (Skip if using sandboxes) Apply this bug 35570
3) Create a new Standard ILL request:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm
4) Select type: book, input different values for title+author+isbn (the remaining fields are optional
   for this test)
5) Put in a cardnumber ('42' is kohaadmin if k-t-d/sandboxes). Select any library.
   Click 'Create'.
6) You should now see the ILL request details page. Click on the
   'Bibliographic record ID' link.
7) Ensure the newly created biblio record has the title+author+isbn from
   the metadata originally submitted.

Raised by Sonia Bouis at KohaCon's 2024 ILL workshop
Comment 104 Tomás Cohen Arazi (tcohen) 2024-10-14 14:38:29 UTC
Created attachment 172732 [details] [review]
Bug 35570: (QA follow-up) Tidy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 105 Tomás Cohen Arazi (tcohen) 2024-10-14 14:38:33 UTC
Created attachment 172733 [details] [review]
Bug 35570: Make strings in Standard.pm translatable

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 106 Tomás Cohen Arazi (tcohen) 2024-10-14 14:38:36 UTC
Created attachment 172734 [details] [review]
Bug 35570: Use ->extended_attributes()

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 107 Tomás Cohen Arazi (tcohen) 2024-10-14 14:38:40 UTC
Created attachment 172735 [details] [review]
Bug 35570: Do not unbless iterator

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 108 Tomás Cohen Arazi (tcohen) 2024-10-14 14:43:41 UTC
Hi, nice job :-D

The only 'failure' I found is that choosing DVD when using the form makes it blow. I couldn't find the `dvd.inc` file in the original backend repo so I leave it to you.

Some remarks:

* Some of the code might fit somewhere else. For example the code for creating the record, that has those mappings for ISBNs, etc. BUT that's for another day and another project.
* I'm not sure how we're gonna make those templates translatable. For the backends I worked with, this was the backend's implementation business, but being core we need to find a solution.

Please provide the dvd.inc and mark as PQA
Comment 109 Tomás Cohen Arazi (tcohen) 2024-10-14 14:53:54 UTC
It also feels a bit out of place to see the 'New request' and 'List requests' buttons when editing the request. But might be out of the scope of this bug.
Comment 110 Pedro Amorim 2024-10-14 14:55:14 UTC
(In reply to Tomás Cohen Arazi (tcohen) from comment #108)
> Please provide the dvd.inc and mark as PQA

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36197#c4

I'll provide the fix asap.
Comment 111 Tomás Cohen Arazi (tcohen) 2024-10-14 18:01:10 UTC
Created attachment 172740 [details] [review]
Bug 35570: Put 'FreeForm' backend into core as 'Standard'

FreeForm copied as is from HEAD 369dffb159f1e70162b685b473dcf26c76f7e7e7
At https://github.com/PTFS-Europe/koha-ill-freeform/commits/reorganize_ILL/

Only edits made were 'freeform' -> 'standard' in the markup of the .inc files
and some occurrences of FreeForm in Standard.pm (previous Base.pm) file.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 112 Tomás Cohen Arazi (tcohen) 2024-10-14 18:01:14 UTC
Created attachment 172741 [details] [review]
Bug 35570: Consider 'Standard' core backend

Added File::Basename qw( dirname )
Sorted Koha:: dependencies alphabetically
DRYed load_backend a bit and included 'Standard' backend check

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 113 Tomás Cohen Arazi (tcohen) 2024-10-14 18:01:18 UTC
Created attachment 172742 [details] [review]
Bug 35570: Atomicupdate

Move stuff out of 'FreeForm' into 'Standard'

This atomicupdate will printout the changes it made, if any.
It will also print out the report IDs of reports that may contain occurrences of 'FreeForm'.
This is to give the sys admin the chance to fix those reports before users.

To test, empty k-t-d:
1) Run updatedatabase, notice nothing happens
2) Install FreeForm, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Create a new 'FreeForm' ILL batch (requires a metadata enrichment plugin like https://github.com/PTFS-Europe/koha-plugin-api-pubmed)
4) Add '123' to the pubmedid list of identifiers and finish creating the batch
5) Upon creating the batch, you will now have 1 request, 1 batch and a few illrequestattributes in the 'FreeForm' backend
6) Run the updatedatabase again, notice the print outs.
7) Create a saved sql report like:
'Select * from illrequests where backend="FreeForm";'
8) Run the updatedatabase again, notice you get a warning for the above report

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 114 Tomás Cohen Arazi (tcohen) 2024-10-14 18:01:22 UTC
Created attachment 172743 [details] [review]
Bug 35570: Prevent use of ILL module if deprecated FreeForm backend is installed

Test plan:
1) This patch should not be applied in order to be able to go through the previous patch's test plan
2) Install FreeForm, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Please note that you need to be using FreeForm's reorganize_ILL branch at:
https://github.com/PTFS-Europe/koha-ill-freeform/commits/reorganize_ILL/
4) Visit ILL page:
/cgi-bin/koha/ill/ill-requests.pl
5) Notice there's a configuration error preventing the use of the ILL module.
6) Click the 'about page' link and verify there is a warning about
   FreeForm
7) Remove FreeForm from /kohadevbox/koha/Koha/Illbackends and refresh the page
8) Repeat 4), notice the requests are listed as expected and you can now
   use the ILL module again.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 115 Tomás Cohen Arazi (tcohen) 2024-10-14 18:01:26 UTC
Created attachment 172744 [details] [review]
Bug 35570: (QA follow-up): Follow QA script on Standard backend

Make QA script green, fix:
- Variables declared in condition
- Use of DateTime->now should certainly be replaced with dt_from_string (bug 24840)
- missing_filter
- forbidden pattern: Do not use line breaks inside template tags (bug 18675)
- Attribute type should not be used for script tags (bug 20053)
- File must have the exec flag
- forbidden pattern: trailing space char
- valid_template: /shared-includes/custom_fields.inc: not found

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 116 Tomás Cohen Arazi (tcohen) 2024-10-14 18:01:30 UTC
Created attachment 172745 [details] [review]
Bug 35570: (QA follow-up): Standard backend: Show appropriate error message when type is missing

Add FreeForm fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/9c9da5ff2815fb6ce0af0181341dea5ce8c3bb2e into this work.
This is to keep this work up to date with latest FreeForm's fixes.
See bug 35685 for context and test plan.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 117 Tomás Cohen Arazi (tcohen) 2024-10-14 18:01:34 UTC
Created attachment 172746 [details] [review]
Bug 35570: (QA follow-up): Standard backend: Bug 36243 compatibility

Add FreeForm CSRF fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/c34be16ba34c840193ed5e043e6736fa0b1cb646 into this work.
This is to keep this work up to date with latest FreeForm's fixes.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 118 Tomás Cohen Arazi (tcohen) 2024-10-14 18:01:38 UTC
Created attachment 172747 [details] [review]
Bug 35570: (QA follow-up): Standard backend: Fix OPAC CSRF

Add FreeForm CSRF fix from https://github.com/PTFS-Europe/koha-ill-freeform/commit/6a37ce0daba8aab13130dacd055c9ca5876b7df4 into this work.
This is to keep this work up to date with latest FreeForm's fixes.

The test plan to demonstrate the issue this patch fixes:
Test plan, k-t-d:

1) Install FreeForm, enable ILL module, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
2) You'll have to switch the FreeForm branch to the one compatible with this work, i.e.:
cd /kohadevbox/koha/Koha/Illbackends/FreeForm
git checkout b_36243
3) Restart plack:
koha-plack --restart kohadev
4) Go to OPAC ILL requests, login and visit:
<opac_url>/cgi-bin/koha/opac-illrequests.pl
5) Click "Create new request"
6) Change the 'type'. Notice you get a 403 error. Logs say:
Programming error - op 'add_form' must start with 'cud-' for POST
7) Apply patch. Restart plack. Repeat 6)
8) Notice the change type works as expected. Click "Create".
9) Notice the request is created as expected.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 119 Tomás Cohen Arazi (tcohen) 2024-10-14 18:01:42 UTC
Created attachment 172748 [details] [review]
Bug 35570: (QA follow-up): Rebase on final state of bug 35681

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 120 Tomás Cohen Arazi (tcohen) 2024-10-14 18:01:46 UTC
Created attachment 172749 [details] [review]
Bug 35570: (QA follow-up): Standard backend: Biblio creation: Add UNIMARC support

Add FreeForm UNIMARC enhancement from https://github.com/PTFS-Europe/koha-ill-freeform/commit/5d07c68f8058a9a1f35e3193699605240741ff0c into this work.
This is to keep this work up to date with latest FreeForm's work.

To test, k-t-d:
1) (Skip if using sandboxes) Start off by ensuring this is a UNIMARC installation, run:
$ reset_all_unimarc
2) (Skip if using sandboxes) Apply this bug 35570
3) Create a new Standard ILL request:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm
4) Select type: book, input different values for title+author+isbn (the remaining fields are optional
   for this test)
5) Put in a cardnumber ('42' is kohaadmin if k-t-d/sandboxes). Select any library.
   Click 'Create'.
6) You should now see the ILL request details page. Click on the
   'Bibliographic record ID' link.
7) Ensure the newly created biblio record has the title+author+isbn from
   the metadata originally submitted.

Raised by Sonia Bouis at KohaCon's 2024 ILL workshop

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 121 Tomás Cohen Arazi (tcohen) 2024-10-14 18:01:49 UTC
Created attachment 172750 [details] [review]
Bug 35570: (QA follow-up) Tidy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 122 Tomás Cohen Arazi (tcohen) 2024-10-14 18:01:53 UTC
Created attachment 172751 [details] [review]
Bug 35570: Make strings in Standard.pm translatable

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 123 Tomás Cohen Arazi (tcohen) 2024-10-14 18:01:57 UTC
Created attachment 172752 [details] [review]
Bug 35570: Use ->extended_attributes()

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 124 Tomás Cohen Arazi (tcohen) 2024-10-14 18:02:01 UTC
Created attachment 172753 [details] [review]
Bug 35570: Do not unbless iterator

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 125 Sonia Bouis 2024-10-15 13:45:06 UTC
(In reply to Pedro Amorim from comment #92)
> Created attachment 172218 [details] [review] [review]
> Bug 35570: (QA Follow-up: Standard backend: Biblio creation: Add UNIMARC
> support

Hi,
Thanks Pedro for this addition! I've just tested this part.
The actions from the test plan are OK but, I wonder if we should not put the author in the field 200$f instead of 700$a because 700$a is only for the surname, while you can put different elements of the name in 200$f.

I have also tried to create a book ILL request from the OPAC and then, only the title was added in the biblio record (no author nor isbn).

Strange thing, the request id from the one created from the OPAC had an prefix ILL- and not the one created from the staff. 

Last thought, in addition of book, the request for DVD or Thesis should also create biblio records as it's often physical documents. 

Sonia
Comment 126 Tomás Cohen Arazi (tcohen) 2024-10-15 14:39:24 UTC
Created attachment 172780 [details] [review]
Bug 35570: Revert some strings translatability

This patch reverts making core field descriptions translatable. It was
an obvious move and a needed one. But it turns out our core templates
are using those keys ('Author' and 'Title' in particular) and as such
translating them would break display (at least in the OPAC). Without
this patch, the ILL requests table in the OPAC doesn't display the title
and author columns values (i.e. displays 'N/A' instead)

Added a FIXME in the code, and will file a bug soo we fix this properly.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 127 Pedro Amorim 2024-10-16 09:43:23 UTC
Thank you Sonia for your testing, please read my replies below:

(In reply to Sonia Bouis from comment #125)
> The actions from the test plan are OK but, I wonder if we should not put the
> author in the field 200$f instead of 700$a because 700$a is only for the
> surname, while you can put different elements of the name in 200$f.

Fair point, I'll provide a follow-up correcting this. Thank you.

(In reply to Sonia Bouis from comment #125)
> I have also tried to create a book ILL request from the OPAC and then, only
> the title was added in the biblio record (no author nor isbn).

Not able to reproduce this. Running on an UNIMARC database:
1) Create a new OPAC ILL request:
<opac_url>/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=Standard
2) Pick Type:Book. Put a title, author and isbn, cardnumber + library. Click 'Create'.
3) On the detail screen. Click on the 'Bibliographic record ID'.
4) On the biblio detail page, confirm there's an entry for author and ISBN.
5) Click "Marc preview:Show". Confirm the MARC data is as expected.

What I think you may be experiencing (on k-t-d/sandboxes):
From step 4), if you click "Edit -> Edit record", you'll be shown the "Fast Add Framework". This framework does not have fields 010 and 700, so they're effectively stripped. If you then change to default, these fields don't carry over, because they've been effectivelly stripped by the "Fast Add Framework".
To prove my point, access the edit biblio page using the Default frameworkcode directly from the URL, like below (update staff_url and change '21651' to your test biblionumber):
<staff_url>/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=21651&frameworkcode=Default

You'll notice that in this view, all MARC data is shown, including ISBN+Author. From here, if you switch to "Fast Add Framework" and then go back to "Default", you'll notice those fields are gone again. I believe this has always been the case in Koha since I can remember, but I may be wrong.
Please let me know if this makes sense and describes what you're experiencing. I've done this exercise creating an ILL request from either Staff or OPAC, it's no different from my testing.

(In reply to Sonia Bouis from comment #125)
> Strange thing, the request id from the one created from the OPAC had an
> prefix ILL- and not the one created from the staff. 

This is because there's a <prefix> configured in koha-conf.xml for 'CPL' (Centerville library on stock k-t-d database). This 'ILL-' prefix will happen for any ILL request created for Centerville, regardless if created in the OPAC or Staff. Only Centerville has this configured, so any other library will not have a prefix. I believe this is working as designed.

(In reply to Sonia Bouis from comment #125)
> Last thought, in addition of book, the request for DVD or Thesis should also
> create biblio records as it's often physical documents. 

My suggestion is that we file this as a follow-up bug, if you agree. This is additional functionality and in my opinion goes beyond the scope of this bug.
Comment 128 Pedro Amorim 2024-10-16 09:57:17 UTC
Created attachment 172809 [details] [review]
Bug 35570: (QA follow-up): Fix DVD type

I've added some DVD specific fields: language, format, genre, studio.
Happy to have this discussed and/or updated but hoping this is good enough for now.
To test:
1) Create an ILL request of 'DVD' type on both OPAC and Staff
2) Verify the form is shown without issues
3) Fill all fields and verify all fields are stored and shown correctly on both OPAC and STaff
Comment 129 Pedro Amorim 2024-10-16 09:58:00 UTC
(In reply to Tomás Cohen Arazi (tcohen) from comment #108)
> Please provide the dvd.inc and mark as PQA

Done.
Comment 130 Pedro Amorim 2024-10-16 10:48:11 UTC
Created attachment 172811 [details] [review]
Bug 35570: (QA follow-up): Update UNIMARC author to 200$f

Reworked the logic here a bit to ensure the following scenario for UNIMARC:
If both title and author exist, the result is:
200$aTitle$fAuthor

In the previous logic, it would become:
200$aTitle
200$fAuthor

I'm assuming the desired result is the former and not the latter.
Test following the same test plan, but try having only author, or only title, and verify that the resulted MARC data is as expected.
Comment 131 Pedro Amorim 2024-10-16 10:51:52 UTC
(In reply to Pedro Amorim from comment #127)
> Thank you Sonia for your testing, please read my replies below:
> 
> (In reply to Sonia Bouis from comment #125)
> > The actions from the test plan are OK but, I wonder if we should not put the
> > author in the field 200$f instead of 700$a because 700$a is only for the
> > surname, while you can put different elements of the name in 200$f.
> 
> Fair point, I'll provide a follow-up correcting this. Thank you.

Hi Sonia, I've now provided a patch that adds the author field information to 200$f instead of 700$a for UNIMARC. Please test when you're available. Thank you!
Comment 132 Mathieu Saby 2024-10-27 13:33:00 UTC
Hello
I wanted to ask why DVD or Thesis requests did not create biblio records, but I see Sonia has already made this remark... It believe it could be a nice improvement after this patch is pushed.
Comment 133 Mathieu Saby 2024-10-27 13:36:08 UTC
Pedro, if you use 200$f for the author in UNIMARC, would not it make sense to use 245$c in MARC21 (instead of 700$a), as this field have the same meaning?
Comment 134 Mathieu Saby 2024-10-27 13:55:15 UTC
I tested on a UNIMARC sandbox. Everything is fine in the record (010$a, 200$a, 200$f are created as expected)

But we should not have a 942$n field. It is not a defined in UNIMARC Koha standard framework.

However the proper handling of this information in UNIMARC is problematic in UNIMARC (see https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37600). So I suppose we can fix the code for ILL form for UNIMARC once a solution is pushed for bug 37600
Comment 135 Pedro Amorim 2024-10-28 09:25:47 UTC Comment hidden (obsolete)
Comment 136 Pedro Amorim 2024-10-28 09:26:55 UTC
(In reply to Mathieu Saby from comment #132)
> Hello
> I wanted to ask why DVD or Thesis requests did not create biblio records,
> but I see Sonia has already made this remark... It believe it could be a
> nice improvement after this patch is pushed.

Hi Mathieu, thank you for testing and adding to the discussion!
I'm fully on board with this and surely others are too.
I'd prefer to keep the scope of this bug limited to just adding FreeForm into core Koha, even though we've added some enhancements here, I think it'd be better to add have any other additional enhancements to follow-up bugs instead.

(In reply to Mathieu Saby from comment #133)
> Pedro, if you use 200$f for the author in UNIMARC, would not it make sense
> to use 245$c in MARC21 (instead of 700$a), as this field have the same
> meaning?

A very good question. When I added the UNIMARC support for biblio creation, it did not cross my mind to review the MARC21 mapping. As above, something to discuss on a follow-up bug imo.
Comment 137 Sonia Bouis 2024-10-29 15:32:33 UTC
Hi Pedro,
Just to let you know that I've tested again the unimarc biblio creation and that it's ok (perhaps the change made by Tomas in https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35570#c126 resolved the problem of author and isbn in biblio created in the OPAC).

Just wondering, is the status really passed QA? I don't see QA analysis on this.

Thank you again for this job.
Sonia
Comment 138 Pedro Amorim 2024-10-29 15:41:21 UTC
(In reply to Sonia Bouis from comment #137)
> Just wondering, is the status really passed QA? I don't see QA analysis on
> this.
> 
> Thank you again for this job.
> Sonia

(In reply to Pedro Amorim from comment #129)
> (In reply to Tomás Cohen Arazi (tcohen) from comment #108)
> > Please provide the dvd.inc and mark as PQA
> 
> Done.
Comment 139 Katrin Fischer 2024-10-30 17:52:16 UTC
Still applies, continueing work here tomorrow.
Comment 140 Katrin Fischer 2024-10-30 17:54:41 UTC
Please check:

 FAIL	Koha/ILL/Backend/Standard.pm
   FAIL	  critic
		"$marc_isbn" is declared but not used at line 1179, column 5. Unused variables clutter code and make it harder to read.
		"$marc_author" is declared but not used at line 1180, column 5. Unused variables clutter code and make it harder to read.
		"$marc_title" is declared but not used at line 1181, column 5. Unused variables clutter code and make it harder to read.
Comment 141 Katrin Fischer 2024-10-31 07:00:39 UTC
There are some issues here that will require follow-ups:

1) Translatability

a) Using __() in a .pm (nothing to do here)

I am glad I double checked these, because I thought they would not work, but they do get parsed into the po files. 

Koha/ILL/Backend/Standard.pm
+            name           => __('Switched provider'),
+            ui_method_name => __('Switch provider'),



b) But this... hm:

+    # FIXME: This should all be made translatable as is basically a
+    #        code => description mapping. The metadata() sub is using this
+    #        descriptions as keys. I thought this was a bug on this backend
+    #        but it turns out opac-illrequests.tt is using those descriptions
+    #        as keys. for example:

c) JS (definitely needs fixing):

+            '</span>Delete</button></li>';


2) Unused variables (to fix, see QA script complaint):

+    my $marc_isbn;
+    my $marc_author;
+    my $marc_title;

3) Terminology (please fix)

+<p><em>Please Note:</em> Branch is a mandatory field.</p>
+[% ELSIF whole.status == 'invalid_borrower' %]
+<p><em>Please Note:</em> The borrower details you entered are invalid.</p>
+[% ELSIF whole.status == 'invalid_branch' %]
+<p><em>Please Note:</em> The branch you chose is invalid.</p>
+[% ELSE %]

This repeats in several files, where the field itself has already been renamed to "Destination library".

branch => library

+        <label class="required" for="brw">Borrower</label>

Borrower => Patron

4) Database update (fixed)

a) No need to repeat the bug number for each message, it will be at the beginning of the paragraph. 

+                "Bug 35570: Updated ILL request attributes from 'FreeForm' to 'Standard'"

I removed these when moving the database update to dbrevs.

b) Can you explain this one? The English strings make me a little suspicious (question)

+        my $reports = join(
+            "\n",
+            map( "\tReport ID: "
+                    . $_->id
+                    . ' | Edit link: '
+                    . C4::Context->preference('staffClientBaseURL')
+                    . '/cgi-bin/koha/reports/guided_reports.pl?reports='
+                    . $_->id
+                    . "&phase=Edit%20SQL",
+                Koha::Reports->search( { savedsql => { -like => "%FreeForm%" } } )->as_list )
+        );


5) Wrong version (fixed)

+                                    <p>All 'FreeForm' ILL content should've been migrated to 'Standard' upon upgrading Koha to 24.05.</p>

Changed to 24.11 in follow-up.


6) Unit tests (separate bug?)

There are no unit tests, but it feels like there should be some...
Maybe for a separate bug at this point.

7) Styling (separate bug)

Some of the pages and elements in the forms have unusual styling. For example we are missing the "yellow" buttons for the main actions.
Comment 142 Katrin Fischer 2024-10-31 09:38:31 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 143 Pedro Amorim 2024-11-04 13:17:53 UTC
Created attachment 173916 [details] [review]
Bug 35570: (QA follow-up): Fix styling of confirmation buttons
Comment 144 Pedro Amorim 2024-11-04 13:17:57 UTC
Created attachment 173917 [details] [review]
Bug 35570: (QA follow-up): Fix terminology
Comment 145 Pedro Amorim 2024-11-04 13:18:01 UTC
Created attachment 173918 [details] [review]
Bug 35570: (QA follow-up): Fix translatability of 'Delete'

This is also fixing the delete->trash icon and spacing between label+icon
Comment 146 Pedro Amorim 2024-11-04 13:27:05 UTC
Hi Katrin, thank you very much for your work here and apologies not replying sooner:

1.a) Non-issue
1.b) Opened bug 38339 for this.
1.c) Patch submitted. Additional translatability work filed for bug 38340.
2) Non-issue, fixed upstream by commit 217b004. Thanks!
3) Patch submitted.
4.a) Thanks!
4.b) Yes, this produces the following warning if a report is found containing the word 'FreeForm'. This is to help administrators to update their reports reporting on FreeForm:

        Bug 35570: **ACTION REQUIRED**: Saved SQL reports containing occurrences of 'FreeForm' were found. The following reports MUST be updated accordingly ('FreeForm' -> 'Standard'):
                Report ID: 1 | Edit link: http://kohadev-intra.myDNSname.org:8081/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Edit%20SQL

I did not consider translatability here (sorry!). I'm not entirely sure how to do it here, or if worth the investment. Let me know!

5) Fixed upstream. Thanks!
6) Yes, bug 38341
7) Patch submitted
Comment 147 Katrin Fischer 2024-11-12 16:13:32 UTC
I am sorry Pedro, this one escaped me and I missed your great follow-ups.
I'll try to merge the work on bug 36221 and here.