Ticket #1757 (new defect)

Opened 2 years ago

Last modified 2 years ago

FCKEditor doesn't update comment

Reported by: gracinet Assigned to: madarche
Priority: P2 Milestone: CPS 3.5.0
Component: CPSSchemas Version: TRUNK
Severity: major Keywords: FCKEditor HTML
Cc:

Description

The FCKEditor popup doesn't update the text comments. Although it can remember what was typed (one can see it by relaunching the editor), saved comments end up empty.

Browser: Firefox

Attachments

widget_text_render.patch (0.7 kB) - added by scamps on 10/24/06 10:52:16.

Change History

10/09/06 22:56:20 changed by gracinet

  • owner changed from atchertchian to fguillaume.
  • component changed from CPSComment to CPSSchemas.
  • severity changed from normal to major.

Oops, should have checked before: this seems to be a general problem with the Text Widget actually (reproduced on News Item doc)

10/10/06 11:08:48 changed by madarche

  • owner changed from fguillaume to madarche.

10/24/06 10:51:06 changed by scamps

There are also some problems when de Text Widget is embedded. I attach a simple patch to solve that case

10/24/06 10:52:16 changed by scamps

  • attachment widget_text_render.patch added.

11/03/06 11:21:18 changed by madarche

  • milestone set to CPS 3.4.3.

gracinet : I don't reproduce the problem. Can you check if it still happens and if so please explain precisely how to reproduce.

scamps : I have read your patch but I don't think it is correct. Let me explain. The Text Widget when in edit mode is always used in the following ZPT CPSDocument/skins/cps_document/cpsdocument_edit_form.pt which already loads the cpsschemas.js file. But maybe there is a case where the Text Widget is not used in cpsdocument_edit_form that I don't know of. If this is the case, please describe precisely how to reproduce. Note that to use the new embedded option of the Text Widget you need the new version of CPSDocument. Maybe this is the problem you are facing.

11/03/06 12:15:25 changed by scamps

madarche: I'm using CPS 3 trunk, so should not be a problem of CPSDocument version. I've test the problem still persists. You can reproduce it using CPSBlog, for instance. I've changed portal_layouts/blog_entry/wcontent to render html embedded, and this produces a javascript error trying to render the widget (the template is blog_entry_edit_form). In fact, I think loading JS needed in a widget should not be a task of the template where the widget is used, but of the widget itself, isn't it ? Using the html popup version also fails for me, but this could be caused becouse I have a Epoz installed (for other products requeriments), and I've seen somewhere an isProductPresent('Products.Epoz') in the CPSSchemas code Using html embedded works for me applying the patch I've sent.

11/03/06 12:39:47 changed by madarche

The CPSBlog JavaScript? problem has been fixed in changeset [49933].

scamps : Are there other such problems, where a JavaScript? is missing, that you know of ?

And about the suggestion of each widget could load the JavaScript? it needs it seems interesting. Some questions : What happens when several widgets load the same JavaScript? file ? If that doesn't cause errors, what about the perfs ? So it seems to be that the good way to implement this would be to have each Widget registering it's own JavaScript? and then the layout lib would load only once the needed JavaScript?. Quite heavy and hard to implement, isn't it ?

11/03/06 13:32:45 changed by scamps

I've not found any other places, but when I read the initial comment about the News Item doc I thought it was the same problem.

About the suggestion of load needed javascript in widgets, I was thinking about the way CPSPortlets does it. It's easier than register js requeriments and pass this works to the layout. Here there is a piece of code of CPSPortlets/browser/tree.js

<script type="text/javascript">

function loadScript(id, script_filename) {

var html_doc = document.getElementsByTagName('head').item(0); var js = document.createElement('script'); js.setAttribute('language', 'javascript'); js.setAttribute('type', 'text/javascript'); js.setAttribute('src', script_filename); html_doc.appendChild(js); return false;

}

loadScript('prototype', 'prototype.js'); loadScript('effect', 'effects.js'); loadScript('treeview', '++resource++treenodeview.js');

</script>

With some little effort, an importModule function, able to detect if a module is alread loaded, could be writted. The jsolait library has a similar feature in its init.js

11/03/06 14:37:57 changed by madarche

1. We just wait for gracinet answer for closing this bug

2. scamps : I'm convinced by your suggestion :-) and for the record this is related to #837. So maybe could you restate your suggestion about widget JavaScript? in #837 and we could try to implement it after CPS 3.4.3 is out. Thanks !