Skip to content

Edit HTML Source not Saving HTML #45

@prazvan

Description

@prazvan

Hey,

So i found a weird bug when using the module with HTML Edit source.

Lets say that after you add a shortcode from the module our you want to add it manually when editing the html source, when you try to save the page as draft or published the content won't be save.

After a bit of debugging found a solution

in the shortcodable.js file

under the onbeforesubmitform callback i found out the the Editor save method wasn't called at all.

            /**
             * Make sure the editor has flushed all it's buffers before the form is submitted.
             */
            'from .cms-edit-form': {
                onbeforesubmitform: function(e) {
                    var shortcodable = tinyMCE.activeEditor.plugins.shortcodable;
                    var ed = this.getEditor();
                    var newContent = shortcodable.replacePlaceholdersWithShortcodes($(this).val(), ed);
                    $(this).val(newContent);

                    // save html - FIX
                    ed.save();

                }
            },

Thanks,
Razvan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions