Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Multiple Channel Categories tags combining output

Status Resolved
Add-on / Version Publisher 1.0.15
Severity Critical
EE Version 2.7.2

Christian Maloney

Dec 12, 2013

I have 2 category groups (ids 8 & 9) assigned to the same channel (although that doesn’t matter from my testing) and I want to output a separate list of each group in the same template.  So I have:

<select>
{exp:channel:categories channel="support_download" category_group="8" show_empty="no" style="linear"}
<option value="{category_url_title}">{category_name}</option>
{/exp:channel:categories}
</select>

<select>
{exp:channel:categories channel="support_download" category_group="9" show_empty="no" style="linear"}
<option value="{category_url_title}">{category_name}</option>
{/exp:channel:categories}
</select>

I should get one list with c5t, CL910 and F5t and another list with only Windows 7 like below:

<select>
<option value="c5t">c5t</option>
<option value="cl910">CL910</option>
<option value="f5t">F5t</option>
</select>

<select>
<option value="windows-7">Windows 7</option>
</select>

But the second tag is outputting all of the categories combined:

<select>
<option value="c5t">c5t</option>
<option value="cl910">CL910</option>
<option value="f5t">F5t</option>
</select>

<select>
<option value="c5t">c5t</option>
<option value="cl910">CL910</option>
<option value="f5t">F5t</option>
<option value="windows-7">Windows 7</option>
</select>

I dumped the $this->cat_array variable on line 382 of Publisher_channel_categories.php and Publisher is definitely loading the categories combined into one array in the second tag.  I also tried the same tags without publisher enabled and they worked as expected (There was no combining of categories).  I test with the tags exactly as written above with nothing else in the template.

#1

BoldMinded (Brian)

Christian, thanks for sending this. I won’t be able to dive into this until this weekend though.

#2

Christian Maloney

I also tried loading both tags from separate embeds and still got the combined categories.

#3

Christian Maloney

No worries, I can work around it for now. Let me know if you need any other info or if there is some additional testing I can do that would help.

#4

BoldMinded (Brian)

Easy fix. On line 243 of that file just before the foreach loop add this:

$this->cat_full_array = array();
#5

Christian Maloney

Glad it was an easy one. Thanks!

Login to reply