Inserting footnotes works like a charm. Though I can't seem to edit it. Selecting it and editing it via the footnote button display "Unknown object" in the text field.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hingo’s picture

Yes. It seems CKEditor is constantly changing the API for plugins which breaks 3rd party plugins. From footnotes_wysiwyg/README.txt:

Known issues
...
The Footnotes CKEditor plugin has been verified to work on CKEditor 3.3.1. On
newer versions, in particular 3.5.2 there is a bug that when right clicking on
an existing footnote, the "Edit footnote" entry is missing from the context
menu. Also, if one then clicks on the "Add footnote" toolbar button, the values
of the existing footnote are not shown in the dialog box, rather a new, empty
footnote dialog is shown. If "Ok" is clicked, the old footnote is lost and
replaced with the empty or new values.

From your description it seems newest CKEditor breaks it in new ways yet again.

Also note the "seeking new maintainer" at http://drupal.org/project/footnotes, ie I'm not working to fix this, I'm hoping others will step in. (Footnotes is used by many professional Drupal shops, I'm sure it's just a matter of time someone fixes this.)

lavamind’s picture

FileSize
1.08 KB

Here's a patch to fix that problem. Works with CKeditor 3.6.

The patch can probably also be backported to the 6.x branch of the module.

If you don't want to work with the patch, you can easily for the problem by hand. Just locate all instances (3) of element.getAttribute( '_cke_real_element_type' ) and replace with element.getAttribute( 'data-cke-real-element-type' ).

hingo’s picture

Thanks for the patch.

Since you've contributed helpful stuff in previous issues, I've added you as a maintainer. Please go ahead and commit this yourself. (Note: I didn't review the patch, if you'd like that done then please wait for or ask someone to do it.)

lavamind’s picture

Status: Active » Needs review

If anyone can confirm that the patch works for them, I'll commit the change.

Dashu’s picture

Unfortunately, it did not work for me.
Applied the patch and tried to do it manually but -> nothing.
CKEditor Version CKEditor 3.6.1

Dashu’s picture

I debugged a little further.
The problem is, that the fakeElement alt and title values are not set properly.

This is where the error occurs:

http://docs.cksource.com/ckeditor_api/symbols/src/plugins_fakeobjects_pl...
createFakeElement()
79 var lang = this.lang.fakeobjects,
80 label = lang[ realElementType ] || lang.unknown;

and I suspect that this also happens in createFakeParserElement()

115 var lang = this.lang.fakeobjects,
116 label = lang[ realElementType ] || lang.unknown,

where lang.unknown is "Unknown Object" / "Unbekanntes Objekt"

Dashu’s picture

Workaround for everyone who wants that unknown object tootltips removed (in addition to the patch provided by lavamind):

Use the patch below (lavaminds patch + mine)

-------------------- OR do it manually ---------------------

/footnotes/footnotes_wysiwyg/ckeditor_plugin/plugin.

Line 117

Before:

var fakeElement = editor.createFakeElement( realElement , 'cke_footnote', 'fn', false );
editor.insertElement(fakeElement);

After:

var fakeElement = editor.createFakeElement( realElement , 'cke_footnote', 'fn', false );
fakeElement.setAttributes({
      title: content,
      alt: content
});
editor.insertElement(fakeElement);

---------------------- And ------------------------------

Line 178:

var fakeElement = editor.createFakeParserElement(element, 'cke_footnote', 'fn', false );
return fakeElement;

has to change to ->

var fakeElement = editor.createFakeParserElement(element, 'cke_footnote', 'fn', false );
if(element.children[0] !== undefined && element.children[0] !== null) {
      fakeElement.attributes.alt = element.children[0].value;
      fakeElement.attributes.title = element.children[0].value;
}
return fakeElement;
denix’s picture

thanks, this helped me a lot with configuration previous than WYSISWYG 7.x-2.1, CKEditor 3.6.1.7072, Footnote Wysiwyg 7.x-2.5 and Footnote 7.x-2.5 but now it seems not to work anymore.

Thanks again,
Denis

hoZt’s picture

I tried to apply these patches with the current 3.6.x version of ckeditor and it does not work. When the ckeditor plugin is enabled the editor does not display at all.

