Bug 29019 - Unable to delete HTML customization
Summary: Unable to delete HTML customization
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-14 15:34 UTC by Caroline Cyr La Rose
Modified: 2021-10-08 10:51 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Text to go in the release notes:
Version(s) released in:
21.11.00


Attachments
Bug 29019: Unable to delete HTML customization (5.46 KB, patch)
2021-09-23 21:35 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 29019: Unable to delete HTML customization (5.53 KB, patch)
2021-09-24 15:48 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 29019: Unable to delete HTML customization (5.60 KB, patch)
2021-09-26 14:29 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 29019: Restore eval call (986 bytes, patch)
2021-09-28 10:44 UTC, Jonathan Druart
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 2021-09-14 15:34:19 UTC
Hi all,

I don't know if I'm just not doing it right, but I cannot seem to be able to delete an HTML customization.

To replicate :
1. Go to Tools > HTML customizations
2. Click on New entry
3. Fill out the form (I tried it with OpacSuggestionInstructions and OpacLoginInstructions)
4. Click Save
5. In the list of HTML customizations, click on the Delete button at the end of the row
-> Note that it goes back to Additional contents (News) instead of Additional contents (HTML customizations)
6. Go back to Tools > HTML customizations
-> Note that the entry you deleted is still there

Since it goes back to Additional contents (News) after deleting, I'm wondering if it has something to do with the separation of News and HTML customizations...

Caroline
Comment 1 Owen Leonard 2021-09-23 21:35:54 UTC Comment hidden (obsolete)
Comment 2 Caroline Cyr La Rose 2021-09-24 15:48:18 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2021-09-26 14:29:54 UTC
Created attachment 125339 [details] [review]
Bug 29019: Unable to delete HTML customization

This patch makes some corrections to additional contents to allow
content to be deleted. The wrong parameter was being passed to the
script. The script was also not handling multiple deletions correctly.

The patch also adds a "category" parameter to the delete operation so
that the page is redirected correctly.

The patch also changes some strings which referred to "news"
referencing operations which might be performed on news or on HTML
customizations, e.g.:

"Are you sure you want to delete the selected content?" instead of "Are
you sure you want to delete the selected news?"

To test, apply the patch and go to Tools -> News.

- Create multiple news items if necessary.
- Test the "Delete" button corresponding to a single news item:
  - Clicking the button should ask you to confirm.
  - Check that the wording of the message is correct.
  - After confirming the news item should be deleted.
  - Ideally, test on news items which are on the second page of the
    DataTable of news items.
- Test the process of deleting multiple news items at once:
  - Check the checkbox next to multiple items.
  - Click the "Delete selected" button at the bottom of the page.
  - Check that the wording of the confirmation message is correct.
  - After you confirm, the items should be deleted.
- Repeat these tests under Tools -> HTML customizations to confirm that
  redirects work correctly. After deleting an HTML customization you
  should be redirected back to the list of HTML customizations.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2021-09-28 10:44:11 UTC
Created attachment 125394 [details] [review]
Bug 29019: Restore eval call

But fix it (pass an arrayref). We need the eval to catch possible errors.
Comment 5 Jonathan Druart 2021-09-28 13:38:56 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 6 Kyle M Hall 2021-10-08 10:51:36 UTC
Affected feature is not part of 21.05.x