We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Query Add On Bug

News and General

vw000's avatar
vw000
473 posts
5 months ago
vw000's avatar vw000

Not sure if someone noticed this, but the testing for no results, per the docs: https://docs.expressionengine.com/latest/add-ons/query.html#testing-for-no-results

For the Query Add On does not work if its inside a {exp:member:custom_profile_data} tag.

It works outside those tags.

Example:

`

    {exp:member:custom_profile_data}

        {exp:query sql="SELECT something FROM exp_table WHERE member_id ='44'"}

    {if no_results} Sorry, no sports heroes here! {/if}
        {/exp:query}


    {/exp:member:custom_profile_data}

It does not work in the {exp:member:edit_profile} either. It does not give any error; it just seems to completely ignore the no results tag which means you cannot actually run anything if no results are found for a specific query. Not sure how to overcome this issue since I need to check a table and run code if a result is found or another thing if nothing is found but since the no results does not work I can’t actually check anything.

       
Tom Jaeger's avatar
Tom Jaeger
332 posts
about 5 months ago
Tom Jaeger's avatar Tom Jaeger

So I think the no_results tag is likely being processed by the member tag your calling in this example. I believe you should be able to do this as an embed, or possible a layout to avoid having the member tag process the no results.

Thanks,

-Tom Jaeger

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.