Skip Navigation

[Resolved] Conditional query tags errors

This support ticket is created 3 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 7 replies, has 2 voices.

Last updated by liatG 3 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#1940815
1.png
2.png

Hi,

I've recently been having a problem when displaying results for posts on my website. Before, I used to get the "Uncaught InvalidArgumentException" error when I turned on debugging in the wp-config.php file as provided in the screenshots. I referred to your forum where I found this: https://toolset.com/forums/topic/uncaught-invalidargumentexception/.

When signed out the error also has the conditional query tags error saying some variables were called incorrectly
After adding the necessary lines of code to the wp-config.php file, the error disappeared but now no search results show. Also, there is no error_log.txt file when I check the files.

Please advise on what the issue could be and how to resolve it.

Thanks.

#1941045

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Liat,

Thank you for getting in touch.

Would you mind providing me with admin access to the site so that I can have a look at your conditional statements ?

This should point me in the direction to look. I've enabled the private fields for your next response.

Also please send me a link to the page in your screenshot.

Thanks,
Shane

#1941321

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Liat,

Thank you for the credentials, however i'm not seeing where you've sent a link to the page that contains the issue.

Once I get this I can go ahead and perform the additional checks.

Thanks,
Shane

#1941463

Here are the links

hidden link

hidden link

#1941513

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Liat,

The issue is being cause by this line here in your archive.

[wpv-conditional if="( '[wpv-post-type]' eq 'abbreviation' ) AND ( '[wpv-post-id item='@related-video.parent']' ne '' )"]Related Video: [wpv-post-link item="@related-video.parent"]<br /><br />[/wpv-conditional]
 

Specifically [wpv-post-id item='@related-video.parent'], i've checked the post relationships and there aren't any relationship with the related-video slug. This specific line of code can be found here
hidden link

Scroll to the archive content template and look at line 62. I'm assuming here that you want to get the ID of the Knitting videos. Can you confirm that this is the relationship you want to display ?
hidden link

Please let me know and we can take it from there.

Thanks,
Shane

#1941525

Yes. That's right. That's the relationship I was trying to achieve

#1942943

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Liat,

Essentially the issue is that you won't be able to pull the parent information with just the item attribute.

Given that you are using this on a search archive and the information can be from any post type, I would recommend creating a child view that lists out the knitting videos and pass the ID of the current post into this view.

As you can see below i've created an example view to list out the parent knitting videos for your posts, however Can you provide me with a link to a post that has a parent knitting video attached so that I can verify that the correct Relationship filters are being made correctly for the view.

With this it will allow you to display the Parent data however you won't be able to check the parent information in the conditional statement.

Thanks,
Shane

#1950305

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.