CKEditor throws error after adding Notification Plugin - javascript

I am attempting to add the notification plugin to CKEditor and I receive the following error when I go on any page implementing the CKEditor regardless if it attempts to use the Notification Plugin or not
Uncaught TypeError: CKEDITOR.tools.eventsBuffer is not a function
at Area (plugin.js?t=D2LI:448)
at Object.init (plugin.js?t=D2LI:17)
at Object.<anonymous> (ckeditor.js:221)
at n (ckeditor.js:202)
at Array.m (ckeditor.js:202)
at o (ckeditor.js:202)
at ckeditor.js:203
I am clearly including the plugin since I am getting these errors.
this is the line of code in the plugin that is causing the error.
this._uiBuffer = CKEDITOR.tools.eventsBuffer( 10, this._layout, this );
Any help is appreciated.

Please see: https://docs.ckeditor.com/#!/api/CKEDITOR.tools-method-eventsBuffer.
The error means that tools object doesn't have eventsBuffer method. There are two explanations which come to my mind:
This method is available since CKEditor 4.2.1. Please check your ckeditor/CHANGES.md file (your version is at the top) to find out which editor version you use. If your editor is anything below 4.2.1, please upgrade it to latest version. Please also note that if you want to use notifications you need to use at least CKEditor 4.5 - https://docs.ckeditor.com/#!/api/CKEDITOR.plugins.notification so upgrading to 4.2.1 won't help in this case.
This is a long shot but another possibility is that you have a third-party script which conflicts with CKEditor thus you get such result. If your editor is up to date, please try disabling other scripts, clearing browser's cache according to this link and checking the result one more time.
NOTE: To find out your version you can also click question mark icon on the toolbar (it is available if you have About plugin installed).

Related

Cannot read property 'querySelector' of null - WordPress / Contact Form 7

Seem to be getting an error on our contact forms on version 5.4.1 and the version before using the Contact Form 7 plugin on WordPress. The error occurs when submitting the form regardless of entering information or not. The error which appears in console is as follows:
TypeError: Cannot read property 'querySelector' of null
at c (index.js?ver=5.4.1:1)
at Array.forEach (<anonymous>)
at index.js?ver=5.4.1:1
Read a couple of articles about rolling back to version 5.3.2 which I can confirm works and the issue isn't present in this version. Does anyone have a fix for it though? Or do we need to wait for another update? It's been a couple of weeks now since this was first found I believe.
If anyone needs any other information please let me know and I'll try to supply it.
Thanks!
You can edit
define( ‘WPCF7_LOAD_JS’, true );
to
define( ‘WPCF7_LOAD_JS’, false );
on wp-contact-form-7.php file.
This is due to a incompatability between your theme or a plugin with the new version of jquery used in wordpress. There are a few things you can do.
Update your theme and plugins and hope the JavaScript is patched by the author
Try to patch the broken code your self (this requires knowledge of javascript)
Install jQueryMigrate Plugin (this is only a Band-Aid and should not be the permanent solution)

autoComplete.js Uncaught (in promise) undefined and can't select autocomplete result on IE 11

I'm using the autoComplete.Js library for my project. But I need it to work on IE11.
I added the missing polyfills to make it work properly but I still get an issue.
Autocomplete results should disappear by clicking on it and fill in the input with the selected result (classic autocomplete behavior).
On IE11, clicking on a result doesn't do anything.
The library provides a way to handle "selection"
onSelection: feedback => { // Action script onSelection event | (Optional)
console.log(feedback.selection.value.image_url);
}
I use it the same way but I got a console error on IE11:
Uncaught (in promise) undefined
I tried to comment the onSelection part, I don't get the error but still can't select any result.
Is there any workaround I'm missing ?
Check the package browser support:
https://tarekraafat.github.io/autoComplete.js/#/?id=_4-browsers-support
They do not claim to support IE11. Try different library or ask them for support. maybe they know a way to solve it

Disable deprecation in javascript console

