Forum

Thread tagged as: Problem, Error, CKEditor

Perch 3 - Ckeditor not loading for blocks

I'm having an issue with text areas that use the ckeditor and are included in a block region. I believe this is only happening when there are more than 1 ckeditor in the block. When I add the block to the blocks region, the editors are not instantiated, instead i just get a native textarea with no editor.

What i need to do is to save the page. When the page saves, even if the content is blank, the editors load properly. it seems its only happens when they're added to the page via JS.

This is not a random 1 off thing. it happens every single time without question. I sometime (rarely) get a JS error popup in the Console, but it will still happen silently.

I have included the simplest template example I have that produces the error, although every block template with multiple ckeditors does it.

Any Ideas?

Block Template:

<perch:content id="heading_en" label="Heading English" type="text" suppress="true" />
<perch:content id="heading_fr" label="Heading French" type="text" suppress="true" />
<perch:content id="background_image" type="image" bucket="side_bar_box" label="Heading Side Image" suppress="true" />
<perch:content id="paragraph_en" label="Paragraph English" type="textarea" html="true" editor="ckeditor" suppress="true" bucket="editor" size="m" />
<perch:content id="paragraph_fr" label="Paragraph French" type="textarea" html="true" editor="ckeditor" suppress="true" bucket="editor" size="m" />
<div class="sidebar-box header-text-box" >
<h4 style="background-image:url('<perch:content id="background_image" />')"><perch:if id="lang" match="eq" value="en"><perch:content id="heading_en"/><perch:else /><perch:content id="heading_fr"/></perch:if></h4>
<perch:if id="lang" match="eq" value="en">
    <perch:content id="paragraph_en" html="true" />
<perch:else />
    <perch:content id="paragraph_fr" html="true" />
</perch:if>

</div>

Diagnostics:

Perch: 3.0.2
Production mode: Production (100)
Installed apps: content (3.0.2), assets (3.0.2), categories (3.0.2), swjb_cache_management (1), perch_forms (1.9)
DB driver: PDO
DB tables: cms_categories (0), cms_category_counts (0), cms_category_sets (0), cms_content_index (7351), cms_content_items (1030), cms_content_regions (261), cms_forms (2), cms_forms_responses (2), cms_menu_items (10), cms_navigation (8), cms_navigation_pages (92), cms_page_templates (11), cms_pages (55), cms_resource_log (2426), cms_resource_tags (2), cms_resources (332), cms_resources_to_tags (4), cms_settings (20), cms_swjb_multilingual_search_index (208), cms_user_passwords (1), cms_user_privileges (30), cms_user_role_privileges (16), cms_user_roles (2), cms_users (1)
Users: 1
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'swjb_multilingual',
        'swjb_cache_management',
        'perch_forms'
    );
Editor plug-ins: ckeditor
H1: 375ae31f6bf1d17063b268aa81a0de83
L1: 06cfc7c9f0828dd0b74b50cad4e75ad8
F1: cd0cc3355d25bf0fad2ce64954fd9215
headerColour: #10335d
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.8.34: done
latest_version: 2.8.15
on_sale_version: 2.8.34
headerScheme: dark
content_hideNonEditableRegions: 1
dashboard: 0
hide_pwd_reset: 0
content_frontend_edit: 0
logoPath: /cms/resources/intro-logo-dark.png
update_3.0: done
update_3.0.1: done
update_3.0.2: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME:
PERCH_DB_SERVER:
PERCH_DB_DATABASE:
PERCH_DB_PREFIX: cms_
PERCH_EMAIL_FROM:
PERCH_EMAIL_FROM_NAME: 
PERCH_LOGINPATH: /cms
PERCH_PATH: /data/sites/default/www/public_html/cms
PERCH_CORE: /data/sites/default/www/public_html/cms/core
PERCH_RESFILEPATH: /data/sites/default/www/public_html/cms/resources
PERCH_RESPATH: /cms/resources
PERCH_HTML5: 1
PERCH_TZ: UTC
PERCH_DEBUG:
PERCH_GMAPS_API_KEY: 
PERCH_RWD: 1
PERCH_SCHEDULE_SECRET:
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_ASSET_VERSION: ed79f7a54b300ef2b1e6
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /data/sites/default/www/public_html/cms/templates
PERCH_TEMPLATE_FILTERS:
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_XHTML_MARKUP:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_DEFAULT_BUCKET: default
PERCH_TRANSLATION_ASSIST:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_PRIV_ASSIST:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: markdown
Hosting settings

