Tell us what you are trying to do?
We have a custom post type called Kennels, We created a trading hour repeatable group field linked to Kennels.
We are trying to create trading hours for a Kennel using a repeatable group CRED form that's located on the post. Each user needs to create different trading hours for there Kennel. We have created a view linked to the trading hours repeatable group fields and added the form in the view. When we submit the trading hour form we get the following error:
Fatal error: Uncaught InvalidArgumentException: All provided arguments for a related element must be either an ID or a WP_Post object. in /home/petfinds/public_html/petscreek.co.za/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/RelatedPosts.php:246 Stack trace: #0 /home/petfinds/public_html/petscreek.co.za/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/RelatedPosts.php(177): OTGS\Toolset\Common\Interop\Commands\RelatedPosts->set_query_by_elements(Array, 'parent') #1 /home/petfinds/public_html/petscreek.co.za/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/public_api/m2m.php(110): OTGS\Toolset\Common\Interop\Commands\RelatedPosts->__construct(0, 'single-trading-...', Array) #2 /home/petfinds/public_html/petscreek.co.za/wp-content/plugins/cred-frontend-editor/application/models/form/post.php(671): toolset_get_related_posts(0, 'single-trading-...', 'parent') #3 /home/petfinds/public_html/pet in /home/petfinds/public_html/petscreek.co.za/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/RelatedPosts.php on line 246
Thank you for the credentials.
I was able to see the issue. The problem is that the Kennel field isn't loading any of the parent posts to be attached to the form. What should happen is that you should get a select2 field that lists out all the kennels.
This isn't happening in your case. I suspect that there might be a plugin conflict of some sort.
Would you mind temporarily disabling all the non-toolset plugins and then trying again to see if this issue remains?