Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

for loop broken? #90

Closed
ophian opened this issue Sep 17, 2015 · 3 comments
Closed

for loop broken? #90

ophian opened this issue Sep 17, 2015 · 3 comments

Comments

@ophian
Copy link

ophian commented Sep 17, 2015

I am testing upcoming Smarty 3.1.28-dev with the Sept 15 codebase. And found a smarty bug or changed behaviour, since the 3.1.27 release works well with it, without any error or notice for the image directory loop not being interlaced (stairs) any more.

    <ul id="library_dirs" class="option_list">
    {foreach $folders as $folder}
        {if ! $folder@first}
            {if $folder.depth > $priorDepth}
                <ul>
            {/if}

            {if $folder.depth < $priorDepth}
                </li>
                {for $i=$folder.depth+1 to $priorDepth}
                    </ul></li>
                {/for}
            {/if}

            {if $folder.depth == $priorDepth}
                </li>
            {/if}
        {/if}

        {$priorDepth=$folder.depth}

        <li>
            <div class="clearfix {cycle values="odd,even"}">
                <span class="folder_name"><span class="icon-folder-open"></span> {$folder.name}</span>
            </div>
    {/foreach}
    </li>
    {for $i=1 to $priorDepth}
        </ul></li>
    {/for}
    </ul>

I assume its the for not being read again... or such... (The code looks a bit strange, but it worked, though.;-) )
Array looks like

[0] => Array
        (
            [name] => trendy
            [depth] => 1
            [relpath] => trendy/
            [directory] => 1
        )

    [1] => Array
        (
            [name] => total
            [depth] => 2
            [relpath] => trendy/total/
            [directory] => 1
        )

    [2] => Array
        (
            [name] => total2
            [depth] => 2
            [relpath] => trendy/total2/
            [directory] => 1
        )

    [3] => Array
        (
            [name] => modes
            [depth] => 1
            [relpath] => modes/
            [directory] => 1
        )

etc
@uwetews

@ophian
Copy link
Author

ophian commented Sep 17, 2015

No sorry, it seems to be the @first which isn't being read. If I disable the {if !$folder@first} ... {/if} it works.

@ophian
Copy link
Author

ophian commented Sep 17, 2015

Again, Its the ! which isn't working. Using not instead is doing well! :)

EDIT I leave that for the WE. Its somehow weird at all.

@uwetews
Copy link
Contributor

uwetews commented Sep 17, 2015

Thanks for bringing this up.
The fix is now in the master branch.

@uwetews uwetews closed this as completed Sep 17, 2015
ophian added a commit to s9y/Serendipity that referenced this issue Sep 19, 2015
and reported a bug in upcoming smarty 3.1.28-dev smarty-php/smarty#90

References #364
think-mcunanan pushed a commit to think-mcunanan/smarty that referenced this issue Mar 22, 2023
…-usage-of-address1_1-column

Redmine #5460: remove usage of address1_1 column
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants