ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE 1.6.9 $TMPL->var_pair bug

June 01, 2010 3:07pm

Subscribe [2]
  • #1 / Jun 01, 2010 3:07pm

    Brad Street

    239 posts

    I’m working on a module. The module allows similar var_pairs to be passed in with parameters - there will usually be nothing between the var pairs. Example:

    {exp:linklockerpro}
    {link  path="/someplace/another_dir/this_dir/LinkLockerFreeV15.zip" expires="180" label="delete me"}
    {ll_link path="/proj_dload_dir/linklocker_free/LinkLockerFreeV15.zip" expires="180" label="delete me"}
    {/ll_link}
    {ll_link_global path="/someplace/another_dir/this_dir/LinkLockerFreeV15.zip" expires="2010-06-02" label="delete me" group="global"}
    {/ll_link}
    {ll_link path="/someplace/another_dir/this_dir/LinkLockerFreeV15.zip" expires="1" label="delete" anotherparam='false'}
    {/notaclosingtag}
    {/exp:linklockerpro}

    When the above code is parsed by the module, the last item (with a label of “delete”) is present in the $TMPL->var_pair even though it has an invalid closing tag (notice “notaclosingtag”). I am inserting things into the database before outputting to the screen. Therefore, even though the variable will not output correctly when the page is viewed, it will have an entry in my database tables.
    Expected behavior would be that $TMPL->var_pair would check to make sure there was a closing tag for the pair before adding it to the array.

  • #2 / Jun 22, 2010 10:26am

    Robin Sowell

    13255 posts

    Brad- I’m a little confused about the above example- why/what is {/notclosingtag}?  It looks… like a stray tag and like it doesn’t follow the expected format.

    Is it possible to walk me through an example w/core code (or a simple mock up) so that I can see the problem in action?

  • #3 / Jun 22, 2010 10:42am

    Brad Street

    239 posts

    It is to demonstrate that of there is a typo in a closing tag, it is still parsed as valid. This means that any code written to act on a tag pair will execute correctly, but will fail to render properly when the module tries to replace the tag. I’ve already fixed the issue in my code, but thought the bug may be something that you guys would want to address.

  • #4 / Jul 14, 2010 11:26am

    Robin Sowell

    13255 posts

    Sorry Brad- I was never able to replicate this- plopped this into a template- and varied the closing {/date_heading} tag w/ {/notclosingtag} instead.

    {exp:weblog:entries limit="15"}
    
    {date_heading}
    
    <h1>{entry_date format="%Y %m %d"}</h1>
    
    {/date_heading}
    
    <h3>{title}</h3>
    
    <p>{categories}</p>
    
    <p>{category_image} <a href="http://{path=weblog/index}">{category_name}</a></p>
    
    <p>{/categories}</p>
    
    <p><div class="date">Posted on {entry_date format="%M %d, %Y - %h:%i %A"}</div></p>
    
    <p><br />
    {paginate}<br />
    Page {current_page} of {total_pages} pages {pagination_links}<br />
    {/paginate}</p>
    
    <p>{/exp:weblog:entries}

    In the weblog entries function right off the bat I did a var_dump($TMPL->var_pair); exit; - bad tag, date_heading wasn’t included in the array.  Good tag it was.  I won’t swear there’s not something up- it’s just looking pretty obscure from my testing.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases