Bug #4760
closedthis.GetSelection() is null js error when fckeditor wiris plugin is enabled
Description
the fill in blank question will not work due this bug
Files
Updated by Julio Montoya almost 11 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);
Updated by Yannick Warnier almost 11 years ago
- Target version changed from 1.9 Beta to 1.9 RC1
Updated by Yannick Warnier over 10 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?
Updated by Julio Montoya over 10 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
Updated by Julio Montoya over 10 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
Updated by Julio Montoya over 10 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
Updated by Julio Montoya over 10 years ago
- Assignee deleted (
Julio Montoya) - % Done changed from 0 to 30
Updated by Yannick Warnier over 10 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.
Updated by Ivan at WIRIS over 10 years ago
Ok, recibido.
Is there some test platform for us to see the problem first-hand.
A plain user access will be ok.
Updated by Yannick Warnier over 10 years ago
Julio, could you add the Wiris plugin to chamilodev?
Updated by Julio Montoya over 10 years ago
The plugin is now installed in http://chamilodev.beeznest.com to view the wiris options you have to "maximize fckeditor"
Updated by Yannick Warnier over 10 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)
Updated by Ivan at WIRIS over 10 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 .
Updated by Julio Montoya over 10 years ago
you can login with admin/admin, the user ivan is now activated
Updated by Ivan at WIRIS over 10 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.
Updated by Julio Montoya over 10 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
Updated by Ivan at WIRIS over 10 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);
}*/
}
}
@
Updated by Andre Boivin over 10 years ago
On my local installation, it makes no difference. The bug remains
Updated by Ivan at WIRIS over 10 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.
Updated by Ivan at WIRIS over 10 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.
Updated by Julio Montoya over 10 years ago
Updated by Julio Montoya over 10 years ago
- Status changed from Needs more info to Needs testing
works for me
Updated by Julio Montoya over 10 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!