Return-Path: Delivered-To: apmail-incubator-jspwiki-dev-archive@locus.apache.org Received: (qmail 48815 invoked from network); 19 Jan 2008 17:26:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Jan 2008 17:26:55 -0000 Received: (qmail 92209 invoked by uid 500); 19 Jan 2008 17:26:45 -0000 Delivered-To: apmail-incubator-jspwiki-dev-archive@incubator.apache.org Received: (qmail 92201 invoked by uid 500); 19 Jan 2008 17:26:45 -0000 Mailing-List: contact jspwiki-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jspwiki-dev@incubator.apache.org Delivered-To: mailing list jspwiki-dev@incubator.apache.org Received: (qmail 92192 invoked by uid 99); 19 Jan 2008 17:26:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Jan 2008 09:26:44 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Jan 2008 17:26:28 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3819B714247 for ; Sat, 19 Jan 2008 09:26:34 -0800 (PST) Message-ID: <15400796.1200763594218.JavaMail.jira@brutus> Date: Sat, 19 Jan 2008 09:26:34 -0800 (PST) From: "Janne Jalkanen (JIRA)" To: jspwiki-dev@incubator.apache.org Subject: [jira] Resolved: (JSPWIKI-114) VariableManger does not check "RealPage" for variables during variable lookup In-Reply-To: <4781927.1198692284164.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JSPWIKI-114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Janne Jalkanen resolved JSPWIKI-114. ------------------------------------ Resolution: Fixed Fixed in 2.6.1-cvs-8 > VariableManger does not check "RealPage" for variables during variable lookup > ----------------------------------------------------------------------------- > > Key: JSPWIKI-114 > URL: https://issues.apache.org/jira/browse/JSPWIKI-114 > Project: JSPWiki > Issue Type: Bug > Components: Core & storage > Affects Versions: 2.4.104, 2.6.0 > Reporter: Stephen Solka > Priority: Minor > Fix For: 2.6.1 > > Attachments: RealPageVariables.patch > > > When one sets a page variable jspwiki attaches that variable to the realpage variable which exists in the engine's context. But when looking up a variable reference only page is checked for that variable. The result is when realpage and page differ all previously defined variables vanish from scope. This can be seen when defining a variable then using the insertpage plugin. the inserted page can not see any variables defined in the inserter page and thus returns a variable not found error. > Initial Conversation on HowToUseAVariable which lead to bug: > ======== > Lets pretend the code on one page called TestPage is > Hello [{$tname}] > Then the code for another page called Tester is > [{SET tname='Stephen'}] > [{InsertPage page='TestPage'}] > It doesnt seem to be working as I would expect. I would expect the output to be > Hello Stephen > but instead I get > Hello No such variable: No variable tname defined. > What am I doing wrong? Why is InsertPage parsing the content of the inserted page prior to insertion? --Stephen > The tname variable is referring to the page variable called "tname" on page "Tester". Variables are always interpreted in the context of the including page, not the included page. This allows you to e.g. create templates which you can insert and control with page variables. > -- JanneJalkanen > If variables are interpreted in the context of the including page why does Tester claim not to know what tname is when inserting a page that references that variable? Controlling a inserted page through page variables is EXACTLY what I am trying to do. But if all page variables defined in the including page lose scope prior to insertion then I fail to see how this is possible? Is it possible to directly manipulate the variables for a page prior to insertion? > -- Stephen -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.