You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shindig.apache.org by "Bastian Hofmann (JIRA)" <ji...@apache.org> on 2010/07/26 17:41:51 UTC

[jira] Created: (SHINDIG-1397) TemplateParser does not put childnodes of template call into current DataContext

TemplateParser does not put childnodes of template call into current DataContext
--------------------------------------------------------------------------------

                 Key: SHINDIG-1397
                 URL: https://issues.apache.org/jira/browse/SHINDIG-1397
             Project: Shindig
          Issue Type: Bug
          Components: PHP
            Reporter: Bastian Hofmann


If you have this template

<script type="text/os-template" xmlns:myapp="http://example.com/myapp" tag="myapp:HelloWorld">
          <div style="color: ${My.MessageStyle.color}">Your message is: ${My.message}</div>
</script>

And call it like this:
<myapp:HelloWorld message="Hello World">
         <MessageStyle color="blue"/>
</myapp:HelloWorld>

The resulting HTML should be:
<div style="color: blue">Your messageis: Hello World</div>

But the current PHP Shindig does not put the childnodes into the current DataContext.

Here is the patch for this:

--- -   2010-07-26 17:30:23.000000000 +0200
+++ php/src/gadgets/templates/TemplateParser.php        2010-07-26 17:28:50.000000000 +0200
@@ -138,6 +138,7 @@
         if (isset($childNode->tagName) && ! empty($childNode->tagName)) {
           $nodeParam = ($pos = strpos($childNode->tagName, ':')) ? trim(substr($childNode->tagName, $pos + 1)) : trim($childNode->tagName);
           $this->dataContext['_os_render_nodes'][$nodeParam] = $childNode;
+         $myContext[$nodeParam] = $this->nodeAttributesToScope($childNode);
         }
       }
     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SHINDIG-1397) TemplateParser does not put childnodes of template call into current DataContext

Posted by "Paul Lindner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-1397?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Lindner resolved SHINDIG-1397.
-----------------------------------

    Fix Version/s: 2.0.0-RC1
       Resolution: Fixed

patch applied.  Thanks!


> TemplateParser does not put childnodes of template call into current DataContext
> --------------------------------------------------------------------------------
>
>                 Key: SHINDIG-1397
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1397
>             Project: Shindig
>          Issue Type: Bug
>          Components: PHP
>            Reporter: Bastian Hofmann
>             Fix For: 2.0.0-RC1
>
>
> If you have this template
> <script type="text/os-template" xmlns:myapp="http://example.com/myapp" tag="myapp:HelloWorld">
>           <div style="color: ${My.MessageStyle.color}">Your message is: ${My.message}</div>
> </script>
> And call it like this:
> <myapp:HelloWorld message="Hello World">
>          <MessageStyle color="blue"/>
> </myapp:HelloWorld>
> The resulting HTML should be:
> <div style="color: blue">Your messageis: Hello World</div>
> But the current PHP Shindig does not put the childnodes into the current DataContext.
> Here is the patch for this:
> --- -   2010-07-26 17:30:23.000000000 +0200
> +++ php/src/gadgets/templates/TemplateParser.php        2010-07-26 17:28:50.000000000 +0200
> @@ -138,6 +138,7 @@
>          if (isset($childNode->tagName) && ! empty($childNode->tagName)) {
>            $nodeParam = ($pos = strpos($childNode->tagName, ':')) ? trim(substr($childNode->tagName, $pos + 1)) : trim($childNode->tagName);
>            $this->dataContext['_os_render_nodes'][$nodeParam] = $childNode;
> +         $myContext[$nodeParam] = $this->nodeAttributesToScope($childNode);
>          }
>        }
>      }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.