I have a relationship with 2 CPT. Using View, each CPT shows up fine, but when I attempt to get its relation I get a SQL Error.
[You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) WHERE 1=1 AND wp_posts.post_type = 'film' AND ((wp_posts.post_status ...' at line 2]
SELECT wp_posts.ID , mbr.to AS
mbr_filmmaker-to-film_toFROM wp_posts INNER JOIN wp_mb_relationships AS mbr ON (mbr.from = wp_posts.ID AND mbr.type = 'filmmaker-to-film' AND mbr.to IN ()) WHERE 1=1 AND wp_posts.post_type = 'film' AND ((wp_posts.post_status = 'publish')) GROUP BY
mbr_filmmaker-to-film_to, wp_posts.ID ORDER BY wp_posts.post_date DESC
The error happens when I try to to get_posts.
{% set filmmaker_args = { post_type: 'Filmmaker', posts_per_page: 10} %}
{% set filmmakers = mb.get_posts( filmmaker_args ) %}
{% for filmmaker in filmmakers %}
<a href="{{ mb.get_the_permalink( filmmaker.ID ) }}">{{ filmmaker.post_title }} and {{ filmmaker.ID }}</a>
{% set film_args = { post_type: 'Film', nopaging: true, relationship: {id: 'filmmaker-to-film', from: filmmaker.ID} } %}
{% set films = mb.get_posts( film_args ) %}
{% endfor %}