AngularJS code is evaluated twice after modal form submission

Bug #1371116 reported by Kamil Rykowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Kamil Rykowski

Bug Description

When we send a form which is placed inside a modal box the proper AJAX request is made. If it succeed and no redirection is going to be made and if the returned HTML response contains any angular syntax it will be evaluated twice. It means f.e. that every controller used inside returned response will be initialized twice which leads to serious problems in angular logic.

Steps to reproduce the issue:

1. Open Horizon
2. Go to the Admin > System > Images page.
3. Pick any image without "architecture" property you like and in "Actions" menu click at "Update Metadata" position.
4. At the left side put "architecture" in input labeled as "Other" and click at "+" button.
5. At the right side put value "x86" in the input labeled as "architecture" and click "Save" at the bottom of the modal.

Tags: metadef
tags: added: metadef
Revision history for this message
Kamil Rykowski (kamil-rykowski) wrote :
description: updated
Changed in horizon:
assignee: nobody → Kamil Rykowski (kamil-rykowski)
status: New → In Progress
Revision history for this message
Kamil Rykowski (kamil-rykowski) wrote :

Fix proposed to branch: master

Review: https://review.openstack.org/#/c/123121/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/123121
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=31cdbe0981819c52e86764270e7ca66a48522049
Submitter: Jenkins
Branch: master

commit 31cdbe0981819c52e86764270e7ca66a48522049
Author: Kamil Rykowski <email address hidden>
Date: Mon Sep 22 14:41:34 2014 +0200

    Fixes double evaluation of AngularJS in modal box

    AngularJS syntax is evaluated twice in modal box after submitting form
    which succeed and no redirection is going to be made. This commit fixes
    this bevahiour by executing AngularJS code just after modal is created
    and not every time it is going to be shown.

    Change-Id: I204fce23ce52f74c38b7dc40ef03c6d5710ad254
    Closes-Bug: #1371116

Changed in horizon:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in horizon:
milestone: none → juno-rc1
importance: Undecided → High
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: juno-rc1 → 2014.2
Revision history for this message
saisantosh technologies (raju64522) wrote :

This is my first time visit on your site and i have bookmark this for again visit. thanks a lot of for share a appreciable post ..
<a href="http://hadooptraininginhyderabad.co.in/angularjs-training-in-hyderabad/">Angularjs Training In Hyderabad</a>

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.