Bug 22428 - MARC modification template cuts text to 100 characters
Summary: MARC modification template cuts text to 100 characters
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Matt Blenkinsop
QA Contact: Testopia
URL:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2019-02-27 22:35 UTC by Caroline Cyr La Rose
Modified: 2023-12-28 20:43 UTC (History)
4 users (show)

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


Attachments
Bug 22428: Change datatype of field_value to text (2.36 KB, patch)
2023-02-21 10:34 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 22428: Attach DBIC file (1.63 KB, patch)
2023-02-21 10:36 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 22428: Change datatype of field_value to text (2.41 KB, patch)
2023-02-21 16:21 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 22428: Attach DBIC file (1.69 KB, patch)
2023-02-21 16:21 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 22428: Change datatype of field_value to text (2.46 KB, patch)
2023-02-24 17:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 22428: Attach DBIC file (1.74 KB, patch)
2023-02-24 17:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 22428: (QA follow-up) Add exec flag to update (655 bytes, patch)
2023-02-24 17:08 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2019-02-27 22:35:49 UTC
When trying to update a field using a MARC modification template, it is impossible to put a value of over 100 characters.

To reproduce:
1. Go to Tools > MARC modification templates
2. Click on 'New template'
3. Name your new template and click on 'Submit'
4. Click on 'New action'
5. Enter the following information in the form
    - 'Add new'
    - field(s): 856 y
    - with value: Organization-wide access - sign on to OnePass / Accès à l'échelle de l'organisation - Ouvrez une session (OnePass)
6. Click on Add action
7. Note that the text is cut in the displayed table 'Organization-wide access - sign on to OnePass / Accès à l'échelle de l'organisation - Ouvrez une ses'
8. Do a search to obtain a biblionumber
    1. Make a search in the catalog
    2. Click on the title to go to the detailed record
    3. Click on the 'MARC' tab
    4. The biblionumber is written next to MARC record:
    5. Copy the biblionumber
9. Go to Tools > Batch record modification
10. In the 'List of biblionumbers...' text box, paste the biblionumber
11. Choose the template created at step 3 in the 'Modify record using the following template:' drop down menu
12. Click on 'Continue'
13. Click on 'Show MARC' to see the result of the modification (the added line is usually at the bottom, note that the text is still cut after 100 characters, so not only a display bug)
14. Click on 'Close'
15. Click on 'Modify selected records'
16. Click on the biblionumber to see the modified record
17. In the detailed record, the 856y field is under 'Online resources' (note that the text is still cut)

I noticed that in the database, the field field_value in the table marc_modification_template_actions is limited to 100 characters.
Comment 1 Noémie Labine 2022-02-15 15:39:42 UTC
+1
Comment 2 Katrin Fischer 2022-02-21 22:34:02 UTC
I believe marc_modification_template_actions.field_value varchar(100) might be to blame here. Should we move this up to mediumtext?
Comment 3 Matt Blenkinsop 2023-02-21 10:34:36 UTC
Created attachment 147020 [details] [review]
Bug 22428: Change datatype of field_value to text

This patch changes the datatype of the field_value column in
marc_modification_template_actions to "text". This is to stop text
strings longer than 100 characters from being chopped short and allow
longer strings up to 65,000 characters.

Test plan:
1) Follow the same steps outlined by Caroline in the problem statement
2) Apply patch
3) Follow the steps again and this time the text should upload with no
   problem
Comment 4 Matt Blenkinsop 2023-02-21 10:36:05 UTC
Created attachment 147021 [details] [review]
Bug 22428: Attach DBIC file

DBIC file for updated column

Test plan as above
Comment 5 Caroline Cyr La Rose 2023-02-21 16:21:24 UTC
Created attachment 147074 [details] [review]
Bug 22428: Change datatype of field_value to text

This patch changes the datatype of the field_value column in
marc_modification_template_actions to "text". This is to stop text
strings longer than 100 characters from being chopped short and allow
longer strings up to 65,000 characters.

Test plan:
1. Create a MARC modification template with a text value over 100 characters
   1.1 Go to Cataloging > MARC modification templates
   1.2. Click on 'New template'
   1.3. Name your new template and click on 'Submit'
   1.4. Click on 'New action'
   1.5. Enter the following information in the form
        - 'Add new'
        - field(s): 856 y
        - with value: Organization-wide access - sign on to OnePass / Accès à l'échelle de l'organisation - Ouvrez une session (OnePass)
   1.6. Click on Add action
   --> Note that the text is cut in the displayed table 'Organization-wide access - sign on to OnePass / Accès à l'échelle de l'organisation - Ouvrez une ses'
2. Use the MARC modification template on a bibliographic record
    2.1 Make a search in the catalog
    2.2. Click on the title to go to the detailed record
    2.3. Click 'Edit' and choose 'Modify record using template'
    2.4. Choose the template from step 1 from the drop-down menu
    2.5. Click on 'Show MARC' to see the result of the modification (the added line is usually at the bottom)
    --> Note that the text is still cut after 100 characters (so not only a display bug)
    2.6. Click on 'Close'
    2.7. Click on 'Modify selected records'
    2.8. Click on 'View detail of the enqueued job'
    2.9. Click on the biblionumber under 'Detailed messages' to see the modified record
    --> In the detailed record, the 856y field is under 'Online resources', note that the text is still cut

3. Apply patch, update database
4. Redo steps 1 and 2
   --> On step 1.6. the text is displayed in full in the table
   --> On step 2.5. the text is displayed in full in the MARC preview
   --> On step 2.9. the text is displayed in full in the detailed record, under Online resources

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
I updated the test plan for new functionalities in master
Comment 6 Caroline Cyr La Rose 2023-02-21 16:21:26 UTC
Created attachment 147075 [details] [review]
Bug 22428: Attach DBIC file

DBIC file for updated column

Test plan as above

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 7 Caroline Cyr La Rose 2023-02-21 16:22:54 UTC
Some things had changed in master since my original test plan (some things moved, some new functionalities reduced the test plan to less steps), so I updated it a bit. I hope that's ok
Comment 8 Nick Clemens 2023-02-24 17:08:38 UTC
Created attachment 147374 [details] [review]
Bug 22428: Change datatype of field_value to text

This patch changes the datatype of the field_value column in
marc_modification_template_actions to "text". This is to stop text
strings longer than 100 characters from being chopped short and allow
longer strings up to 65,000 characters.

Test plan:
1) Follow the same steps outlined by Caroline in the problem statement
2) Apply patch
3) Follow the steps again and this time the text should upload with no
   problem

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 9 Nick Clemens 2023-02-24 17:08:40 UTC
Created attachment 147375 [details] [review]
Bug 22428: Attach DBIC file

DBIC file for updated column

Test plan as above

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Nick Clemens 2023-02-24 17:08:42 UTC
Created attachment 147376 [details] [review]
Bug 22428: (QA follow-up) Add exec flag to update
Comment 11 Tomás Cohen Arazi 2023-02-24 20:38:25 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 12 Jacob O'Mara 2023-03-01 16:51:21 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.
Comment 13 Caroline Cyr La Rose 2023-05-12 15:40:42 UTC
Seems to be only backend stuff, nothing to add/change in the manual.