vegardjo’s picture

Not getting the patch to work on CK 3.6.1

@hoZt: have you seen this issue: #1333748: plugin not found causes ckeditor not to work? I had the same problem, but solved it there.

rooby’s picture

Solution in #2 is working fine for my testsing with CKEditor 3.6.1

However I did not use the patch, I did a find and replace manually in the file.

rooby’s picture

Status: Needs review » Fixed

Committed #2 to Drupal 6 & 7.

http://drupalcode.org/project/footnotes.git/commit/9ca1a0c
http://drupalcode.org/project/footnotes.git/commit/6d6ad51

@Dashu:
I'm not sure exactly what you are experiencing in #5, #6 & #7, but please try the latest dev version once this commit shows up and if it doesn't work with the latest CKEditor, post back here with your problems.

Thanks.

rooby’s picture

@Dashu:
Is your problem only in IE or all browsers?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pverrier’s picture

Changing 7.x-2.5 to latest dev version (2012-Mar-06) plus patch #7 (tooltip = footnote text instead of "Unknown object") worked for me : I now have the contextual link and the right tooltip. But :

  • I get a default text "[object Object]" for the footnote, only on IE (9) already reported in http://drupal.org/node/1225416
  • On Firefox & IE9 the width of the text input for "Value" is shrinked
  • Everything's OK on Chrome
robin_b’s picture

#7 works

(however the patchfile has some unnecessary lines at the beginning)

soulfroys’s picture

Please, the #12 commit is not present in last dev. Does Anyone know why?

rooby’s picture

Please, the #12 commit is not present in last dev. Does Anyone know why?

It is for me when I download it.

soulfroys’s picture

I forgot my report (following the instructions in #7):

  1. IE (8) : like in #15, I get a default text "[object Object]" for the new footnotes and "ok" button doesn't work, "cancel" does.
  2. FF and IE8: height window issue...
  3. Footnotes height issue
    ...easily fixable in line 59:

    - minHeight : 50, 
    + minHeight : 80, 
    
  4. IE8 only: for existing footnotes, showing blank with errors:
  5. Footnotes height issue

  6. All browsers: showing "[fn]" (above image) instead of the number in body (edit mode). Is that correct? (I tried to rearrange the filters, but it did not work)

@rooby
Thank you, but did not understand what you say and forgive me for my poor English (not my first language).

Anonymous’s picture

Status: Closed (fixed) » Needs work

As it appears that there are a number of us that are still having issues, I'm changing status from closed.

rooby’s picture

I spent a decent amount of time on this today and have made a little progress.

I was able to fix the [object] bug reasonably easy, however another bug remains, which is that when you add a footnote:
* In IE9 it adds it to the start of the text area, not where your cursor is.
* With older IE it throws a javascript error and doesn't work at all. The error comes out of ckeditor and is "Error: Unable to get value of the property 'remove': object is null or undefined"

Firefox & Chrome work fine.

The problem is the use of the <fn> tag.

CKEditor doesn't like doing:
element.createFromHtml('<fn></fn>');
With a bogus tag. At least in IE.
Change it to a div for example and it works.

I have not yet been able to find a way in CKEditor to use custom tags in this manner so I will have to do some more investigating.

I might also open an issue with the CKEditor guys and see what they have to say about it.

Attached is the patch that gets rid of the [object] bug, but it still doesn't get things fully working in IE.

This also affects CKEditor 3.6.5

manhho06’s picture

footnotes via wysiwyg (CKEditor 3.6.5.7647)

Fixed footnotes error with IE 8 and 7.

Use the patch below.

rooby’s picture

Great thanks.

I will review this tonight.

R.Muilwijk’s picture

You might like to upgrade to ckeditor 4.1 see #2025027: Add support for ckeditor 4.x

  • rooby committed 9ca1a0c on 8.x-2.x authored by lavamind
    Issue #1124454 by lavamind: Fix users not being able to edit existing...

  • rooby committed 9ca1a0c on 7.x-3.x authored by lavamind
    Issue #1124454 by lavamind: Fix users not being able to edit existing...
scott_euser’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)