Bug 30584

Summary: Cannot add field mappings to Elasticsearch configuration
Product: Koha Reporter: Nick Clemens <nick>
Component: Searching - ElasticsearchAssignee: Jonathan Druart <jonathan.druart+koha>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P5 - low CC: andrewfh, jonathan.druart+koha, kyle, victor
Version: masterKeywords: rel_21_11_candidate
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.05.00,21.11.05
Bug Depends on: 29893    
Bug Blocks:    
Attachments: Bug 30584: Fix ES mapping creation
Bug 30584: Fix ES mapping creation
Bug 30584: Fix ES mapping creation

Description Nick Clemens 2022-04-21 15:01:27 UTC
bug 29893 redraws the table before submission - this appears to remove any rows we have added

To test:
1 - Browse to Administration -> Catalog -> Search engine configuration (Elasticsearch)
2 - Click on 'Bibliographic records' tab
3 - Scroll to bottom and enter a new mapping and click '+Add' button at far right
4 - Click 'Save' button at bottom
5 - You may notice your new row disappears, then the page reloads
6 - Check for your new mapping - it has not been added
Comment 1 Jonathan Druart 2022-04-21 15:59:31 UTC
This template is a nightmare...
Comment 2 Jonathan Druart 2022-04-21 17:30:27 UTC
Created attachment 133595 [details] [review]
Bug 30584: Fix ES mapping creation

We need to tell DT that we are adding/removing row, not only deal
manually with the DOM.

This patch also fixes the following bug: if you add or remove a row from
the "biblio" tab, then go to another tab and back to "biblio", all
changes were gone (bug existed prior to bug 29893).

Test plan:
Add, edit and remove mappings, switch from tabs and save.
Use the filters, save (29893 regression test)
Comment 3 Jonathan Druart 2022-04-21 17:31:26 UTC
Upping severity, it impacts stable.
Comment 4 David Nind 2022-04-22 10:01:34 UTC
Created attachment 133657 [details] [review]
Bug 30584: Fix ES mapping creation

We need to tell DT that we are adding/removing row, not only deal
manually with the DOM.

This patch also fixes the following bug: if you add or remove a row from
the "biblio" tab, then go to another tab and back to "biblio", all
changes were gone (bug existed prior to bug 29893).

Test plan:
Add, edit and remove mappings, switch from tabs and save.
Use the filters, save (29893 regression test)

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Kyle M Hall 2022-04-25 14:10:55 UTC
Holding of on release of 21.11.05 until this has been pushed to master so I can backport it.
Comment 6 Nick Clemens 2022-04-25 14:15:32 UTC
Created attachment 133800 [details] [review]
Bug 30584: Fix ES mapping creation

We need to tell DT that we are adding/removing row, not only deal
manually with the DOM.

This patch also fixes the following bug: if you add or remove a row from
the "biblio" tab, then go to another tab and back to "biblio", all
changes were gone (bug existed prior to bug 29893).

Test plan:
Add, edit and remove mappings, switch from tabs and save.
Use the filters, save (29893 regression test)

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Fridolin Somers 2022-04-25 20:02:09 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 8 Kyle M Hall 2022-04-26 13:31:33 UTC
Pushed to 21.11.x for 21.11.05
Comment 9 Andrew Fuerste-Henry 2022-05-03 19:43:23 UTC
Missing dependency, not backported to 21.05