Nigel,
I think I found the issue. I have a custom code that helps me populate the grandparent author's email to the post so that CRED's form notification system can send an email on submit. It seems to be causing a conflict.
The code:
add_action('cred_save_data', 'populate_expert_review_requester_email_on_expert_review',10,2);
function populate_expert_review_requester_email_on_expert_review($post_id, $form_data)
{
// if a specific form
if ($form_data['id']==10447 || $form_data['id']==10448)
{
$expert_match_id = toolset_get_related_post($post_id, 'expert-match-to-expert-review', 'parent', 'publish');
$expert_review_request_id = toolset_get_related_post($expert_match_id, 'expert-review-request-to-expert-match', 'parent', 'publish');
$expert_review_request = get_post( $expert_review_request_id);
$expert_review_requester_id = $expert_review_request->post_author;
$expert_review_requester_email = the_author_meta('user_email', $expert_review_requester_id);
update_post_meta($post_id,'wpcf-expert-review-requester-email', $expert_review_requester_email);
}
}
The log:
[14-Jan-2021 14:30:08 UTC] PHP Fatal error: Uncaught InvalidArgumentException: All provided arguments for a related element must be either an ID or a WP_Post object. in /srv/htdocs/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/RelatedPosts.php:246
Stack trace:
#0 /srv/htdocs/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, 'child')
#1 /srv/htdocs/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/public_api/m2m.php(159): OTGS\Toolset\Common\Interop\Commands\RelatedPosts->__construct(0, 'expert-review-r...', Array)
#2 /srv/htdocs/wp-content/toolset-customizations/add-expert-review-requester-email-to-expert-review.php(16): toolset_get_related_post(0, 'expert-review-r...', 'parent', 'publish')
#3 /wordpress/core/5.6/wp-includes/class-wp-hook.php(287): populate_expert_review_requester_email_on_expert_review(11391, Array)
#4 /wordpress/core/5.6/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
#5 /wordpress/core/5.6/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
#6 /srv/htdocs/wp-content/plugins/cred-frontend-editor/application/models/form/post.php(639): do_action('cred_save_data', 11391, Array)
#7 /srv/htdocs/wp-content/plugins/cred-frontend-editor/application/models/form/base.php(434): CRED_Form_Post->save_form(11391)
#8 /srv/htdocs/wp-content/plugins/cred-frontend-editor/application/controllers/form_builder_base.php(40): CRED_Form_Base->print_form()
#9 /srv/htdocs/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/classes/CRED_Helper.php(1855): CRED_Form_Builder_Base->get_form(10447, '')
#10 /srv/htdocs/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/classes/CRED_Helper.php(2451): CRED_Helper::cred_form('submit-expert-r...', '')
#11 /wordpress/core/5.6/wp-includes/shortcodes.php(343): CRED_Helper::credFormShortcode(Array, '', 'cred_form')
#12 [internal function]: do_shortcode_tag(Array)
#13 /wordpress/core/5.6/wp-includes/shortcodes.php(218): preg_replace_callback('/\\[(\\[?)(cred_f...', 'do_shortcode_ta...', '[cred_form form...')
#14 /srv/htdocs/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/autoloaded/interop/handler/elementor/widgets/base.php(124): do_shortcode('[cred_form form...')
#15 /srv/htdocs/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/autoloaded/interop/handler/elementor/widgets/form/form.php(116): OTGS\Toolset\Common\Interop\Handler\Elementor\ToolsetElementorWidgetBase->render_frontend_widget()
#16 /srv/htdocs/wp-content/plugins/elementor/includes/base/controls-stack.php(1894): OTGS\Toolset\Common\Interop\Handler\Elementor\FormWidget->render()
#17 /srv/htdocs/wp-content/plugins/elementor/includes/base/widget-base.php(530): Elementor\Controls_Stack->render_by_mode()
#18 /srv/htdocs/wp-content/plugins/elementor/includes/base/widget-base.php(660): Elementor\Widget_Base->render_content()
#19 /srv/htdocs/wp-content/plugins/elementor/includes/base/element-base.php(644): Elementor\Widget_Base->_print_content()
#20 /srv/htdocs/wp-content/plugins/elementor/includes/base/element-base.php(864): Elementor\Element_Base->print_element()
#21 /srv/htdocs/wp-content/plugins/elementor/includes/base/element-base.php(644): Elementor\Element_Base->_print_content()
#22 /srv/htdocs/wp-content/plugins/elementor/includes/base/element-base.php(864): Elementor\Element_Base->print_element()
#23 /srv/htdocs/wp-content/plugins/elementor/includes/base/element-base.php(644): Elementor\Element_Base->_print_content()
#24 /srv/htdocs/wp-content/plugins/elementor/core/base/document.php(1252): Elementor\Element_Base->print_element()
#25 /srv/htdocs/wp-content/plugins/elementor/core/base/document.php(889): Elementor\Core\Base\Document->print_elements(Array)
#26 /srv/htdocs/wp-content/plugins/elementor/includes/frontend.php(975): Elementor\Core\Base\Document->print_elements_with_wrapper(Array)
#27 /srv/htdocs/wp-content/plugins/elementor/includes/frontend.php(889): Elementor\Frontend->get_builder_content(10649)
#28 /wordpress/core/5.6/wp-includes/class-wp-hook.php(287): Elementor\Frontend->apply_builder_in_content('<h1>Submit Expe...')
#29 /wordpress/core/5.6/wp-includes/plugin.php(212): WP_Hook->apply_filters('<h1>Submit Expe...', Array)
#30 /wordpress/core/5.6/wp-includes/post-template.php(253): apply_filters('the_content', '<h1>Submit Expe...')
#31 /srv/htdocs/wp-content/themes/astra/template-parts/content-page.php(59): the_content()
#32 /wordpress/core/5.6/wp-includes/template.php(732): require('/srv/htdocs/wp-...')
#33 /wordpress/core/5.6/wp-includes/template.php(676): load_template('/srv/htdocs/wp-...', false, Array)
#34 /wordpress/core/5.6/wp-includes/general-template.php(204): locate_template(Array, true, false, Array)
#35 /srv/htdocs/wp-content/themes/astra/inc/class-astra-loop.php(109): get_template_part('template-parts/...', 'page')
#36 /wordpress/core/5.6/wp-includes/class-wp-hook.php(287): Astra_Loop->template_parts_page('')
#37 /wordpress/core/5.6/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
#38 /wordpress/core/5.6/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
#39 /srv/htdocs/wp-content/themes/astra/inc/class-astra-loop.php(199): do_action('astra_page_temp...')
#40 /srv/htdocs/wp-content/themes/astra/inc/class-astra-loop.php(174): Astra_Loop->loop_markup(true)
#41 /wordpress/core/5.6/wp-includes/class-wp-hook.php(287): Astra_Loop->loop_markup_page('')
#42 /wordpress/core/5.6/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
#43 /wordpress/core/5.6/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
#44 /srv/htdocs/wp-content/themes/astra/inc/core/theme-hooks.php(267): do_action('astra_content_p...')
#45 /srv/htdocs/wp-content/themes/astra/page.php(32): astra_content_page_loop()
#46 /wordpress/core/5.6/wp-includes/template-loader.php(106): include('/srv/htdocs/wp-...')
#47 /wordpress/core/5.6/wp-blog-header.php(19): require_once('/wordpress/core...')
#48 /wordpress/core/5.6/index.php(17): require('/wordpress/core...')
#49 {main}
thrown in /srv/htdocs/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/RelatedPosts.php on line 246