JCE Editor Problem With SP Page Builder. - Question | JoomShaper

JCE Editor Problem With SP Page Builder.

A

AMurray2017

SP Page Builder 2 years ago

Hi,

I am not sure if this is directly an SP Page builder problem or a JCE problem and therefore am also posting the same problem on JCE's (joomlacontenteditor.net) support forum.

I'm having a problem when using SP Page Builder 3.7.12 Pro, a fresh install Joomla 4.0 (Stable) and fresh install Helix Ultimate 2.0 (stable) with JCE Pro 2.9.11 as the site default editor set in Global Configuration.

I receive this error, when opening SP Page Builder pages: Call to undefined method Joomla\CMS\Document\HtmlDocument::addScriptVersion()

If I change the default editor back to TinyMCE, SPPB will work as normal and I don't have any issue editing or opening pages.

The site is currently on my local PC (Wampserver) so cannot provide live link.

Thank you.

0
5 Answers
Toufiq
Toufiq
Accepted Answer
Senior Staff 2 years ago #28862

Hi there,

Thanks for contacting us. Sorry for the inconvenience. Please hold on the JCE compatible. This is not our end. Have to wait for JCE update for Page Builder compatible.

-Thanks

0
A
AMurray2017
Accepted Answer
2 years ago #28908

Thank you I though it was their side. I have posted to their forum also.

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 2 years ago #28913

Sure

0
R
Ryan
Accepted Answer
2 years ago #29115

I have been made aware of this issue and I have located the cause of the PHP error. A beta with the fix will be released this coming week.

However, a further complication has arisen, perhaps due to the inclusion of Tinymce 5 in Joomla 4. SP PageBuilder appears to load both Tinymce and JCE on the same page. This causes a conflict between the 2 versions of Tinymce (the core version and the one used by JCE) that causes errors when editing SP Page Builder content with JCE.

The only solution I can see is to not load the core Tinymce editor if JCE is the selected Joomla editor. This can be done by editing administrator/components/com_sppagebuilder/helpers/sppagebuilder.php and adding a condition for loading the editor, eg:

$editor  = $conf->get('editor');

        if ($editor == 'tinymce') {
            if(JVERSION < 4)
            {
                $doc->addScript(Uri::root(true) . '/media/editors/tinymce/tinymce.min.js');
                $doc->addScriptdeclaration('var tinyTheme="modern";');
            }
            else
            {
                $wa = $doc->getWebAssetManager();

                if (!$wa->assetExists('script', 'tinymce'))
                {
                    $wa->registerScript('tinymce', 'media/vendor/tinymce/tinymce.min.js', [], ['defer' => true]);
                }

                if (!$wa->assetExists('script', 'plg_editors_tinymce'))
                {
                    $wa->registerScript('plg_editors_tinymce', 'plg_editors_tinymce/tinymce.min.js', [], ['defer' => true], ['core', 'tinymce']);
                }

                $wa->useScript('tinymce')
                    ->useScript('plg_editors_tinymce');

                $doc->addScriptdeclaration('var tinyTheme="silver";');
                $doc->addStyledeclaration('.tox-tinymce-aux {z-index: 130012 !important;}');
            }
        }

        // JCE Editor
        if ($editor == 'jce') {
            require_once(JPATH_ADMINISTRATOR . '/components/com_jce/includes/base.php');
            wfimport('admin.models.editor');
            $editor = new WFModelEditor();

            $settings = $editor->getEditorSettings();

            $app->triggerEvent('onBeforeWfEditorRender', array(&$settings));
            echo $editor->render($settings);
        }

Please pass this on to the SP PageBuilder developers. They can contact me using the email address in my profile. I have made as many changes as I can to address this problem in JCE, but cannot see another solution without the code change above.

Thank you

Ryan Demmer JCE Developer

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 2 years ago #29166

Thanks for your explanation. I will share the forum posts with our developer team. Thanks

0