I am trying to connect posts in a M2M relationship programmatically but I got the following errors:
Fatal error: Uncaught InvalidArgumentException: The element to connect with doesn't belong to the relationship definition provided. in /home/s3361/html/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/m2m/potential_association/query_posts.php:85 Stack trace: #0 /home/s3361/html/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/m2m/potential_association/query_factory.php(34): Toolset_Potential_Association_Query_Posts->__construct(Object(Toolset_Relationship_Definition), Object(Toolset_Relationship_Role_Child), Object(Toolset_Post), Array, NULL, NULL, Object(Toolset_Potential_Association_Query_Factory)) #1 /home/s3361/html/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/m2m/driver.php(39): Toolset_Potential_Association_Query_Factory->create(Object(Toolset_Relationship_Definition), Object(Toolset_Relationship_Role_Child), Object(Toolset_Post)) #2 /home/s3361/html/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/m2m/database/op in /home/s3361/html/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/m2m/potential_association/query_posts.php on line 85
There has been a critical error on your website.