PHP: 7.1.4-1+deb.sury.org~zesty+1
Zend: 3.1.0
OS: Linux
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $
MySQL server: 5.7.17
Free disk space: 291.74 GB
Extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, apache2handler, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, igbinary, imap, intl, json, ldap, exif, mcrypt, msgpack, mysqli, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, shmop, SimpleXML, soap, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, memcached, xdebug, Zend OPcache
GD: Yes
ImageMagick: No
PHP max upload size: 2M
PHP max form post size: 8M
PHP memory limit: 128M
Total max uploadable file size: 2M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
TZ: America/Toronto
HTTP_HOST: dev..com:8082
HTTP_CONNECTION: keep-alive
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_REFERER: https://dev..com:8082/cms/core/settings/diagnostics/
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: en,fr;q=0.8,fr-CA;q=0.6,en-US;q=0.4,la;q=0.2
HTTP_COOKIE: 35974f2e7884306d750da34148d3c08a=03c7c0ace395d80182db07ae2c30f034; lang=en; __utma=265697562.780282083.1494722315.1494722315.1494722315.1; __utmz=265697562.1494722315.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=150609456.1628908633.1494704191.1494704191.1494722280.2; __utmz=150609456.1494704191.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); PHPSESSID=7fhllt43egrjfq5ofc8sqb59gr; cmsa=1; l=fr
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SERVER_SIGNATURE: <address>Apache/2.4.25 (Ubuntu) Server at Port 8082</address>
SERVER_SOFTWARE: Apache/2.4.25 (Ubuntu)
SERVER_NAME: 
SERVER_ADDR: 172.19.0.3
SERVER_PORT: 8082
REMOTE_ADDR: 172.19.0.1
DOCUMENT_ROOT: /data/sites/default/www/public_html
REQUEST_SCHEME: http
CONTEXT_DOCUMENT_ROOT: /data/sites/default/www/public_html
SERVER_ADMIN: [no address given]
SCRIPT_FILENAME: /data/sites/default/www/public_html/cms/core/settings/diagnostics/index.php
REMOTE_PORT: 40590
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /cms/core/settings/diagnostics/?extended
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
PHP_SELF: /cms/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1494726772.373
REQUEST_TIME: 1494726772
ENVIRONMENT: DEV
PERCH_LICENSE_KEY: 
PERCH_DB_USERNAME:
PERCH_DB_PASSWORD:
PERCH_DB_SERVER:
PERCH_DB_DATABASE:
PERCH_DB_PREFIX: cms_
PERCH_DEBUG: false
PERCH_EMAIL_FROM:
PERCH_EMAIL_FROM_NAME: 
CACHE_ENABLED: 1
CACHE_FORCE_ENGINE: file
MEMCACHED_HOST: memcache
MEMCACHED_PORT: 11211
FILE_CACHE_DIR: /temp/cache
Jordin Brown

Jordin Brown 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is it still happening with the current version?

Yes it is

Rachel Andrew

Rachel Andrew 394 points
Perch Support

What does the error in the console say?

Drew McLellan

Drew McLellan 2638 points
Perch Support

What is the JS error you get?

That's the thing it pops the error sporadically. And I haven't been able to get it for a bout a week now.

But it was

Uncaught Error: Dropzone already attached. at new t (9.9.c4c70b8….js:1) at HTMLDivElement.<anonymous> (9.9.c4c70b8….js:2) at Function.each (vendor.c4c70b8….js:2) at me.fn.init.each (vendor.c4c70b8….js:2) at me.fn.init.undefined.e.fn.dropzone (9.9.c4c70b8….js:2) at HTMLDivElement.<anonymous> (9.9.c4c70b8….js:1) at Function.each (vendor.c4c70b8….js:2) at me.fn.init.each (vendor.c4c70b8….js:2) at p (9.9.c4c70b8….js:1) at 9.9.c4c70b8….js:1 t @ 9.9.c4c70b8….js:1 (anonymous) @ 9.9.c4c70b8….js:2 each @ vendor.c4c70b8….js:2 each @ vendor.c4c70b8….js:2 undefined.e.fn.dropzone @ 9.9.c4c70b8….js:2 (anonymous) @ 9.9.c4c70b8….js:1 each @ vendor.c4c70b8….js:2 each @ vendor.c4c70b8….js:2 p @ 9.9.c4c70b8….js:1 (anonymous) @ 9.9.c4c70b8….js:1 dispatch @ vendor.c4c70b8….js:3 v.handle @ vendor.c4c70b8….js:3 trigger @ vendor.c4c70b8….js:4 (anonymous) @ vendor.c4c70b8….js:4 each @ vendor.c4c70b8….js:2 each @ vendor.c4c70b8….js:2 trigger @ vendor.c4c70b8….js:4 success @ 12.12.c4c70b8….js:1 u @ vendor.c4c70b8….js:3 fireWith @ vendor.c4c70b8….js:3 n @ vendor.c4c70b8….js:4 (anonymous) @ vendor.c4c70b8….js:4
Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think that error should be occurring on the current version.

I haven't been able to get the console error for a while, but the problem still persists, just silently. The ckeditors are not initializing and there is no je error. If you save the region, the editors are then initialized properly.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, I think that error is probably unrelated and is a red herring in this instance.

Yeah. It's why I didn't include it initially.

Hi Drew, I know you're a busy guy.. just wondering though if you've had any time to look into this?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I've not look at it yet, no.

having the same issue now when trying to use multiple blocks with ckeditor, only shows up for the first one.