Forum OpenACS Development: Strange behavior with AOLserver on Ubuntu 14.04

Hey,

I observed a strange behaviour when using AOLserver on Ubuntu 14.04. When opening a form for editing, if the text field has an empty value (so $element(value) == ""), the browser would show the ? in a rhombus which usually signifies an unknown character in the character set.

I first assumed this has something to do with PostgreSQL, but as it happens even if PG isn't involved, I ruled it out. Then I tried the various other manually compiled culprits (XoTCL, LibThread etc.), really trying to find a needle in a haystack.

Ultimately I patched OpenACS acs-templating, which cured my problem and seems to have no ill side effects in the few pages of ]project-open[ I tested, but maybe someone else has observed this behaviour at one point?

Installation instructions I followed: http://erp4projects.de/install-project-open-on-ubuntu-14-4-lts/

EDIT: DO NOT USE THE BELOW CODE!  DO NOT USE THE BELOW CODE! DO NOT USE THE BELOW CODE!

Patch:

commit 688b5adf4f31cfd9b7606ce5819be7041d814669
Author: Malte Sussdorff
Date:  Sat Feb 7 10:19:20 2015 +0100

    Remove the value field if the value is actually empty

diff --git a/tcl/widget-procs.tcl b/tcl/widget-procs.tcl
index 38848ad..e155d83 100644
--- a/tcl/widget-procs.tcl
+++ b/tcl/widget-procs.tcl
@@ -389,7 +389,7 @@ ad_proc -public template::widget::input {
    # Handle display mode of visible normal form elements, i.e. not hidden, not submit, not button, not clear
    if { $element(mode) ne "edit" && [lsearch -exact { hidden submit button clear checkbox radio } $type] == -1 } {
        set output ""
-        if { [info exists element(value)] } {
+        if { [exists_and_not_null element(value)] } {
            append output [ad_quotehtml $element(value)]
            append output "<input type=\"hidden\" name=\"$element(name)\" value=\"[ad_quotehtml $element(value)]\">"
        }
@@ -400,7 +400,7 @@ ad_proc -public template::widget::input {
            append output " disabled"
                }

-        if { [info exists element(value)] } {
+        if { [exists_and_not_null element(value)]} {
            append output " value=\"[template::util::quote_html $element(value)]\""
        }

Collapse
Posted by Gustaf Neumann on
Dear Malte,

This looks to me as an instance of this well known bug ([1], probably [2]). The bug is fixed in the aolserver cvs since more than a year [3]. I would expect that the bug would not show up, when you use the recent AOLserver from the repository (or NaviServer).

The suggested fix addresses just some of the symptoms in one place, it will lead to incorrect behavior when the form is expected to provide an empty form field; the source code above is not from the actual oacs-5-8 releases, and - strangely enough it just avoids calls to ad_quotehtml, which does NOT call ns_quotehtml, containing the bug. I would not recommend to use this bugfix.

Furthermore, the same bug with ns_quotehtml in aolserver is likely to show up on other places as well. so, fix aolserver or use naviserver.

all the best
-g

[1] https://openacs.org/forums/message-view?message_id=4078333
[2] http://www.clever-devel.com/wiki/Ubuntu_Aolserver_OpenACS_empty_Textfields_not_empty
[3] http://aolserver.cvs.sourceforge.net/viewvc/aolserver/aolserver/nsd/quotehtml.c?sortby=date&view=log

Collapse
Posted by Malte Sussdorff on
Dear Gustaf,

thanks for pointing this out. I take a few lessons from it:

1. Well documented does not mean it shows up in Google search results (at least Link 2 did not and the top search result now is this thread 😊.
2. Gone are the good old days when we could install OpenACS or ]project-open[ without compiling the web server manually (as the packages won't work) on current versions of (at least) Ubuntu.
3. We need an installation instruction for ]project-open[ on Ubuntu 14.04 LTS which is more detailed than the current one for 12.04 LTS. And make sure it is linked and can be found using google search 😊.
4. ]project-open[ should eventually move to OpenACS 5.8, Naviserver and PG 8.3 in order to benefit from the larger OpenACS community (otherwise I would not have posted outdated acs-templating code). Maybe it happens before PG 10 / OpenACS 6.x is out.

Best wishes
Malte

Collapse
Posted by Gustaf Neumann on
hmm.

regarding 1: google's results depend on the search string :) needless to say that i found link 2 via google.
regarding 2: the appropriate way to report a bug in a debian package is to submit a bug report to the debian maintainer. especially, when there is a fix, this is usually quickly integrated. There is also a debian package for naviserver [1]
regarding 3: an installation based on [2] can be shorter than the current one and works on more platforms
regarding 4: PO should move towards PG 9.* and to towards pg8.*. I've sent patches to install intranet-hr under pg9.3 in oct 2013 (including notifications, intranet-core, acs-workflow, intranet-dynfield)

[1] https://comments.gmane.org/gmane.comp.web.naviserver.devel/2977
[2] https://openacs.org/xowiki/naviserver-openacs

Collapse
Posted by Malte Sussdorff on
regarding 2: Yeah, but I'm not sure what exactly is the fix, as I had to use the HEAD version of AOLserver, nssha1, nspostgres and nscache to get it working. Not what i would recommend to the Debian maintainer.
regarding 3: Yes... I was actually using this one as a reference point for my installation instructions at http://erp4projects.de/install-project-open-on-ubuntu-14-4-lts/. Maybe Frank can look into making a more generic version available.
regarding 4: I assume those patches run on top of OpenACS 5.8 and work with Naviserver? Then it would be great to get them, as haven't seen them incorporated into ]project-open[ yet (https://github.com/project-open/intranet-hr/commits/master).
Collapse
Posted by Gustaf Neumann on
the recommendation to the debian-maintainer should be: please upgrade to the lasted, fixed version from cvs.

regarding the last point: the changes have nothing to do with naviserver, but to bring po to the same level as oacs (e.g fix old-style sql quoting, get rid of deprecated functions, make po installable from scratch with pg 9.3, etc. my hope was mostly, to get the free PO components installable via repository, similar as dotlrn is now installable via repo, but this seems still a longer way.