Create Container [enter] on blank field raises error

Bug #1655487 reported by Cindy Lu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Jeremy Moffitt

Bug Description

If you leave the field blank, the 'Submit' button is disabled. However, if you press 'Enter' it will trigger an action and raise this error behind the modal:

"Danger there was an error submitting the form."

This is on the server side:
Forbidden (CSRF token missing or incorrect.): /project/containers/
[10/Jan/2017 23:02:30] "POST /project/containers/ HTTP/1.1" 403 2274

Speculation:
Seems like it's only for schema forms? Same issue with this one: https://review.openstack.org/#/c/344572/
Does not seem to occur when the HTML template is used (no issue here: https://review.openstack.org/#/c/341945/). The other difference is that this uses a modal workflow...?

Revision history for this message
Richard Jones (r1chardj0n3s) wrote :

Confirmed; it's strange because hitting enter doesn't submit the modal, but does seem to try to submit the form.

Changed in horizon:
status: New → Triaged
importance: Undecided → High
milestone: none → ocata-3
Changed in horizon:
milestone: ocata-3 → ocata-rc1
Changed in horizon:
milestone: ocata-rc1 → next
tags: added: ocata-backport-potential
Revision history for this message
Jeremy Moffitt (jeremy-moffitt) wrote :

going to investigate and see if I can figure this out... if someone more familiar with the problem wants to take a gander at it, feel free to re-assign.

Changed in horizon:
assignee: nobody → Jeremy Moffitt (jeremy-moffitt)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/461490

Changed in horizon:
status: Triaged → In Progress
Ying Zuo (yingzuo)
Changed in horizon:
milestone: next → queens-1
Ying Zuo (yingzuo)
Changed in horizon:
milestone: queens-1 → queens-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/461490
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=d1267da469d89c0a487095695fcfe59dce2e2a7c
Submitter: Zuul
Branch: master

commit d1267da469d89c0a487095695fcfe59dce2e2a7c
Author: Jeremy Moffitt <email address hidden>
Date: Mon May 1 12:28:17 2017 -0700

    Prevent "enter" from triggering submit action on modal forms

    testable in particular on the containers page, where
    the problem was that pressing enter with no container
    name would submit the form despite being invalid.

    initially tried a more complicated function wrapper
    that allowed panels to prevent submit on enter, but
    that was overly complicated and only fixed the problem
    for panels that are pro-actively changed.

    second attempt at fixing the problem was to change
    the wrapping element from "form" to "div", which
    solved the original problem, but caused a new issue
    in that divs aren't validated, so the submit button
    was always enabled (since the div was never $invalid)

    this fix explicitly checks whether the form is valid
    when a submit action occurs, and if it is will
    call the uibmodal close action that is what normally
    happens when "submit" is pressed. if the form is
    invalid, nothing happens.

    Change-Id: I5071d78b08201436e50c704fdc20b6e4a19aee49
    Closes-Bug: 1655487

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 13.0.0.0b2

This issue was fixed in the openstack/horizon 13.0.0.0b2 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.