Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

CMS Plugin cancel button is destructive in Admin. #1124

Closed
kezabelle opened this Issue · 2 comments

3 participants

@kezabelle

Steps to reproduce

  • Create a page in the Django admin.
  • Add a plugin - say, a link - to a placeholder.
  • Save it, then re-open it for editing.
  • modify some portion of the saved data, and hit cancel.

Expectation

The changes you've made should be canceled, and the the plugin editor should probably disappear.

Current result

It's a submit button, so it triggers full validation, and if successful, saves whatever you've cancelled back to the database.

Additional notes

Works fine in the frontend-editing, as some JavaScript is responsible for destroying the plugin window. This ought to be ported to the admin (if possible, in such a way as the plugin editor iframe itself can deal with it, which ought to ensure it works in both FE & BE admin). Possibly also should have the plugin save method test whether _cancel was clicked, in case there's a javascript error?

I think the the comment from @calinf on October 28, 2011, in ticket #861 may be piggybacking that issue to describe this issue, and proposes a potential fix (which, FWIW, I don't like, as it's a different intention), but that ticket is tagged for 2.3, and I think given it's a potentially destructive feature in 2.2.0/develop, it ought to be pushed to 2.2.1. For our purposes, we've hidden the cancel button entirely in the admin, to side-step it.

Final note: the buttons are in different positions in the frontend vs backend. Minor niggle.

@kezabelle

Addendum: It'd be nice if the cancel input had an ID or class, too so it can be easily targeted via CSS. At the moment, to hide it, I've got something like (LESS):

.plugin-submit-row {
    input {
        display: none;
        &.default {
            display: block;
        }
    }
}

which nets me:

.plugin-submit-row input{display:none;}
.plugin-submit-row input.default{display:block;}

which just hides the cancel button altogether.

@andrewschoen andrewschoen referenced this issue from a commit in andrewschoen/django-cms
@andrewschoen andrewschoen fixes issue #1124 - now integration branch is develop-2.2.1 5a8ebd5
@stefanfoulis stefanfoulis was assigned
@evildmp evildmp was assigned
@evildmp
Owner

This issue has been addressed with #1251; if #1251 is OK, then this is closed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.