Forum OpenACS Development: Strange message key missing error (not the usual one either)

This is pretty strange.

On project-manager, one of my users noticed that if she put #1-#2 in the description of a task, she would get an error like this:

MESSAGE KEY MISSING: '1-'

It looks like the templating system is taking the #1-# part and thinking it's a message key, looking it up, finding it missing, and returning that error.

Here's the relevant code:

task-one.tcl
-----------

set richtext_list [list $task_info(description) $task_info(mime_type)]

set task_info(description) [template::util::richtext::get_property html_value $richtext_list]

task-one.adp
-----------
                <tr>
                  <td class="list-bg">@task_info.description;noquote@</td>
                </tr>

Any idea on how to fix this?

Hmm, this is a fairly annoying side effect of internationalization.

Look at this code:

.tcl

set text1 "#abc1#"
set text2 "\#abc2\#"
set text3 "#abc3#"

.adp

@text1@
@text2@
@text3;noquote@

Result:

MESSAGE KEY MISSING: 'abc1' MESSAGE KEY MISSING: 'abc2' MESSAGE KEY MISSING: 'abc3'

So what this looks like is that all output has to filtered to ensure that it doesn't contain \#.*\#  or we have to fix this in the templating system somehow.

Do we really want our users to be able to access arbitrary message keys? It seems like a programmer shouldn't have to make sure all output doesn't have ## tags in it.

The @ tags are dealt with better:

.tcl

set text1 "@abc1@"
set text2 "\@abc2\@"
set text3 "@abc3@"

.adp

@text1@
@text2@
@text3;noquote@

Output:

@abc1@ @abc2@ @abc3@

Here's a test case:

test2.adp

<master>
  <property name="title">Test</property>


  @text1@
  @text2@
  @text3;noquote@
  @text4;noquote@

test2.tcl

#

ad_page_contract {



    @author  (mailto:jader-ibr@bread.com)
    @creation-date 2004-11-22
    @arch-tag: 905ab77a-acf8-4939-ae39-a582ff59dca8
    @cvs-id $Id$
} {

} -properties {
} -validate {
} -errors {
}

set text1 "#abc1#"
set text2 "\#abc2\#"
set text3 "#abc3#"
set text4 "\#abc4\#"