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

Save and Continue doesn't work #4

Open
srsem opened this issue Sep 22, 2016 · 1 comment
Open

Save and Continue doesn't work #4

srsem opened this issue Sep 22, 2016 · 1 comment

Comments

@srsem
Copy link

srsem commented Sep 22, 2016

With refinery cms version 3, save and continue doesn't work. It is caused by a call to undeclared function visual_editor_update() from within submit_and_continue function in refinery/admin.js

` submit_and_continue = function(e, redirect_to) {
visual_editor_update(); <-- here

$('#continue_editing').val(true);
$('#flash').hide();

$('.fieldWithErrors').removeClass('fieldWithErrors').addClass('field');
$('#flash_container .errorExplanation').remove();
`

@AaronH
Copy link

AaronH commented May 3, 2017

This is a problem in the RefineryCMS admin.js, but can be fixed without branching or even overriding anything pretty easily. However, because Refinery doesn't automatically load any user facing JS in the admin views by default, you have to follow a few steps.

Add a file named editor_patch.js with the following content.
window.visual_editor_update = function(){}

Add (or modify) config/intializers/assets.rb with
Rails.application.config.assets.precompile += %w( editor_patch.js )

Uncomment (or modify) the following line config/initializers/core.rb as follows:
config.register_javascript "editor_patch"

And with that, everything should work.

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

2 participants