Bug #23296 See Comments

Relationship count throws an error when parsed through an if statement where there is no relationship, what I had to do was enclose the statement within strings.

Version: 3.5.11 Reporter: Triad

This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report

When doing an IF statement, to see if the count is above 0 or not, I get a Expression Engine Error “Something has gone wrong and this URL cannot be processed at this time.”

My expected code to write - {if software_testimonials:count > 0} do this {/if} My trail and error #1 - {if {software_testimonials:count} > 0} do this {/if} My trail and error #2 - {if {software_testimonials:count} > “0”} do this {/if}

My solution - {if "{software_testimonials:count}” > “0”} do this {/if}

  • The count variable will always be above zero and can only be used within a relationship tag pair, so I’m not sure the conditional is helpful. If you’re trying to see if there are any entries inside a relationship field, you may want to use software_testimonials:total_results instead.

    Kevin Cupp
    01st December, 2017 at 10:02am
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases