Forum OpenACS Q&A: syntax error in expression "2000 + 1 - "

Here's another odd error.  Are these porting errors, or regular bugs
in the ACS as it comes from ARSdigita?

Errors since 25/Aug/2000:15:29:50

[25/Aug/2000:15:38:50]
    Error: nsd.tcl: syntax error in expression "2000 + 1 -     "
    syntax error in expression "2000 + 1 -     "
        while executing
    "expr $this_year + 1 - $birthyear"
        ("while" body line 16)
        invoked from within
    "while { [ns_db getrow $db $selection] } {
        set_variables_after_query
        incr count
        # if $before_or_after_today = -1 then the birthday is
later..."
        (file "/pub/www/acs/www/address-book/birthdays.tcl" line 47)
        invoked from within
    "source $script"
        (procedure "ns_sourceproc" line 6)
        invoked from within
    "ns_sourceproc cns2888 {}"
    NOTICE:  identifier "category_hierarchy_reverse_sortkey" will be
truncated to "category_hierarchy_reverse_sort"
    NOTICE:  identifier "category_hierarchy_reverse_sortkey" will be
truncated to "category_hierarchy_reverse_sort"
    NOTICE:  identifier "category_hierarchy_reverse_sortkey" will be
truncated to "category_hierarchy_reverse_sort"
    NOTICE:  identifier "category_hierarchy_reverse_sortkey" will be
truncated to "category_hierarchy_reverse_sort"
    NOTICE:  identifier "category_hierarchy_reverse_sortkey" will be
truncated to "category_hierarchy_reverse_sort"
    Notice: bboard_restrict_access_to_group: empty form
Collapse
Posted by Dan Wickstrom on
It looks like $birthyear is undefined.  Try modifying birthdays.tcl as follows:
<br>
<pre>
  if { ![empty_string_p $birthyear] } {  # <-- change != to use empty_string_p function
    if { $before_or_after_today == "0" } {
        set age_on_next_birthday [expr $this_year - $birthyear]
        append html " (turns $age_on_next_birthday today!)"
    } elseif { $before_or_after_today == "-1" } {
        set age_on_next_birthday [expr $this_year - $birthyear]
        append html " (turns $age_on_next_birthday)"
    } else {
        set age_on_next_birthday [expr $this_year + 1 - $birthyear]
        append html " (turns $age_on_next_birthday)"
    }
    }

</pre>

Collapse
Posted by Ben Adida on
Glen, to answer your question, there are bugs both in the original ACS, and in our port of it. All of these should be reported to our SDM if you find them in OpenACS, because there are slight differences between OpenACS and ACS Classic at this point. In this case, this looks like an ACS bug, although aD might have already fixed this one in their newest versions.
Collapse
Posted by Glen Stewart on
Dan's proposed fix (implemented in OpenACS 3.2.4) is still broken - I get the exact same errors.  In fact, I'm currently getting a full AOLserver 3.1 crash at 4pm each day - the last process running mentions "Notice: address_book_mail_reminders starting".  Trying to track that down...