-
Notifications
You must be signed in to change notification settings - Fork 530
Item action button disabled after redirect from action page #1695
Copy link
Copy link
Closed
Labels
bugcomponent: Item(Archived) Item display or editing(Archived) Item display or editinge/12Estimate in hoursEstimate in hourshelp wantedNeeds a volunteer to claim to move forwardNeeds a volunteer to claim to move forwardhigh priorityperformance / cachingRelated to performance, caching or embedded objectsRelated to performance, caching or embedded objectsusability
Milestone
Description
Describe the bug
After withdrawing/reinstating an Item and getting redirected back to /edit/status, the reinstate/withdraw button is disabled.
To Reproduce
- Log in as an admin
- Edit any archived Item
- Click "Withdraw" and confirm
- You will be redirected back to
/edit/status - The "Reinstate" button will be disabled
- You will be redirected back to
- Refresh
- The "Reinstate" button will no longer be disabled
- Click "Reinstate" and confirm
- You will be redirected back to
/edit/status - The "Withdraw" button will be disabled
- You will be redirected back to
- Refresh
- The "Withdraw" button will no longer be disabled
Expected behavior
The buttons should not be disabled after the initial redirect.
Underlying issue
This happens because the Item's authorization features are taken from the cache after the redirect; if the action changes them this does not get reflected on the status page.
Currently this is only noticeable for withdrawItem & reinstateItem.
@artlowel suggested this should be solved more generally:
- When a cached DSO is invalidated via
DataService.invalidate(), cached authorizations related to it should be invalidated as well - We'd need to have a way of retrieving the related authorizations, for example by keeping an index of UUID → authorization.
Even more generally, we may want to index resources that depend on other resources; DSO → authorization would be a specific case of this. - Once something like the above is in place, the bug can be solved by adding an
invalidate(item)call toItemDataService.setWithDrawnand similar methods
Related work
#1608
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugcomponent: Item(Archived) Item display or editing(Archived) Item display or editinge/12Estimate in hoursEstimate in hourshelp wantedNeeds a volunteer to claim to move forwardNeeds a volunteer to claim to move forwardhigh priorityperformance / cachingRelated to performance, caching or embedded objectsRelated to performance, caching or embedded objectsusability