Fixes user search if no searchable user option exists/is enabled
authorMatthias Schmidt <gravatronics@live.com>
Tue, 4 Feb 2014 06:25:58 +0000 (07:25 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 4 Feb 2014 06:25:58 +0000 (07:25 +0100)
com.woltlab.wcf/templates/userSearch.tpl

index c941f004fd2ebdf5da1eb6c1f6126a1d72eb4a83..ba522b247f36321937ba76c21975e31ee504a0d8 100644 (file)
                        {event name='generalFields'}
                </fieldset>
                
-               {foreach from=$optionTree[0][categories] item=category}
-                       <fieldset>
-                               <legend>{lang}wcf.user.option.category.{@$category[object]->categoryName}{/lang}</legend>
-                               {hascontent}<p>{content}{lang __optional=true}wcf.user.option.category.{@$category[object]->categoryName}.description{/lang}{/content}</p>{/hascontent}
-                               
-                               {include file='userOptionFieldList' options=$category[options] langPrefix='wcf.user.option.'}
-                       </fieldset>
-               {/foreach}
+               {if !$optionTree|empty}
+                       {foreach from=$optionTree[0][categories] item=category}
+                               <fieldset>
+                                       <legend>{lang}wcf.user.option.category.{@$category[object]->categoryName}{/lang}</legend>
+                                       {hascontent}<p>{content}{lang __optional=true}wcf.user.option.category.{@$category[object]->categoryName}.description{/lang}{/content}</p>{/hascontent}
+                                       
+                                       {include file='userOptionFieldList' options=$category[options] langPrefix='wcf.user.option.'}
+                               </fieldset>
+                       {/foreach}
+               {/if}
        </div>
        
        {event name='fieldsets'}