symfony2admingenerator / AvocodeFormExtensionsBundle

(old-legacy) Symfony2 form extensions for Admingenerator project (also working standalone!)
Other
48 stars 31 forks source link

Problem with CKEDITOR on sortable collection #72

Closed montabou closed 10 years ago

montabou commented 10 years ago

CKEDITOR is used in https://github.com/avocode/FormExtensions/blob/master/Resources/public/bootstrap-collection/js/bootstrap-collection.js but is defined nowhere in the bundle. When sortable is on, it leads to 'ReferenceError: CKEDITOR is not defined' when I try to drag an element that contains a textarea.

I don't know exactly why CKEDITOR is defined here so I don't know exactly how this error should be corrected (removing all CKEDITOR information or simply add test in javascript code in order not to throw an error ?)

Is it possible to have more info about that ?

ioleo commented 10 years ago

@montabou Thats obsiously my error. I should wrap that code in an if statement checking first if CKEDITOR is defined.

ioleo commented 10 years ago

@montabou Answering your other question: why is this code there (while there is no CKEDITOR type in the bundle)? The answer is very simple. There is a very nice trsteel88/TrsteelCkeditorBundle bundle for CKEDITOR that is compatible with this bundle (so no need to add CKEDITORType to this bundle). However, when sorting CKEDITOR instances, they were freezing. This code fixes that -> destroying CKEDITOR instance when sorting, and reinitializing it after the sorting is complete.

montabou commented 10 years ago

Thanks it works great !

For now, I don't need extra with textarea but I will see https://github.com/trsteel88/TrsteelCkeditorBundle Thanks again