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

Cannot read properties of undefined (reading 'onDidPaste') #215

Closed
jcdarwin opened this issue May 4, 2024 · 2 comments
Closed

Cannot read properties of undefined (reading 'onDidPaste') #215

jcdarwin opened this issue May 4, 2024 · 2 comments
Labels

Comments

@jcdarwin
Copy link

jcdarwin commented May 4, 2024

Description

After upgrading craftcms/ckeditor (3.0.0 => 3.8.3), I find that when I visit the settings page (either for an existing configuration, or for a new configuration), I don't see any toolbar items either in the top area (i.e. under "Drag toolbar items into the editor") or bottom area (the toolbar).

I notice that there is an error in the dev tools console:

jquery.js?v=1714800000:2 jQuery.Deferred exception: Cannot read properties of undefined (reading 'onDidPaste') TypeError: Cannot read properties of undefined (reading 'onDidPaste')
    at s.constructor.init (https://localhost.chinacapable.org.nz/cpresources/b22f9e9e/ckeconfig.js?v=1713667100:2:4289)
    at s.constructor.constructor (https://localhost.chinacapable.org.nz/cpresources/e6dedc42/garnish.js?v=1714800000:2:2989)
    at s.constructor (https://localhost.chinacapable.org.nz/cpresources/e6dedc42/garnish.js?v=1714800000:2:1243)
    at new s.constructor (https://localhost.chinacapable.org.nz/cpresources/e6dedc42/garnish.js?v=1714800000:2:1243)
    at HTMLDocument.<anonymous> (https://localhost.chinacapable.org.nz/manage/settings/ckeditor/new:803:23)
    at l (https://localhost.chinacapable.org.nz/cpresources/5a4f71eb/jquery.js?v=1714800000:2:30361)
    at c (https://localhost.chinacapable.org.nz/cpresources/5a4f71eb/jquery.js?v=1714800000:2:30663) undefined

jquery.js?v=1714800000:2 Uncaught TypeError: Cannot read properties of undefined (reading 'onDidPaste')
    at s.constructor.init (ConfigOptions.js:93:21)
    at s.constructor.constructor (Base.js:20:15)
    at s.constructor (Base.js:32:21)
    at new s.constructor (Base.js:32:21)
    at HTMLDocument.<anonymous> (new:803:23)
    at l (jquery.js?v=1714800000:2:30361)
    at c (jquery.js?v=1714800000:2:30663)

I can confirm that this error did not appear in the devtools console in the previously-installed version (3.0.0)

However, the toolbar in a ckeditor field in an entry looks OK.

Steps to reproduce

  1. Upgrade to 3.8.3
  2. Visit /admin/settings/ckeditor/new
  3. See that there is no toolbar / toolbar icons showing, and the error mentioned above appears in the devtools console.

Additional info

  • Craft version: 4.9.1
  • PHP version: 8.2.10
  • Database driver & version: MariaDB 10.6.12
  • Plugins & versions:
    Asset Rev 7.0.0
    CKEditor 3.8.3
    Contact Form 3.1.0
    Content Security Policy 2.1.1
    Control Panel CSS 2.6.0
    Cookies 4.0.1
    Craft JWT Authorization 2.0.1
    Digital Download 2.3.1
    Dumper 5.0.1
    Element API 4.1.0
    Embedder 3.0.0
    EntityDecode 3.0.0
    Enupal Backup 2.2.0
    Enupal Snapshot 2.0.2
    Event Helper 2.1.0
    Feedback Form 2.0.1
    Feed Me 5.4.0
    Freeform 5.1.17
    Google reCAPTCHA 2.3.0
    Help 5.0.0
    Image Resizer 3.0.11
    Mailgun 3.1.0
    Password Policy 4.1.0
    Plain ICS dev-craft4
    Preparse Field 2.0.2
    Registration Helper 2.9.1
    Remote Backup 4.1.6
    Resources Helper 2.0.2
    Retcon 2.7.5
    Sentry SDK 2.0.1
    Sherlock 4.4.2
    State Helper 2.0.1
    Tag Manager 2.0.1
    Twig Perversion 3.0.0
    Two-Factor Authentication 3.3.7
    Wordsmith 4.4.0
@jcdarwin jcdarwin added the bug label May 4, 2024
@i-just
Copy link
Contributor

i-just commented May 8, 2024

Hi, thanks for reaching out! I can replicate this problem, but the error I see is different. For me, the issue was resolved after I cleared the “Compiled templates” cache. Could you please try that and let me know if it solved the problem? (You can clear the caches via Control Panel > Utilities > Caches or via the command line.)

@jcdarwin
Copy link
Author

Thanks @i-just -- that worked perfectly -- closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants