Skip to content

Commit

Permalink
cherry-pick: Fix possible circular reference for category tree and fo…
Browse files Browse the repository at this point in the history
…lder tree thelia#2041
  • Loading branch information
gillesbourgeat committed Apr 29, 2016
1 parent 1eee3e4 commit fc745db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 2.2.3

- (related to #2041) Fix possible circular reference for category tree and folder tree
- (related to #2017) Add constraint of unicity in create and update hook form
- (related to #2012) Checking MySQL version to set sql_mode automatically, this fixed the compatibility with MySQL > 5.6 for modes `STRICT_TRANS_TABLES`, `NO_ENGINE_SUBSTITUTION`
- (related to #2010) Improve product price edition tab
Expand Down
6 changes: 5 additions & 1 deletion templates/backOffice/default/category-edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,12 @@
{custom_render_form_field field='parent'}
<select {form_field_attributes field='parent' extra_class="form_control"}>
<option value="0">{intl l="Top level"}</option>
{$excludeCategories = []}
{loop name="exclude-categories" type="category" parent=$category_id}
{$excludeCategories[] = $ID}
{/loop}
{$myparent=$PARENT}
{loop name="cat-parent" type="category-tree" visible="*" category="0"}
{loop name="cat-parent" type="category-tree" visible="*" category="0" exclude={','|implode:$excludeCategories}}
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px" {if $myparent == $ID}selected="selected"{/if} {if $category_id == $ID}disabled="disabled"{/if}>{$TITLE}</option>
{/loop}
</select>
Expand Down
8 changes: 5 additions & 3 deletions templates/backOffice/default/folder-edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@

<select id="{$label_attr.for}" required="required" name="{$name}" class="form-control">
<option value="0">{intl l="Top level"}</option>

{$excludeFolders = []}
{loop name="exclude-folders" type="folder" parent=$folder_id}
{$excludeFolders[] = $ID}
{/loop}
{$myparent=$PARENT}
{loop name="fold-parent" type="folder-tree" visible="*" folder="0"}
{loop name="fold-parent" type="folder-tree" visible="*" folder="0" exclude={','|implode:$excludeFolders}}
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px" {if $myparent == $ID}selected="selected"{/if} {if $folder_id == $ID}disabled="disabled"{/if}>{$TITLE}</option>
{/loop}

</select>
</div>
{/form_field}
Expand Down

0 comments on commit fc745db

Please sign in to comment.