I'm using a library from another person but it's probably pretty old and, even though it works just fine, I get a DEP066 deprecation error in my console when I run it.
I'm a COMPLETE noob when talking about javascript so I need your help. Is there a way to disable the deprecation warning/fix it if I use a newer function ?
EDIT:
Thank you so much! It works with the --no-deprecation option.
Try running the the script using the the --no-deprecation parameter which will "silence deprecation warnings":
node --no-deprecation script
Alternatively, --no-warnings will "silence all process warnings (including deprecations)."

file is being assigned a //# sourceMappingURL but already has one

I just notice Firefox console outputs the following error for every single .js/.coffee file in my project (even the packages).
-file- is being assigned a //# sourceMappingURL, but already has one
Chrome's console doesn't show anything. I tried deleting all the .map files and clearing Firefox's cache but I'm still getting the errors.
It's a warning (not an error)
and it is a bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1020846 fixed in FF 33)
This warning/error also applies to other libs (angular, backbone, etc.)
I have been working on a project for over a year now, I have never seen this message until roughly the last Firefox update.
I received it using jQuery 1.9.x, so I just updated my jQuery to 1.11.x and the error went away. I am now happy.
So, if you are using jQuery and see this Error/Warning, try updating your jQuery to the latest version.
Hope this helps someone.
In Firefox 27.0.1 I was getting this exact same error. I already have jQuery 1.11.0.
SyntaxError: Using //# to indicate sourceMappingURL pragmas is deprecated.
Use //# instead kendo.dataviz.min.js:25
22:09:26.635 Error: http://localhost/project/Scripts/kendo.dataviz.min.js is being assigned a //# sourceMappingURL, but already has one
I opened the kendo.dataviz.min.js and deleted the offending line:
//# sourceMappingURL=kendo.dataviz.min.js.map
put your code inside
$( document ).ready(function() {
//whatever
});
then the message dissappears.
For the people using Visual Studio 2013, and have downloaded the jQuery libraries via NuGet, check your jquery-x.x.x.min.js and you'll find the text comment below that's popping this warning on Firefox.
// # sourceMappingURL=jquery-x.x.x.min.map
You can safely remove those lines.
Update jquery - from the jQuery website http://www.jquery.com/download
You can also download a sourcemap file for use when debugging with a compressed file. The map file is not required for users to run jQuery, it just improves the developer's debugger experience. As of jQuery 1.11.0/2.1.0 the //# sourceMappingURL comment is not included in the compressed file.

sitefinity 6 - events module error javascript

I've upgraded a website from 4.4 to 6.0 and found some issues. Some I already solved but I keep getting one error (javascript I suppose) on events module. When I try to preview/create new/publish/save draft I get the following js error:
TypeError: startDate is null
Unable to get property 'getFullYear' of undefined or null reference
Telerik.Web.UI.WebResource.axd, line 329 character 1
var range=this.get_rangeView().getRange();
var time=this.get_timeView().getRange();
var startDateTime=new Date(time.get_start());
var endDateTime=new Date(time.get_start());
var startDate=range.get_start();
var endDate=range.get_recursUntil();
startDateTime.setFullYear(startDate.getFullYear(),startDate.getMonth(),startDate.getDate());
I reckon that this is dynamically created by Telerik sitefinity and I'm not sure how to fix it. I went to the administration area and checked the relevant configurations and it seems to be everything ok (similar configs as sitefinity 4.4).
Does anyone have an idea how to solve this? I've tried to post a sitefinity forum thread on their website but they took way to much time to answer.
Cheers
by any chance were you using external templates or a custom widget to show the events?
Sitefinity 6.0 apparently rebuilt the events module and it is no longer a simple, flat type. Instead it is a nested (hierarchical) type, with a parent calendar to which events are added (or multiple calendars if you need them).
So if you did any custom code or external template to display the content (in other words anything not out of the box that auto-upgraded itself when you updated to 6.0) you may need to rebuild this custom component to use the latest changes.
Consult the upgrade guide to 6.0 for latest breaking changes that one had the most differences, then compare your custom templates (if any) to the widget templates in the SDK: http://selarom.net/blog/2012/11/06/mapping-sitefinity-templates-from-the-sdk
I hope this is helpful!

Categories

Resources