Closed jeiseman closed 1 year ago
Created pull request to fix this problem. Branch main/6979-fix-this-problem
I'll make sure it returns 0 in the SQL context here since we use a special handler for this case already anyways.
I see there's a function pods_evaluate_tags_sql but that function is not called (pods_evaluate_tag is called). I'm not sure if that's the handler you're referring to.
Description
If I have a customized WHERE for the relationship options for as relationship field and it contains something like this:
author.id = {@user.ID}
It will result in a illegal MYSQL query when it is called for someone that is not logged in (it will have an error due to the following in the query):... WHERE author.id =
Since {@user.id} will return null instead of returning a 0. The fix for this is in includes/data.php in the function pods_v on line 676 for case 'user' it has an if statement that checks if the user is logged in. There should be an else statement that sets $output to 0.Version
2.9.10.2
Testing Instructions
Screenshots / Screencast
No response
Possible Workaround
Add the following code snippet to workaround the problem: `add_filter('pods_evaluate_tag', 'my_pod_evaluate_tag', 10, 2);
function my_pod_evaluate_tag($value, $tag ) { if ( $tag[0] == 'user' && $tag[1] == 'ID' && null === $value ) ) return 0; return $value; }`
Site Health Information
Pods Package
No response