Project

General

Profile

Bug #4760

this.GetSelection() is null js error when fckeditor wiris plugin is enabled

Added by Julio Montoya over 7 years ago. Updated about 7 years ago.

Status:
Bug resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
16/05/2012
Due date:
% Done:

100%

Estimated time:
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

the fill in blank question will not work due this bug


Files

example.png (27.8 KB) example.png Julio Montoya, 25/07/2012 11:45

Related issues

Related to Chamilo LMS - Bug #4468: Fckeditor WIRIS plugin hace perder la sesion durante la creación de encuestas, foros, wikis y notas personales (cuando no se envia cidReq)Bug resolved12/03/2012

Actions

History

#1

Updated by Julio Montoya over 7 years ago

EDit this file main/inc/lib/fckeditor/editor/plugins/fckeditor_wiris/fckplugin.js

And comment this line:

FCK.Events.AttachEvent('OnStatusChange', whenDocReady);

Final result:

//FCK.Events.AttachEvent('OnStatusChange', whenDocReady);
#2

Updated by Yannick Warnier over 7 years ago

  • Target version set to 1.9 Beta
#3

Updated by Yannick Warnier over 7 years ago

  • Target version changed from 1.9 Beta to 1.9 RC1
#4

Updated by Yannick Warnier about 7 years ago

  • Status changed from New to Needs more info
  • Assignee set to Julio Montoya

This file doesn't exist anymore in the fckeditor_wiris/ folder, so I guess the problem disappeared as well? Is it necessary to download something from FCKEditor for it to work?

#5

Updated by Julio Montoya about 7 years ago

That file doesn't exist in our repository but when you install fckedditor_wiris you will have that file see the zip file that contains the plugin.js

http://www.wiris.com/en/plugins/editors/download?filter=fckeditor

#6

Updated by Julio Montoya about 7 years ago

The problem here is that in the wiris plugin file: plugin.js there's a call of the function FCK.Events.AttachEvent
but we also use that function when adding a "fill in blanks" question, it semes to be a conflict between both functions
I tested with the latest version of wiris

http://www.wiris.com/en/downloads/files/1127/020fckeditor/php-fckeditor_wiris-3.17.22.0713.zip

#7

Updated by Julio Montoya about 7 years ago

More details:

in fact the problem is when using

editorInstance.SetData(parent.wrs_initParse(editorInstance.GetData()));

in fckplugin.js

according to the fckeditor documentation:

http://docs.cksource.com/FCKeditor_2.x/Developers_Guide/JavaScript_API

SetHTML( html ), or SetData( html ) - sets the contents of the editor. Note that when using this method, you will loose any listener that you may have previously registered on the editor.EditorDocument.

That's why we lost the listeners in the "fill in blank" form, and the inputs score doesn't work

#8

Updated by Julio Montoya about 7 years ago

  • Assignee deleted (Julio Montoya)
  • % Done changed from 0 to 30
#9

Updated by Yannick Warnier about 7 years ago

Let's call the WIRIS people to assist here.

Ivan, tenemos un problema con la llamada a FCK.Events.AttachEvent en el plugin de Wiris para FCKeditor. Podrías revisar lo anterior y ayudarnos en encontrar una solución, por favor.

Sino, tendremos que eliminar la opción de instalar Wiris en esta nueva versión de Chamilo. Nuestra deadline es este Viernes, pues el próximo Martes publicamos la nueva versión para el mundo.

#10

Updated by Ivan at WIRIS about 7 years ago

Ok, recibido.

Is there some test platform for us to see the problem first-hand.
A plain user access will be ok.

#11

Updated by Yannick Warnier about 7 years ago

Julio, could you add the Wiris plugin to chamilodev?

#12

Updated by Julio Montoya about 7 years ago

The plugin is now installed in http://chamilodev.beeznest.com to view the wiris options you have to "maximize fckeditor"

#13

Updated by Yannick Warnier about 7 years ago

  • Target version changed from 1.9 RC1 to 1.9 Stable

Moving to "stable" goal for now (will move to 1.9.2 if no solution found by Friday)

#14

Updated by Ivan at WIRIS about 7 years ago

Hi, need a user access for `ivan` at `wiris.com`, or someboy to approve the user `ivan` I've already registered at http://chamilodev.beeznest.com .

#15

Updated by Julio Montoya about 7 years ago

you can login with admin/admin, the user ivan is now activated

#16

Updated by Ivan at WIRIS about 7 years ago

Julio,
Excuseme if it's obvious, but:
Why the 'fill in the blanks' question uses a fckeditor call, if the fields are plain text input fields?
I can't see the fckeditor when previewing a 'fill in the blanks' question.

#17

Updated by Julio Montoya about 7 years ago

The "fill in the blanks" question uses the fckeditor call because we need to create inputs with the scores dynamically, if you start typing a word and closing the word with brackets you will see a new input. Example of you write this:

Merry [Xmas] and Happy new [year]

You will see 2 new inputs (in order to add the score) for Xmas and Year. Sadly this will not work in chamilodev because as I explained the listeners are gone due the fck wiris plugin

#19

Updated by Ivan at WIRIS about 7 years ago

Ok, thanks, we saw the expected behavior looking at campus.chamilo.org

We think we have found the problem, and maybe the fastest way to test it is ask you to make this little change is the file: `fckplugin.js`
Just comment the `else` part of this function:

@
// Plugin integration

function whenDocReady(editorInstance, status) {
alert(status);
if (status == FCK_STATUS_COMPLETE) {
if (parent.wrs_initParse) {
editorInstance.SetData(parent.wrs_initParse(editorInstance.GetData()));
parent.wrs_addIframeEvents(editorInstance.EditingArea.IFrame, null, wrs_int_mousedownHandler, wrs_int_mouseupHandler);
}
/*else {
setTimeout(function () {
whenDocReady(editorInstance, status);
}, 50);
}*/
}
}

@

#20

Updated by Andre Boivin about 7 years ago

On my local installation, it makes no difference. The bug remains

#21

Updated by Ivan at WIRIS about 7 years ago

Ok, thanks!
We now have a Chamilo installation, (it's been very easy! :-), and will make the tests there.
We'll keep in touch.

#22

Updated by Ivan at WIRIS about 7 years ago

Ok, here is our tested solution. Change the same fuction in the same file: `fckplugin.js`

// Plugin integration
function whenDocReady(editorInstance, status) {
    if (status == FCK_STATUS_COMPLETE) {
          if (parent.wrs_initParse) {
              //editorInstance.SetData(parent.wrs_initParse(editorInstance.GetData()));
              editorInstance.EditorDocument.body.innerHTML = parent.wrs_initParse(editorInstance.GetData());
              parent.wrs_addIframeEvents(editorInstance.EditingArea.IFrame, null, wrs_int_mousedownHandler, wrs_int_mouseupHandler);
          }
          else {
              setTimeout(function () {
                  whenDocReady(editorInstance, status);
              }, 50);
          }

    }
}

Can you please try it, and approve if ok?
We will update the package in our web download area after that.

#24

Updated by Julio Montoya about 7 years ago

  • Status changed from Needs more info to Needs testing

works for me

#25

Updated by Andre Boivin about 7 years ago

Works on my local installation

#26

Updated by Julio Montoya about 7 years ago

  • Status changed from Needs testing to Bug resolved
  • % Done changed from 30 to 100

Seems that the error was resolved, Feel free to reopen if the bug appears again, Thanks Ivan!

Also available in: Atom PDF