Bug 35871 - Adding a merge_delete_authorities subpermission for editauthorities
Summary: Adding a merge_delete_authorities subpermission for editauthorities
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Wainui Witika-Park
QA Contact: Testopia
URL:
Keywords:
Depends on: 35870
Blocks:
  Show dependency treegraph
 
Reported: 2024-01-23 02:28 UTC by Wainui Witika-Park
Modified: 2025-02-05 05:34 UTC (History)
3 users (show)

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


Attachments
Bug 35871: Adding new subpermission merge_delete_authorities (7.44 KB, patch)
2024-01-23 03:43 UTC, Wainui Witika-Park
Details | Diff | Splinter Review
Bug 35871: Adding new subpermission merge_delete_authorities (8.27 KB, patch)
2024-01-24 01:29 UTC, Wainui Witika-Park
Details | Diff | Splinter Review
Bug 35871: Adding new subpermission merge_delete_authorities (8.45 KB, patch)
2024-01-24 01:59 UTC, Wainui Witika-Park
Details | Diff | Splinter Review
Bug 35871: Adding new subpermission merge_delete_authorities (11.05 KB, patch)
2025-01-28 05:28 UTC, Wainui Witika-Park
Details | Diff | Splinter Review
Bug 35871: Add new subpermission merge_delete_authorities (10.80 KB, patch)
2025-02-04 01:07 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Wainui Witika-Park 2024-01-23 02:28:34 UTC

    
Comment 1 Wainui Witika-Park 2024-01-23 03:43:47 UTC
Created attachment 161263 [details] [review]
Bug 35871: Adding new subpermission merge_delete_authorities

Sponsored-by: Education Services Australia SCIS
Comment 2 Wainui Witika-Park 2024-01-24 01:29:04 UTC
Created attachment 161318 [details] [review]
Bug 35871: Adding new subpermission merge_delete_authorities

Test plan:
- apply patch
- login to staff client with your personal user
- make a new test user
- set the new test user's permissions to catalogue so they can access the staff client
- logout and log back in to the staff client as the new test user
- go to Authorities
- do a search
- notice there is no drop down next to each authority search result
- logout and log back in to the staff client as your personal user
- edit the new test user - add permission editauthorities and subpermission merge_delete_authorities
- logout and log back in to the staff client as the test user
- go to Authorities
- do a search
- notice how you there is an "Actions" dropdown next to each of the authority search results
- click the Action dropdown and notice you can merge
- check you can merge results
- also check you can delete a result that has 0 records

Sponsored-by: Education Services Australia SCIS
Comment 3 Wainui Witika-Park 2024-01-24 01:59:53 UTC
Created attachment 161319 [details] [review]
Bug 35871: Adding new subpermission merge_delete_authorities

Test plan:
- apply patch from Bug 35870
- apply patch
- login to staff client with your personal user
- make a new test user
- set the new test user's permissions to catalogue so they can access the staff client
- also set the new test user's permissions to subpermission edit_authorities, but not merge_delete_auhtorities
- logout and log back in to the staff client as the new test user
- go to Authorities
- do a search
- notice there is an 'Actions' drop down next to each authority search result
- notice that the drop down does not give you the option to choose Merge
or Delete
- logout and log back in to the staff client as your personal user
- edit the new test user - add subpermission merge_delete_authorities
- logout and log back in to the staff client as the test user
- go to Authorities
- do a search
- notice how you there is an 'Actions' dropdown next to each of the authority search results
- click the Action dropdown and notice you can merge
- check you can merge results
- also check you can delete a result that has 0 records

Sponsored-by: Education Services Australia SCIS
Comment 4 Laurence Rault 2024-09-27 19:00:42 UTC
Patch does not apply
Comment 5 Wainui Witika-Park 2025-01-28 05:28:07 UTC
Created attachment 177209 [details] [review]
Bug 35871: Adding new subpermission merge_delete_authorities

Test plan:
- apply patch from Bug 35870
- apply patch
- login to staff client with your personal user
- make a new test user
- set the new test user's permissions to catalogue so they can access the staff client
- also set the new test user's permissions to subpermission edit_authorities, but not merge_delete_auhtorities
- logout and log back in to the staff client as the new test user
- go to Authorities
- do a search
- notice there is an 'Actions' drop down next to each authority search result
- notice that the drop down does not give you the option to choose Merge
or Delete
- logout and log back in to the staff client as your personal user
- edit the new test user - add subpermission merge_delete_authorities
- logout and log back in to the staff client as the test user
- go to Authorities
- do a search
- notice how you there is an 'Actions' dropdown next to each of the authority search results
- click the Action dropdown and notice you can merge
- check you can merge results
- also check you can delete a result that has 0 records

