seek
seek copied to clipboard
Short PID errors after validation
Users are able to create sample attributes with a invalid PID. E.g.: 'Source:bacterial culture'.
But when the user tries to add a sample to the Sample type, the short_pid
function errors out.
- The validation of the PID should be modified to make these PIDs invalid.
- In case the PID passes the validation but raises an exception in the
short_pid
function, it should fail graciously instead just erroring out.
Screen shot:
I've found using URI::regexp
sometimes allows invalid uri's before, but URI::ABS_URI
might be better to use.
3.1.4 :003 > URI::regexp =~ 'fish:soup'
=> 0
3.1.4 :004 > URI::regexp =~ 'fish:soup pie'
=> 0
3.1.4 :005 > URI::ABS_URI =~ 'fish:soup pie'
=> nil
3.1.4 :006 > URI::ABS_URI =~ 'fish:soup'
=> 0