1

I'm using FeinCMS (https://github.com/feincms/feincms/) and django-ckeditor with file upload support (https://github.com/shaunsephton/django-ckeditor).

I create a FeinCMS content type for RichTextField:

class RichContent(models.Model):
    text = RichTextField(_('text'))

    class Meta:
        abstract = True
        verbose_name = _('Rich Text')
        verbose_name_plural =_('Rich Text')

    def render(self, **kwargs):
        context_instance = kwargs.get('context_instance')

        return render_to_string('content/page/rich_content.html', {
            'page': self,
        }, context_instance=context_instance)

But in Django admin, when i select 'Rich Text' and press 'Go', get this error in firebug console:

uncaught exception: [CKEDITOR.editor] The instance "id_richcontent_set-__prefix__-text" already exists.

And textarea in ckeditor do not editable.

animuson
  • 53,861
  • 28
  • 137
  • 147
ssbb
  • 1,965
  • 2
  • 14
  • 26

1 Answers1

2

This is what happens when you try to create a new editor by using an element (textarea) which has already been assigned a CKEditor instance. You can list active instances with your console by exploring the CKEDITOR.instances object.

I also believe this is the one which solves your problem: CKEditor instance already exists . You should better destroy the existing instance or detect it and avoid replacing its DOM element.

Community
  • 1
  • 1
oleq
  • 15,697
  • 1
  • 38
  • 65