dspace-angular
dspace-angular copied to clipboard
Invalid (>30 char length) policy names are allowed by angular in create / edit resource policy
Describe the bug The resource policy name column in DSpace has a character limit of 30 characters. Angular will allow any length in the "name" field of a resource policy create/edit form anyway, and report a generic 500 Server Error if the length of the name is above 30 characters.
Caused by: java.sql.BatchUpdateException: Batch entry 0 update public.resourcepolicy set action_id=13, dspace_objec
t='a3d46767-8cbd-4cea-915f-c3f055ffab01'::uuid, end_date=NULL, eperson_id='26db1627-b362-4602-82a9-6deb6c27aedd'::u
uid, epersongroup_id=NULL, resource_type_id=2, rpdescription='adsf', rpname='test hidden metadata read on item', rp
type='TYPE_CUSTOM', start_date=NULL where policy_id=41 was aborted: ERROR: value too long for type character varyin
g(30) Call getNextException to see other errors in the batch.
To Reproduce Steps to reproduce the behavior:
- Create or edit a resource policy on an item (or other DSO)
- Set the the name of the policy and try to save it. Note the displayed error and the logged hibernate error
Expected behavior
- Form validation that warns / restricts users from saving a policy with an invalid name.
- Better handling in backend rest / API service so that a more useful error can be thrown? (not an angular issue but noting here)
we (at 4Science) can work on that. REST implementation (to return a 422 instead than the 500) would take 6 hours. The constraint could be relaxed to a wider size (100).
The angular part would take 4 hrs. Total estimation 10 hours
we (at 4Science) can work on that. REST implementation (to return a 422 instead than the 500) would take 6 hours. The constraint could be relaxed to a wider size (100).
The angular part would take 4 hrs. Total estimation 10 hours
Thanks @abollini ! Assigning to you for your team to work on for 7.5. I'll add the estimate as well.
unclaiming as we have other priorities as volunteer work
Closing as this was fixed by #2973 in 7.6.2 and 8.0