Skip Navigation

[Resolved] new version of plugin reports a PHP fatal error when loads

This support ticket is created 3 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 3 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#2443027

I am trying to:
Load VET data

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

#2443277

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

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.