Link to a page where the issue can be seen:
doesn't exist as it is internal to us
I expected to see:
Data that gets displayed if the error doesn't show up. and it shows as long as i don't complete the database upgrade for the new plugins, but that also seems to cuase errors.
Instead, I got:
23-Aug-2022 10:48:29 Australia/Brisbane] PHP Fatal error: Uncaught InvalidArgumentException: All provided arguments for a related element must be either an ID or a WP_Post object. in /Users/zacharyfrench/Sites/BYETC_SDS/byetc_01/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/RelatedPosts.php:246
Stack trace:
#0 /Users/zacharyfrench/Sites/BYETC_SDS/byetc_01/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/RelatedPosts.php(177): OTGS\Toolset\Common\Interop\Commands\RelatedPosts->set_query_by_elements(Array, 'parent')
#1 /Users/zacharyfrench/Sites/BYETC_SDS/byetc_01/wp-content/plugins/types/vendor/toolset/toolset-common/inc/public_api/m2m.php(110): OTGS\Toolset\Common\Interop\Commands\RelatedPosts->__construct('0', 'assessment-pack...', Array)
#2 /Users/zacharyfrench/Sites/BYETC_SDS/byetc_01/wp-content/plugins/byetc/students/vet_assignments.php(217): toolset_get_related_posts('0', 'assessment-pack...', Array)
#3 /Users/zacharyfrench/Sites/BYETC_SDS/byetc_01/wp-includes/class-wp-hook.php(307): getcoursedata('')
#4 /Users/zacharyfrench/Sites/BYETC_SDS/byetc_01/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
#5 /Users/zacharyfrench/Sites/BYETC_SDS/byetc_01/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
#6 /Users/zacharyfrench/Sites/BYETC_SDS/byetc_01/wp-admin/admin-ajax.php(187): do_action('wp_ajax_getcour...')
#7 {main}
thrown in /Users/zacharyfrench/Sites/BYETC_SDS/byetc_01/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/RelatedPosts.php on line 246
Hello. Thank you for contacting the Toolset support.
Do you have any other place where you added the function that is used to get related posts?
I see the following path - did you use the toolset_get_related_posts() function within the following file?
- plugins/byetc/students/vet_assignments.php
If yes, it seems its custom plugin develop by you and from there the file vet_assignments.php(217) line number 217 looks like the error is coming from. if what I say is true then can you please investigate why its not passign post ID to toolset_get_related_posts() function.