Skip to content
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

Don't x_node_set on a tree which doesn't exist #1657

Merged
merged 1 commit into from
Jul 6, 2017
Merged

Don't x_node_set on a tree which doesn't exist #1657

merged 1 commit into from
Jul 6, 2017

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Jul 6, 2017

Calling x_node_set when a tree doesn't exist works, but actually creates the entry that tree_exists? checks to see if such a tree exists.

When the user doesn't have the right to see such a tree, that's problematic, since it breaks the assumption that tree_exists? returns true only for trees that were actually initialized.

That leads to calling lock_tree on a nonexistent tree, leading to a JS exceptions ("No element has been found").

This makes us actually check if the tree already exists before calling x_node_set on it - specifically for roles_tree (that's TreeBuilderReportRoles).

(I would prefer to fix x_node_set instead, but.. this is a bugfix, and I really don't want to introduce more bugs. :))

https://bugzilla.redhat.com/show_bug.cgi?id=1467146

EDIT: also fixes https://bugzilla.redhat.com/show_bug.cgi?id=1448332

Calling `x_node_set` when a tree doesn't exist works, but actually creates the entry that `tree_exists?` checks to see if such a tree exists.

When the user doesn't have the right to see such a tree, that's problematic, since it breaks the assumption that `tree_exists?` returns true only for trees that were actually initialized.

The leads to the calling `lock_tree` on a nonexistent tree, leading to a JS exceptions ("No element has been found").

This makes us actually check if the tree already exists before calling `x_node_set` on it.

(Would prefer to fix `x_node_set` instead, but.. this is a bugfix, and I really don't want to introduce more bugs. :))

https://bugzilla.redhat.com/show_bug.cgi?id=1467146
@miq-bot
Copy link
Member

miq-bot commented Jul 6, 2017

Checked commit https://github.com/himdel/manageiq-ui-classic/commit/5d36640dacc79b2aa3ac3978ddc34de37d74575c with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks fine. 👍

@h-kataria h-kataria added this to the Sprint 64 Ending Jul 10, 2017 milestone Jul 6, 2017
@h-kataria
Copy link
Contributor

looks good.

@h-kataria h-kataria merged commit 63093bc into ManageIQ:master Jul 6, 2017
@himdel himdel deleted the bz1467146 branch July 6, 2017 16:24
@chrispy1
Copy link

chrispy1 commented Jul 6, 2017

@miq-bot add_label blocker

@miq-bot miq-bot added the blocker label Jul 6, 2017
simaishi pushed a commit that referenced this pull request Jul 6, 2017
@simaishi
Copy link
Contributor

simaishi commented Jul 6, 2017

Fine backport details:

$ git log -1
commit 83d9a5ea3adc76137edc04a0c6a55ac135a32ac2
Author: Harpreet Kataria <[email protected]>
Date:   Thu Jul 6 12:24:02 2017 -0400

    Merge pull request #1657 from himdel/bz1467146
    
    Don't x_node_set on a tree which doesn't exist
    (cherry picked from commit 63093bc1e1d7843476c32bf45768be235942a2c4)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1468336
    https://bugzilla.redhat.com/show_bug.cgi?id=1468337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants