-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Works - Failed submission clears entered information #3978
Comments
@samvera/hyrax-repo-managers @samvera/hyrax-ui-ux-advisors i want to check in about this issue. it seems clear to me that we should make the suggested improvement, so i've tagged this for the 3.x release series (effectively making it current work). however, i think this is long standing behavior of the work form and, while unfortunate, isn't a release blocker. thoughts? |
discussion in slack seems to represent a consensus that this is not a release blocker. i've marked it |
Some work was done on the JavaScript side of the things to save the form data when POST request fails, and repopulate the form as it renders with the error alert. This adds a lot to maintaining the code in the future and seems like not the best way to do this. There should be much cleaner way to do this with forms in Ruby side of things. I'm not sure whether this is the same to the this question, but maybe this can be taken as an example of how to do this in server-side. The current work done on this in the JS side is in the branch |
@no-reply how about if we just don't let them pick a date that is invalid. This would be a simple/quick solution. |
@blancoj this issue is broader than the date validation problem (which is represented by #3979). the issue is that for any invalid form input, data isn't retained. since we do validation outside the form itself, we're always going to have cases where these kinds of problems could arise, right? note that we closed #3979 as a browser issue, unrelated to hyrax work. i.e.: we already validate input dates at the form layer when the browser supports that using HTML5 features. |
@no-reply - In my analysis of the situation, I'm thinking that I'd likely want to change the Hyrax::Forms::Workform behavior to use hyrax/app/forms/hyrax/forms/work_form.rb Line 37 in 118a825
What I'm thinking is that I'm writing this down to think through the approach, and to put a bookmark in it for today's work. |
Prior to this commit, when I would submit an invalid work create form, the re-rendered form would have blank input values. With this change all non-file attributes are re-loaded with the submitted values. Please note, this needs a bit more time to put full polish on, but I want to make sure its a path worth pursuing. If this is a reasonable path, I'm happy to add the additional specs and inline comments to get this working. I'm presently dissatisfied with the changes I needed to make to the case statement, and would appreciate guidance on how to correct that. Related to #3978
Prior to this commit, when I would submit an invalid work create form, the re-rendered form would have blank input values. With this change all non-file attributes are re-loaded with the submitted values. Please note, this needs a bit more time to put full polish on, but I want to make sure its a path worth pursuing. If this is a reasonable path, I'm happy to add the additional specs and inline comments to get this working. I'm presently dissatisfied with the changes I needed to make to the case statement, and would appreciate guidance on how to correct that. Related to #3978
Prior to this commit, when I would submit an invalid work create form, the re-rendered form would have blank input values. With this change all non-file attributes are re-loaded with the submitted values. Please note, this needs a bit more time to put full polish on, but I want to make sure its a path worth pursuing. If this is a reasonable path, I'm happy to add the additional specs and inline comments to get this working. I'm presently dissatisfied with the changes I needed to make to the case statement, and would appreciate guidance on how to correct that. Related to #3978
Prior to this commit, when I would submit an invalid work create form, the re-rendered form would have blank input values. With this change all non-file attributes are re-loaded with the submitted values. Please note, this needs a bit more time to put full polish on, but I want to make sure its a path worth pursuing. If this is a reasonable path, I'm happy to add the additional specs and inline comments to get this working. I'm presently dissatisfied with the changes I needed to make to the case statement, and would appreciate guidance on how to correct that. Related to #3978
@MariaStarPower I'm moving this to the front of my queue. |
Testing on nurax-dev using embargo date from past as invalid value - title, creator, rights statement, and alternative title (so required fields and non-required fields) are preserved in the form when the save fails. |
Tested on nurax-dev in both Firefox and Chrome. Required fields and non-required fields are preserved, however file is removed. Is this expected? @jlhardes, let me know if this needs a new ticket. |
@rjkati I think this passes for what this issue was fixing (preserving the descriptive form field info on a failed submit). It is worth it to create a new ticket for the lost file upload, though, so we can see if anything can be done to preserve that as well. Link to this ticket for additional context. |
Lost file uploads are EXTREMELY expensive to solve. There's a browser
security issue (e.g. the browser can't say what file to upload). So
there's a "hold this file on the server in a tmp directory and wait for a
user to submit something that says use this file."
…On Wed, Feb 24, 2021 at 12:52 PM Julie Hardesty ***@***.***> wrote:
@rjkati <https://github.com/rjkati> I think this passes for what this
issue was fixing (preserving the descriptive form field info on a failed
submit). It is worth it to create a new ticket for the lost file upload,
though, so we can see if anything can be done to preserve that as well.
Link to this ticket for additional context.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#3978 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAQUTLN7NSTQFBRDG3F4DTAU4FBANCNFSM4IWJPZ4Q>
.
--
Jeremy Friesen
takeonrules.com
|
Testing on iOS safari now displays an error page when setting a past embargo: https://nurax-dev.curationexperts.com/concern/generic_works?locale=en I've been able to reproduce this error on Windows Chrome, so it seems that it's not browser related. If I set a future date for the embargo, the deposit proceeds successfully. |
Descriptive summary
Submitting a work with an invalid field results in the work failing to be created (which is expected), and any fields you entered, or files you upload, are cleared.
Tested on mac - Firefox Quantum 70.0b3
hyrax info
Hyrax Version: 3.0.0.pre.rc1 Hyrax Branch: master Hyrax Revision: 48ed925Nurax Version
ENV: production
SHA: 40b47b0d71af1b958e016ebe49212c1740683133
Branch: 2019-09-12-10-00
Updated: 12 Sep 2019 15:00:37
Rationale
It is not great to have to completely rebuild a work submission if a submission fails.
Expected behavior
The form data could be cached?
Actual behavior
Form data is lost if the submission doesn't go through
Steps to reproduce the behavior
Related work
May be somewhat similar to #3414
The text was updated successfully, but these errors were encountered: