Forum OpenACS Development: Error message when using portrait upload

Hi, I've got a relatively fresh install of OpenACS 5.1.4 using Postgres 7.4 on Suse Linux Enterprise 9. When I go to "Your Account" and click on the "upload a portrait" link, I get the following error:

can't use empty string as operand of "!"
    while executing
"if { ![parameter::get_from_package_key -package_key acs-subsite -parameter SolicitPortraitP]  } {
        if { ![acs_user::site_wide_admin_p] } {
    ..."
    (procedure "subsite::upload_allowed" line 3)
    invoked from within
"subsite::upload_allowed"
    invoked from within
"if [empty_string_p $user_id] {
    subsite::upload_allowed
    set user_id $current_user_id
    set admin_p 0
} else {
    set admin_p 1
}"
    ("uplevel" body line 19)
    invoked from within
"uplevel {
    	  ad_page_contract {
    Uploading user portraits

    @cvs-id $Id: upload.tcl,v 1.1.1.1 2005/01/31 21:55:40 fastclick Exp $
} {
    {u..."
    (procedure "code::tcl::/var/lib/aolserver/fastclick/packages/acs-subsite..." line 2)
    invoked from within
"code::tcl::$__adp_stub"
    invoked from within
"if { [file exists $__adp_stub.tcl] } {

      # ensure that data source preparation procedure exists and is up-to-date
      adp_init tcl $__adp_stub
..."
    ("uplevel" body line 3)
... [lines ommitted] ... 

"ad_try {
            rp_serve_abstract_file "$root/$path"
            set tcl_url2file([ad_conn url]) [ad_conn file]
            set tcl_url2path_info..."

I searched for this error and some solutions made reference to an ad.ini file, which I don't believe exists in my version of OpenACS. I'm afraid I'm not familiar enough with the guts of the system to know exactly where to look for this missing value.

Help?

Collapse
Posted by Jade Rubick on
This is technically a bug. The code should say [string is false $foo]

However, this worked with some versions of Aolserver, and not others, so it is a fairly common error. I would both file it as a bug. If you're able to fix it, then you can submit a patch, and it will be quickly applied.

Collapse
Posted by Jason Schock on
Thanks, Jade. That worked, and I will upload the patch to subsite-procs.tcl.

As for the cause - I'm wondering if it isn't a platform issue. I recently installed 5.1.3 on Debian Linux and did not encounter this error. More recently, I installed 5.1.4 on Suse Linux Enterprise 9 and got the error. At a glance, the code looks the same in both versions and I'm using the same version of TCL (8.4) on each box.

I'm really not sure what it could be that accounts for the apparent difference in code interpretation, if that is in fact the problem. But maybe this info will help someone down the road.

Collapse
Posted by Jason Schock on
Strange. Now the comment is not inserted with the photo on the initial upload. It can only be added afterwards with the "Edit comment" link. Not sure why, but this doesn't happen on my 5.1.3 installation.