Bug 31269

Summary: DataTables error when managing staged MARC records
Product: Koha Reporter: Lucas Gass <lucas>
Component: MARC Bibliographic record staging/importAssignee: Lucas Gass <lucas>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: andrewfh, arthur.suzuki, jonathan.druart
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00, 22.05.06
Bug Depends on: 31138    
Bug Blocks:    
Attachments: Bug 31269: Define sDefaultContent for DataTables
Bug 31269: Define sDefaultContent for DataTables
Bug 31269: Define sDefaultContent for DataTables

Description Lucas Gass 2022-07-29 20:38:04 UTC
Bug 31138 made some DataTable errors much more visible, which is good. One that was noticed was when managing staged MARC files.

To recreate:

1. Stage a MARC record for import
2. Once you have one click on 'Manage staged records'
3. You will see an alert that says "Something went wrong when loading the table."
4. If you dismiss that you should see the following error:

DataTables warning: table id=records-table - Requested unknown parameter '' for row 0, column 4. For more information about this error, please see http://datatables.net/tn/4
Comment 1 Lucas Gass 2022-07-29 23:40:31 UTC
Since columns 4 and 5 are later populated by jQuery 'sDefaultContent' should be used to define the placeholder value, I think.
Comment 2 Lucas Gass 2022-07-29 23:44:13 UTC
Created attachment 138380 [details] [review]
Bug 31269: Define sDefaultContent for DataTables

1. Stage a MARC record for import
2. Once you have one click on 'Manage staged records'
3. You will see an alert that says "Something went wrong when loading the table."
4. If you dismiss that you should see the following error:

DataTables warning: table id=records-table - Requested unknown parameter '' for row 0, column 4. For more information about this error, please see http://datatables.net/tn/4

5. Appy patch
6. Try ssteps 1 & 2 again
7. No DataTable errors
Comment 3 Katrin Fischer 2022-07-30 21:55:27 UTC
Created attachment 138400 [details] [review]
Bug 31269: Define sDefaultContent for DataTables

1. Stage a MARC record for import
2. Once you have one click on 'Manage staged records'
3. You will see an alert that says "Something went wrong when loading the table."
4. If you dismiss that you should see the following error:

DataTables warning: table id=records-table - Requested unknown parameter '' for row 0, column 4. For more information about this error, please see http://datatables.net/tn/4

5. Appy patch
6. Try ssteps 1 & 2 again
7. No DataTable errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2022-07-31 20:50:50 UTC
Please don't forget to fill in the assignee.
Comment 5 Jonathan Druart 2022-08-01 08:51:09 UTC
Created attachment 138451 [details] [review]
Bug 31269: Define sDefaultContent for DataTables

1. Stage a MARC record for import
2. Once you have one click on 'Manage staged records'
3. You will see an alert that says "Something went wrong when loading the table."
4. If you dismiss that you should see the following error:

DataTables warning: table id=records-table - Requested unknown parameter '' for row 0, column 4. For more information about this error, please see http://datatables.net/tn/4

5. Appy patch
6. Try ssteps 1 & 2 again
7. No DataTable errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Tomás Cohen Arazi 2022-08-01 12:31:33 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 7 Lucas Gass 2022-09-29 15:21:46 UTC
Backported to 22.05.x for 22.05.06
Comment 8 Arthur Suzuki 2022-10-12 11:08:53 UTC
I don't reproduce the original issue on 21.11.x branch.
Won't backport unless asked to.