Sponsored-by: Education Services Australia SCIS
Comment 6 Wainui Witika-Park 2025-01-28 05:29:47 UTC
(In reply to Laurence Rault from comment #4)
> Patch does not apply

thanks, I have added a new one now :)
Comment 7 David Nind 2025-02-03 20:26:07 UTC
The patch still applies, however the database update to add the new permission doesn't work.
Comment 8 David Nind 2025-02-04 01:07:28 UTC
Created attachment 177495 [details] [review]
Bug 35871: Add new subpermission merge_delete_authorities

Add a new sub permission for merging and deleting
authority records.

Test plan:
1. Apply the patch (including bug 35870).
2. Update the database.
3. Login to the staff interface as a superlibrarian.
4. Add or edit an existing staff patron.
5. Set the patron's permissions to catalogue so they can access
   the staff interface.
6. Also add the edit_authorities permission, but not
   merge_delete_authorities.
7. Logout and log back in to the staff interface as the patron.
8. Go to Authorities.
9. Search for an authority record, for example search for 'a'.
10. Notice that there is an 'Actions' dropdown next to each authority
    search result.
11. Notice that the dropdown does not give you the option to
    choose Merge or Delete
12. Logout and log back in to the staff interface as a superlibrarian.
13. Edit the staff patron - add the sub permission
    merge_delete_authorities.
14. Logout and log back in to the staff interface as the staff
    patron.
15. Repeat steps 8 to 9.
16. Click the Action dropdown and notice you can merge.
17. Check that you can merge authority records.
18. Also check you can delete a search result that has 0 records.

Sponsored-by: Education Services Australia SCIS
Comment 9 David Nind 2025-02-04 01:23:55 UTC
I fixed the database update (using bug 35870 as a pattern) and updated the commit message.

However, I got login and CSRF errors when attempting to merge a record - so I have left the status as Failed QA. Bug 36192.

I also think the colour/style needs changing for the merge message box with the bootstrap 5 update and styles for the different types of information boxes - see bug 35402 and bug 38519.  

To replicate:

1. Log in with the staff patron with edit_authorities and merge_delete_authorities.
2. Go to Authorities.
3. Search for an authority record, for example, 'a'.
4. For one record, from the 'Actions' select 'Merge'
5. A blue message box appears with "Merging with authority....".
6. For another term (of the same type) select Action > Merge.
7. The two record titles are displayed and you can select which one and then Next.
8. Note that you get the log in box with:
    Error: Session timed out.
    Please log in again
9. Log in again, you get the pages to select some tags from each record so that there is material in the destination record.
10. Click "Merge".
11. You get an error:
    An error has occurred!
    Error 403
    The form submission failed (Wrong CSRF token). Try to come back, refresh the   page, then try again.
Comment 10 Wainui Witika-Park 2025-02-05 05:34:28 UTC
(In reply to David Nind from comment #9)
> I fixed the database update (using bug 35870 as a pattern) and updated the
> commit message.
Thank you for that!
> 
> However, I got login and CSRF errors when attempting to merge a record - so
> I have left the status as Failed QA. Bug 36192.
> 
> I also think the colour/style needs changing for the merge message box with
> the bootstrap 5 update and styles for the different types of information
> boxes - see bug 35402 and bug 38519.  
Do you think that should be done in this bug report or a separate one?
> 
> To replicate:
> 
> 1. Log in with the staff patron with edit_authorities and
> merge_delete_authorities.
> 2. Go to Authorities.
> 3. Search for an authority record, for example, 'a'.
> 4. For one record, from the 'Actions' select 'Merge'
> 5. A blue message box appears with "Merging with authority....".
> 6. For another term (of the same type) select Action > Merge.
> 7. The two record titles are displayed and you can select which one and then
> Next.
> 8. Note that you get the log in box with:
>     Error: Session timed out.
>     Please log in again
> 9. Log in again, you get the pages to select some tags from each record so
> that there is material in the destination record.
> 10. Click "Merge".
> 11. You get an error:
>     An error has occurred!
>     Error 403
>     The form submission failed (Wrong CSRF token). Try to come back, refresh
> the   page, then try again.

Hmm, I am not getting the same output, I am not getting step 8. I am able to successfully merge.