Red Hat Bugzilla – Bug 829437
Hitting enter with blank field for GPG name returns JSON content
Last modified: 2014-09-18 11:32:48 EDT
Description of problem: When creating a GPG key, if a user hits "enter" on an unpopulated GPG Key name field, JSON text is returned on the screen instead of the expected error message. This does not occur if user hits the submit button. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Content Management > Content Providers > GPG Keys > +New GPG Key 2. Do not enter anything in the Name field; paste some text into the GPG 3. Hit the Save button - note the expected error about name validation. 4. Click into the Name field; do not enter any text and hit Enter/Return Actual results: JSON output {"validation_errors":["Name must contain at least 2 characters","Content can't be blank"],"notices":[]} Expected results: The error gets sent/bubbles up to UI as a notification as per any other notification. Additional info: The worst part about this bug is that user doesn't seem to be able to hit the back button in the browser a few times to return to the UI - s/he is just bounced back and forth between URLs for /cfse/gpg_keys and /cfse/gpg_keys#panel=new, both of which contain the same JSON.
commit 5ddcc146b787291780c45b0d60778e8226b5fc35 Author: Ivan Necas <inecas@redhat.com> Date: Fri Jun 29 14:10:41 2012 +0200 829437 - handle uploading GPG key when submitting with enter commit 8ecf419805b3363d0949e3a854ccce542c9184d1 Merge: 163c2af 9c71bc3 Author: Tom McKay <thomasmckay@redhat.com>
Fails in bigger, better ways now :) Now, when hitting enter in the gpg key name field, a stack is returned - see forthcoming attachment. CloudForms System Engine Version: 1.1.12-7.el6cf
Created attachment 613714 [details] stack returned when performing this behavior
It's connect with 857727, I suggest to disable ignoring enter button entirely in the name field. Reason: from user point of view after entering the name he still needs either enter the key in the text box or select the file. And then he has to press the button according the way he inserts the key. In other words, there is little possibility that hitting enter in the name will be successful (gpg key is blank). @corey: Would this proposed solution work for you?
We can try that out and see if it remedies the issue; I'll also be checking afterwards to see if I can identify any corner cases where this still might show up.
It was different issue at the end (wrong handing of validation errors when uploading the file through iframe). Fixed in https://github.com/Katello/katello/pull/693, commit bdb774be54dbbfd84f17cf72ef2b24845c73fb77
QE Verified CloudForms System Engine Version: 1.1.12-9.el6cf
*** Bug 859329 has been marked as a duplicate of this bug. ***
closing, currentrelease since these seemingly got missed in the 1.0.1 errata
getting rid of 6.0.0 version since that doesn't exist