ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Issues with related entries no_related_entries conditional

July 12, 2011 6:52am

Subscribe [1]
  • #1 / Jul 12, 2011 6:52am

    Lima Bean

    13 posts

    Hi Everyone

    I’m trying to use the the {no_related_entries} conditional to display a message if no entry is related, as per the documentation( http://ellislab.com/expressionengine/user-guide/modules/channel/related_entries.html#cond_no_related_entries ). This doesn’t seem to be working properly. It seems that if it accesses the related entries tag at all it spits out {REL[95][image_2]BIZNPtCNREL} into my template, and doesn’t display the {no_related_entries} content. Any ideas? Below is a simplified version of my code:

    {exp:channel:entries channel="gallery" limit="1" category="{embed:page_category}" url_title="{embed:url_title}" dynamic="no"}
    
    {related_entries id="image_2"}
    {if no_related_entries}No Entries{/if}
    
    {title}
    {gallery_image}
    
    {/related_entries}
    
    {/exp:channel:entries}

    Thanks
    Jason

  • #2 / Jul 12, 2011 6:58am

    Lima Bean

    13 posts

    I’m using v2.1.1 by the way.

  • #3 / Jul 12, 2011 6:08pm

    Kevin Smith

    4784 posts

    Hmm… this is quite odd, and not something I’m going to be able to replicate on my end. Be on the lookout for an email from me, and I’ll get in there to see what’s going on first-hand!

  • #4 / Jul 13, 2011 4:36am

    Lima Bean

    13 posts

    Upon further investigation I’ve noticed that this functionality works fine initially, it’s only once I’ve “unrelated” an entry that it gives problems. As far as the database goes before anything is related the “image_2” field’s DB value is set to “0”, once an entry is related it contains some integer(in this case it was “124”), once I have unrelated the entry, i.e. should be set back to “0”, it seems to remain with a value of “124”. A bug perhaps?

  • #5 / Jul 14, 2011 1:09am

    John Henry Donovan

    12339 posts

    Lima Bean,

    If you clear your cache after unrelating entry does it get set back to 0?

    Tools > Data > Clear Caching

    Can I also get you to upgrade to the latest version, EE2.2.1 please

  • #6 / Jul 14, 2011 5:23am

    Lima Bean

    13 posts

    Hi John

    Thanks for your reply, clearing the cache didn’t seem to make any difference but I’ve now updated to 2.2.1 and that seems to have fixed it.

  • #7 / Jul 14, 2011 11:37pm

    Lisa Wess

    20502 posts

    That was definitely my next recommendation, Lima Bean.  Glad that the update got you fixed up.  If anything else comes up, please start a new thread to let us know!

    Thank you.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases