[Solved] Problems in 8.2.1 with CKEditor Snippets?

Permalink 1 user found helpful
Hi @all,

I am currently working on the topic Snippets in the CKEditor.

For this, there were several examples in the tutorials and with GitHub how it should work.
I tried the tutorials and the examples of GitHub all in a blank installation of concrete5 version 8.2.1.

https://github.com/MrKarlDilkington/editor_snippet...
https://documentation.concrete5.org/tutorials/how-to-create-rich-tex...

Everything with the same result: It does not work. The Snippets button does not appear in the menu bar. I have activated all toolbars in the backend settings, too.But nothing is displayed.

Is there a known problem / bug? Or are the examples outdated / not suitable for version 8.2.1?

Thank you for your assistance.

Best regards
LennDa

1 Attachment

LennDa
 
mnakalay replied on at Permalink Reply
mnakalay
Did you try to install the example from github directly? If yes, what was the result?
mnakalay replied on at Permalink Best Answer Reply
mnakalay
Actually, I have an answer to your question: it is a C5 bug.

Here's how to fix it:
Look for the file concrete\js\ckeditor4\core\concrete5styles\plugin.js

at line 106you will see the setting 'async': false commented out.

There is even some text the devs left there wondering if it was going to have an impact. Well yes it does, that setting needs to be put back in so the snippets show up in the editor.
MrKDilkington replied on at Permalink Reply
MrKDilkington
@mnakalay

Nice catch, it looks like the code was changed here:
https://github.com/concrete5/concrete5/commit/86b8ff7fede5e5d8002227...

I am unsure about how to proceed with updating the tutorial. Since it would require a core file to be modified. I am not sure if the file can be overridden.
mnakalay replied on at Permalink Reply
mnakalay
@MrKDilkington I just pushed a pull requesthttps://github.com/concrete5/concrete5/pull/5897...

There's really no need for an Ajax call in this situation so I got rid of it. Now snippets are called directly from PHP and the editor loads faster.

And don't worry about your tutorial, you don't need to change it. What you explained in it is still the way to go, you can't include a hack to go around a core bug.

And when/if they accept my pull request, it will solve the problem and your tutorial will still be valid
LennDa replied on at Permalink Reply
LennDa
@mnakalay:
many thanks for the quick reply and the pull-requsest.
I change this manually and wait for the response from the core team

Greetings
LennDa
mnakalay replied on at Permalink Reply
mnakalay
You're welcome