Hi, I am using MB Blocks to link two CPTs, Operator, & Regulator. Here is how I am defining the Relationship:
MB_Relationships_API::register([
'id' => 'operator_to_regulator',
'from' => [
'object_type' => 'post',
'post_type' => 'operator',
'meta_box' => [
'title' => 'Is regulated by:',
],
],
'to' => [
'object_type' => 'post',
'post_type' => 'regulator',
'field' => [
'query_args' => [
'post_status' => array('publish', 'draft', 'private')
],
],
'meta_box' => [
'title' => 'Regulates the following operators:',
],
],
]);
Here's the error I am getting:
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) WHERE 1=1 AND wp_posts.post_type = 'regulator' AND ((wp_posts.post_statu' at line 2]
SELECT wp_posts.* , mbr.from FROM wp_posts INNER JOIN wp_mb_relationships AS mbr ON (mbr.to = wp_posts.ID AND mbr.type = 'operator_to_regulator' AND mbr.from IN ()) WHERE 1=1 AND wp_posts.post_type = 'regulator' AND ((wp_posts.post_status = 'publish' OR wp_posts.post_status = 'future' OR wp_posts.post_status = 'draft' OR wp_posts.post_status = 'pending' OR wp_posts.post_status = 'auto-draft' OR wp_posts.post_status = 'private')) GROUP BY mbr.from, wp_posts.ID ORDER BY mbr.order_from
I am using:
PHP 8.1.0
WordPress 6.2.4
MB Relationships 1.11.3
Any help would be greatly appreciated.
Thanks!