Re: ".vars" names can't contain dashes?

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Friday, June 10, 2011, 1:12:10 AM, Rodney Gitzel wrote:

> We're using version 2.3.16, and I've just tracked down a weird bug
> in one of our apps.  It came down to there now being hyphens in some
> of our product code strings.  The codes are used to pull hashes of
> localized text from the global scope using ".vars".   Upgrading to
> 2.3.18 did not change the issue I found.
>
> Reducing the issue brought me to an example that anyone can try: 
> ${.vars["foo-bar"]}  in a template outputs "0" (without the quotes).
> ${.vars["foo+bar"]} outputs "nullnull".   ${.vars["foobar"]}
> correctly triggers an InvalidReferenceException.   All three should fail, not just the last one.
>
> http://freemarker.sourceforge.net/docs/app_faq.html#faq_strange_variable_nameimplies
> this should work.   Instead, it appears the ".vars" parameter string is being evaluated!  :-(


It works correctly here. What are your configuration settings (not
like I have any idea now how to achieve this with settings...)? Or is
your data-model something special?

> I saw mention of a similar issue a few weeks ago on this mailing
> list, and it was suggested to prefix the parameter string with "@". 
> That might work with other hashes, but it does NOT work with
> ".vars".

That has nothing to do with these. That was an XML thing, where the
name of the variable was indeed @something.

> I just took a working example (.vars["resources_title"]) and that
> change made it throw an InvalidReferenceException
> (.vars["@resources_title"]).
>
> Thanks.
>
> rodney
>
>

-- 
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.