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

include template issue #43

Closed
greevex opened this issue May 27, 2015 · 2 comments
Closed

include template issue #43

greevex opened this issue May 27, 2015 · 2 comments

Comments

@greevex
Copy link

greevex commented May 27, 2015

Last version of the Smarty has broken our logic. It renders only last "included template" inside "foreach" cycle. In the example you can see, that template files may be different, but it renders all items as last item.

TEMPLATE

{foreach from=$mapper->getMap() key="fieldKey" item="field"}
    <tr>
        <td>{$field.name}</td>
        <td>{include file="forms/type_{$field.formType}.tpl" fieldName=$fieldKey field=$field}</td>
    </tr>
{/foreach}

RESULT ON version 3.2.21 (and it's expected result)

<tr>
    <td>name1</td>
    <td>    
        <select id="name1" name="item[name1][]" class="form-control" required="">
            <option value="1">Yes</option>
            <option value="0">Don't know</option>
            <option value="-1">No</option>
        </select>
    </td>
</tr>
<tr>
    <td>name2</td>
    <td><input type="text" class="form-control" id="name2" name="item[name2]" value=""></td>
</tr>
<tr>
    <td>name3</td>
    <td><input type="text" class="form-control" id="name3" name="item[name3]" value=""></td>
</tr>

RESULT ON version 3.2.24 (actual and wrong result)

<tr>
    <td>name1</td>
    <td><input type="text" class="form-control" id="name3" name="item[name3]" value=""></td>
</tr>
<tr>
    <td>name2</td>
    <td><input type="text" class="form-control" id="name3" name="item[name3]" value=""></td>
</tr>
<tr>
    <td>name3</td>
    <td><input type="text" class="form-control" id="name3" name="item[name3]" value=""></td>
</tr>
uwetews added a commit that referenced this issue May 27, 2015
@uwetews
Copy link
Contributor

uwetews commented May 27, 2015

The fix is now in dev-master

@uwetews uwetews closed this as completed May 27, 2015
@greevex
Copy link
Author

greevex commented May 27, 2015

Thank you very much!

think-mcunanan pushed a commit to think-mcunanan/smarty that referenced this issue Mar 22, 2023
…sts-out-of-range-reservation-show-error-message

Redmine-#5226: [かんざし連携] 予約が営業時間外となる場合、エラーメッセージを表示する
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