MB Relationships WordPress database error
Support › MB Relationships › MB Relationships WordPress database error
- This topic has 3 replies, 2 voices, and was last updated 1 year, 3 months ago by
Peter.
-
AuthorPosts
-
March 24, 2024 at 1:42 PM #44981
Michele Schembri
ParticipantHi, 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_fromI am using:
PHP 8.1.0
WordPress 6.2.4
MB Relationships 1.11.3Any help would be greatly appreciated.
Thanks!
March 25, 2024 at 11:01 PM #45004Peter
ModeratorHello,
I don't see any issue with the relationship code. Please share your site credentials via this contact form https://metabox.io/contact/
I will take a look.July 29, 2024 at 12:45 AM #46037Michele Schembri
ParticipantHi,
sorry for the delay. This issue is only occurring on my local environment, and I don't believe I can share that, however it's holding me from continuing development.
If it helps I use MySQL 8.0.27.
Thanks.
July 30, 2024 at 10:38 PM #46055Peter
ModeratorHello Michele,
Can you please migrate your local site to an online staging site with the same environment and share the credentials so I can check the issue?
-
AuthorPosts
- You must be logged in to reply to this topic.