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

Console error in the CMS #173

Open
silverstripe-elliot opened this issue Jan 18, 2018 · 5 comments
Open

Console error in the CMS #173

silverstripe-elliot opened this issue Jan 18, 2018 · 5 comments

Comments

@silverstripe-elliot
Copy link

When I install the module with 2.x-dev , I get the following error when I add a new action: Uncaught Error: cannot call methods on button prior to initialization; attempted to call method 'destroy'. The buttons appear (without styling) on the initial load, but when I refresh the CMS it will get stuck on the "Loading" screen.

If I comment out this line the console error is removed. I'm not sure what the implications of removing this line would be.

@3Dgoo
Copy link
Contributor

3Dgoo commented Feb 21, 2018

I'm also having this issue. This error breaks viewing versioned dataobjects in the CMS for me.

@groundnation
Copy link

groundnation commented Feb 21, 2018

Me too - exact same problem as silverstripe-elliot

pixelsnap 2018-03-01 at 09 08 57

@shaunjc
Copy link

shaunjc commented Mar 1, 2018

I'm also experiencing the same issue.

Commenting out the line suggested by silverstripe-elliot prevents the console error, as well as allows those pages to load when refreshed, but all the buttons are still styled incorrectly. I've since wrapped it in a try statement, but to no avail.

EDIT

I've since confirmed that DataObjects with the Extension Versioned and multiple stages are the only ones that seem affected. Those with just versioning appear to work fine for now.

private static $extensions = [
    Versioned::class . '.versioned', // Standard buttons shown - no apparent rollback functionality.
    Versioned::class,                // Buttons do not display correctly and issues publishing.
];

I'm unsure if my changes to the JS file are helping or not, but I've noticed the following click events:

  • Clicking anywhere on the screen will cause the buttons to update and appear less broken.
  • Clicking the bar next to the two buttons will cause the button styling to appear completely broken again (as it opens up the dropdown list).
  • Clicking the first button / 'Save Draft' / 'Saved' will work as expected.
  • Clicking the second button / 'Save and Publish' / 'Published' will attempt to load /SilverStripe/Forms/FormRequestHandler instead which throws a 404 error, although the items will appear to publish.
  • Clicking 'New Record' at the top appears to do nothing.

@danaenz
Copy link

danaenz commented Mar 5, 2018

Can confirm I'm having the same issues @shaunjc is experiencing, though I extended as so:

private static $extensions = [
    Versioned::class . '("Stage","Live")'
];

@shaunjc
Copy link

shaunjc commented Mar 14, 2018

I found the issue with the page redirecting to /SilverStripe/Forms/FormRequestHandler when you click publish. Created new Issue: #174 with description why and suggested fixes.

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

No branches or pull requests

5 participants