I’ve discovered an apparent bug where, if a channel:entries tag returns no results AND is the first channel:entries tag within a switchee case, it will disappear entirely—not even showing its if_no_results content.
I’m running EE 2.2.2 and Switchee 2.0.2 beta. Here’s my test page:
{exp:switchee variable = '{segment_2}' parse='inward'} {case default='yes'}
{!-- c:e tag 1 --} {exp:channel:entries channel="channel_1" username="bob"} channel entries tag 1 {if no_results} channel entries tag 1 [no results] {/if} {/exp:channel:entries}
{!-- c:e tag 2 --} {exp:channel:entries channel="channel_2" username="bob"} channel entries tag 2 {if no_results} channel entries tag 2 [no results] {/if} {/exp:channel:entries}
{!-- c:e tag 3 --} {exp:channel:entries channel="channel_3" username="bob"} channel entries tag 3 {if no_results} channel entries tag 3 [no results] {/if} {/exp:channel:entries}
{/case} {/exp:switchee}
- If c:e tag 1 returns an entry for our user bob, all tags display correctly, whether bob has any entries for the other channels or not.
- If c:e tag 1 returns no results, it does not display anything, not even the no_results content. All other tags display correctly, regardless of results.
- If all three tags return no results, you can change the order around and whichever is first will not display.
- If you remove the switchee statement, all the c:e tags display correctly.
And the really weird one:
- As in the first example, if c:e tag 1 has results but tag 3 does not, everything is fine. But if you duplicate tag 3 and place a copy of it before tag 1 (i.e. first within the switchee case), neither copy of tag 3 will display.
|