Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Trannie 3 posts 24 karma points
    May 17, 2010 @ 23:57
    Trannie
    1

    Missing recursive bool parameter comes through as its advanced macro syntax

    Hi, this is my first post.  I used the IRC channel freenode#umbraco to some good effect on my last Umbraco project, but there's really not much activity at this point, so I've stopped in here :)  I invite everyone over to the IRC channel if you're interested in semi-realtime Umbraco chat.  My nick's nottwo. 

    Thanks!  On to my current issue:

    I have a macro called ListProducts that has a boolean parameter called AllBrands and I call it from a document masterpage with:

    <umbraco:macro alias="ListProducts" AllBrands="[$AllBrands]" runat="server" />

    Either in that document or one of its ancestors is a checkbox field called AllBrands.


    In my macro, I test the value of /macro/AllBrands and modify its behaviour.  I've found that when the document or its ancestor has the AllBrands checkbox checked, the macro parameter comes in as '1'.  If the AllBrands checkbox is not checked, /macro/AllBrands comes in as '[$AllBrands]', when I expected it to be either 0 or the empty string.


    I've tried modifying the macro call to try to provide the empty string as a default if AllBrands is not checked, but /macro/AllBrands still holds the value of the unreplaced macro parameter string. In fact, giving a non-empty alternate replacement string also isn't passed to my macro. I still get '[$AllBrands]' passed to my macro when AllBrands is not checked anywhere in the node tree:

    <umbraco:macro alias="ListProducts" AllBrands="[$AllBrands]," runat="server" />
    <umbraco:macro alias="ListProducts" AllBrands="[$AllBrands],foo" runat="server" />

    Is this the expected behaviour?  I can test /macro/AllBrands against the value '[$AllBrands]' (and that's what I'm doing, for now), but this doesn't seem quite right.  Any thoughts would be welcome.

     

    Thanks!

    trannie

    This is all running on:

    Windows Server 2008

    IIS 7

    .NET 3.5

    Umbraco 4.0.3

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    May 18, 2010 @ 09:21
    Dirk De Grave
    0

    Trannie,

    I've seen this behaviour on a recent project as well, thougth it had something to do with my current umbraco setup, but now that you're experiencing the same issue, I'd definitely report this on Codeplex to get it solved. Can you do that please. Also make sure to include a repro path and enviroment specs so core team can repro and resolve this bug...

     

    Don't forget to add a link to the codeplex issue so others can go and vote for it.

     

    Cheers,

    /Dirk

     

     

  • Trannie 3 posts 24 karma points
    May 18, 2010 @ 15:57
    Trannie
    0

    Hi Dirk,

    I did open an issue on CodePlex, http://umbraco.codeplex.com/WorkItem/View.aspx?WorkItemId=27097 ; I'm not sure what a repro path is.  Hopefully I included enough information.

    I saw another issue that looks like it's the same issue: http://umbraco.codeplex.com/WorkItem/View.aspx?WorkItemId=26959

     

    trannie

Please Sign in or register to post replies

Write your reply to:

Draft