2

I installed Project Open on ubuntu.

Whenever there is an empty string in tcl then the HTML forms contain a non-printable character instead.

What could cause the issue? Webserver is openACS / AOLServer

TCL Code: set email "" (index.tcl)

ADP Code: email="@email@" (index.adp)

HTML output: <input type="text" name="email" value="?"

(when I save the web-page as htm file then the ? shows hex code 00 in a hex editor - not sure if this is correct. Anyway there should be no character between the "" for value)

UPDATE 1:
ADP Code: email="t@email@t" (index.adp)
HTML output: <input type="text" name="email" value="tt"

So it really seems to be an empty string. which gets messed up in the ADP file.

UPDATE 2:
according to evil otto's answer it seems to be a AOL Server bug
how to fix it?
nsd -V
AOLserver/4.5.1 (aolserver4_5)
CVS Tag: $Name: aolserver_v45_r1 $
Built: Apr 2 2014 at 08:27:37
Tcl version: 8.6
Platform: linux

fraber
  • 1,204
  • 1
  • 8
  • 21
Thorsten Niehues
  • 13,712
  • 22
  • 78
  • 113
  • Could you give a little more detail? Is the empty string in one of the Tcl source files, or does it come from user input or somewhere else? – Colin Macleod May 20 '15 at 13:48
  • The empty string comes from tcl source files. I tried [string length $email] which returns 0 – Thorsten Niehues May 20 '15 at 14:04
  • Thanks, can't see the problem though. ( I worked on a project open installation a couple of years ago but don't have access to it now. ) – Colin Macleod May 20 '15 at 14:08
  • I don't have any idea for what might be causing the problem, but the hex of 00 represents the null character. – Jerry May 20 '15 at 22:43
  • This is a tricky one to debug without knowing more about your setup. Can you check the following settings in AOLserver's configuration file (in the ns_section ns/parameters section): ns_param HackContentType 1 ns_param DefaultCharset utf-8 ns_param HttpOpenCharset utf-8 ns_param OutputCharset utf-8 ns_param URLCharset utf-8 – TrojanName May 21 '15 at 11:27

1 Answers1

5

there is a known bug in some versions of AOLserver (4.5.0 through last released, but fixed in cvs HEAD) that causes ns_quotehtml to return invalid data when handed an empty string. OpenACS detects and works around this bug but there was a version which did not.

The workaround for an affected version would be to change ns_quotehtml to ad_quotehtml in template::adp_compile, defined in packages/acs-templating/tcl/parse-procs.tcl

See http://openacs.org/forums/message-view?message_id=4078333

evil otto
  • 10,348
  • 25
  • 38
  • Thx for sharing .. this is great information. Unfortunately there is no ns_quotehtml in that file. I found `{\1[ad_quotehtml [lang::util::localize ${\2}]]}` in the adp_compile section.
    And I found in `template::expand_percentage_signs` `# TODO: ad_quotehtml`
    – Thorsten Niehues May 22 '15 at 07:42
  • The discussion in the link you provided seems very elaborate talk about the issue with little hints how to fix it. But no specifics of how to fix it. Any further suggestions? – Thorsten Niehues May 22 '15 at 07:46
  • 3
    @ThorstenNiehues this is the patch for the bug. http://cvs.openacs.org/browse/OpenACS/openacs-4/packages/acs-templating/tcl/parse-procs.tcl?r2=1.48.2.1&r1=1.48 – TrojanName May 22 '15 at 08:36
  • @TrojanName, Thx a lot. Replacing only the lines in parse-procs.tcl did not help. But replacing all ACS files fixed the Prolbem. – Thorsten Niehues May 23 '15 at 19:02
  • Glad you resolved the issue. It's a bit strange that you had to replace all the files. – TrojanName May 24 '15 at 14:46