Item1265: Macros TOPIC, INCLUDINGTOPIC, WEB and INCLUDINGWEB ar not working when used in FORMFIELD evaluation

pencil
Priority: Normal
Current State: Closed
Released In: 1.0.10
Target Release: patch
Applies To: Engine
Component:
Branches:
Reported By: IngoKappler
Waiting For:
Last Change By: KennethLavrsen
Please find here a list of what I found to work and what didn't (all that works in the normal topic text area):

  1. .@company.com - Not OK in form field on 1.0.3
  2. .@company.com - Not OK in form field on 1.0.3
  3. .@company.com - OK in form field on 1.0.3 smile
  4. 3606 - OK in form field on 1.0.3

Not OK in form field on 1.0.3:
%FORMFIELD{"FirstName" topic="%INCLUDINGWEB%.%INCLUDINGTOPIC%"}%.%FORMFIELD{"LastName" topic="%INCLUDINGWEB%.%INCLUDINGTOPIC%"}%@company.com

Not OK in form field on 1.0.3:
%FORMFIELD{"FirstName" topic="%TOPIC%"}%.%FORMFIELD{"LastName" topic="%TOPIC%"}%@company.com

OK in form field on 1.0.3:
%FORMFIELD{"FirstName" topic="%WIKIUSERNAME%"}%.%FORMFIELD{"LastName" topic="%WIKIUSERNAME%"}%@company.com

OK in form field on 1.0.3:
[[http://172.21.121.20:9080/martin.php?orig=%FORMFIELD{"Internal Extension" topic="%WIKIUSERNAME%"}%&dest=3606][3606]]

I'd normally expect that the following macros should also work in form fields (where users put the value):

%TOPIC%
%INCLUDINGTOPIC%
%WEB%
%INCLUDINGWEB%

-- IngoKappler - 12 Mar 2009

This might actually be because
%TOPIC%
%INCLUDINGTOPIC%
%WEB%
%INCLUDINGWEB%
have really surprising values when rendered from tmpl and nested INCLUDEs

what if you try

%BASETOPIC%
%BASEWEB%

which are pretty much defined as the requested web&topic.

-- SvenDowideit - 12 Mar 2009

This works also in a form field:

%FORMFIELD{"FirstName" topic="%BASEWEB%.%BASETOPIC%"}%.%FORMFIELD{"LastName" topic="%BASEWEB%.%BASETOPIC%"}%@company.com
%FORMFIELD{"FirstName" topic="%WEB%.%BASETOPIC%"}%.%FORMFIELD{"LastName" topic="%WEB%.%BASETOPIC%"}%@company.com

New Summary:

Fails (in form field only, not in normal topic text):

%FORMFIELD{"FirstName" topic="%INCLUDINGWEB%.%INCLUDINGTOPIC%"}%.%FORMFIELD{"LastName" topic="%INCLUDINGWEB%.%INCLUDINGTOPIC%"}%@company.com
%FORMFIELD{"FirstName" topic="%TOPIC%"}%.%FORMFIELD{"LastName" topic="%TOPIC%"}%@company.com
%FORMFIELD{"FirstName" topic="%WEB%.%TOPIC%"}%.%FORMFIELD{"LastName" topic="%WEB%.%TOPIC%"}%@company.com

Succeeds also in form field:

%FORMFIELD{"FirstName" topic="%BASEWEB%.%BASETOPIC%"}%.%FORMFIELD{"LastName" topic="%BASEWEB%.%BASETOPIC%"}%@company.com
%FORMFIELD{"FirstName" topic="%WEB%.%BASETOPIC%"}%.%FORMFIELD{"LastName" topic="%WEB%.%BASETOPIC%"}%@company.com
%FORMFIELD{"FirstName" topic="%WIKIUSERNAME%"}%.%FORMFIELD{"LastName" topic="%WIKIUSERNAME%"}%@company.com

-- IngoKappler - 12 Mar 2009

I just tested this on trunk, and as far as I can tell it all works fine. Ingo, we would need a better testcase to pursue this, if it is still a problem. Your examples above are incomplete (they assume form definitions, includes etc. - at least I think they may).

-- CrawfordCurrie - 05 Jun 2010

Finally I made it to double check the situation. The scenario was putting the email address automatically into the default Email formfield on the users page because in a company often users use the same domain anyway, hence pre-defining the email makes sense and saves the work from the user.

I tested on a fresh 1.1.1 installation the following entries successfully (failed above):
%FORMFIELD{"FirstName" topic="%INCLUDINGWEB%.%INCLUDINGTOPIC%"}%.%FORMFIELD{"LastName" topic="%INCLUDINGWEB%.%INCLUDINGTOPIC%"}%@company.com

%FORMFIELD{"FirstName" topic="%TOPIC%"}%.%FORMFIELD{"LastName" topic="%TOPIC%"}%@company.com

%FORMFIELD{"FirstName" topic="%WEB%.%TOPIC%"}%.%FORMFIELD{"LastName" topic="%WEB%.%TOPIC%"}%@company.com

In addition I also retested the follwing entries in the UserForm without issues:
%FORMFIELD{"FirstName" topic="%BASEWEB%.%BASETOPIC%"}%.%FORMFIELD{"LastName" topic="%BASEWEB%.%BASETOPIC%"}%@company.com

%FORMFIELD{"FirstName" topic="%WEB%.%BASETOPIC%"}%.%FORMFIELD{"LastName" topic="%WEB%.%BASETOPIC%"}%@company.com

%FORMFIELD{"FirstName" topic="%WIKIUSERNAME%"}%.%FORMFIELD{"LastName" topic="%WIKIUSERNAME%"}%@company.com

The issue can be closed as it is not reproducible anymore, thanks!

-- IngoKappler - 03 Nov 2010

Thanks for the feedback.

I am closing this then. One less in the backlog.

-- KennethLavrsen - 03 Nov 2010

ItemTemplate edit

Summary Macros TOPIC, INCLUDINGTOPIC, WEB and INCLUDINGWEB ar not working when used in FORMFIELD evaluation
ReportedBy IngoKappler
Codebase 1.0.3
SVN Range Foswiki-1.0.3, Sat, 28 Feb 2009, build 2773
AppliesTo Engine
Component
Priority Normal
CurrentState Closed
WaitingFor
Checkins
TargetRelease patch
ReleasedIn 1.0.10
Topic revision: r6 - 03 Nov 2010, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy