Forum OpenACS Development: Richtext widget does not work if htmlarea_p = 0

I am testing richtext widgets with htmlarea_p set to 0 and they don't work. The problem is an extra hidden element for the format property set to the empty string. Since the regular richtext widget shows the format dropdown it should not have the hidden element.

The code to check for display mode does not work correctly:

        # Display mode
        if { [info exists element(value)] } {

It checks is element(value) exists instead of checking element(mode) eq "display".

I made this change on my copy and it seems to work. Does this make sense? I could not find where the original code was written to check for display mode in CVS so I am not sure if there was a reason to not use element(mode) here.
It looks like in at least some cases element(value) exists but is empty and that passes the test even if you are in edit mode.

Collapse
Posted by Gustaf Neumann on
what is your testing setup? I have tried oacs-head with the following settings:

UseHtmlAreaForRichtextP 1
htmlarea_p (in form_elements of message/post.tcl) not specified
and
UseHtmlAreaForRichtextP 0
htmlarea_p (in form_elements of message/post.tcl) not specified
and
UseHtmlAreaForRichtextP 1
htmlarea_p (in form_elements of message/post.tcl) 0

with forums/message-post, and it works as expected without problems. The installation has no local modifications...

Collapse
Posted by Dave Bauer on
I noticed this problem when I added the client property to suppress htmlarea for testing with Selenium.

It just sets htmparea_p = 0 in the richtext widget tcl procedure right after it checks the parameter. Anyway if you read the code you can see that it can't possibly work, since it checks for the "value" of the widget not the mode.

The test I wrote is using the forms in the assessment package to add a new question.