Skip Navigation

[Resolved] PHP Fatal error: Uncaught Error: types/application/controllers/m2m. php:52

This support ticket is created 6 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 58 replies, has 3 voices.

Last updated by mohammadD 6 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#915201

Hi i got this error at the log:

PHP Fatal error:
Uncaught Error: Call to a member function is_intermediary() on null in
/home/xxx/public_html/yyy/content/plugins/types/application/controllers/m2m.php:52

Stack trace:
#0 /home/xxx/public_html/yyy/wp-includes/class-wp-hook.php(286): Types_M2M->load_intermediary_edit('')
#1 /home/xxx/public_html/yyy/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(Object(Types_Page_Extension_Edit_Post), Array)
#2 /home/xxx/public_html/yyy/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#3 /home/xxx/public_html/yyy/wp-admin/admin.php(332): do_action('load-post.php')
#4 /home/xxx/public_html/yyy/wp-admin/post.php(12): require_once('/home/sgchildc/...')
#5 {main}
thrown in /home/xxx/public_html/yyy/content/plugins/types/application/controllers/m2m.php on line 52

I hope this is a known issue

It triggered whenever some of the plugin settings is opened.

#915550

Hello,

There isn't same report on this, please try these:
1) Deactivate other plugins (except Types plugin) and switch to wordpress default theme 2017, and test again
2) provide a database dump file (ZIP file) of your website in below "private detail box", I need to duplicate same problem and debug it in my localhost, thanks.

And describe detail steps to see the problem, thanks

#915554

I just notice there is more warning

[19-Jun-2018 12:21:19 UTC] PHP Warning: in_array() expects parameter 2 to be array, null given in /home/xxx/public_html/yyy/content/plugins/types-access/includes/Helper.php on line 1621
[19-Jun-2018 12:21:19 UTC] after table insertion
[19-Jun-2018 12:21:19 UTC] current version is null
[19-Jun-2018 12:24:10 UTC] PHP Warning: in_array() expects parameter 2 to be array, null given in /home/xxx/public_html/yyyy/content/plugins/types-access/includes/Helper.php on line 1621

i somehow suspect the post new relationship has a part on this.

#915564
Archive-Only-the-Database.JPG

Good day, the file you provided above does not help, it contains lots of SQL files, please follow our document to provide the database dump file:
https://toolset.com/faq/provide-supporters-copy-site/

use the option "Archive Only the Database", see screenshot: Archive-Only-the-Database.JPG,

then provide a downloadable link in your private message:
https://toolset.com/forums/topic/php-fatal-error-uncaught-error-types-application-controllers-m2m-php52/#post-915552

You just need to help us to duplicate the problem, we will take over it. thanks

#915571

Hi , i just setup a staging site., pls mark next as private . thanks

#915573

As your request, the private detail box is enabled

#915592

Hi I just tested it. disabling toolset type solve the issue. anymore help on this pls....

#915623

Thanks for the details, I am checking it in your website, will update this thread if there is anything found

#915627

I assume we are talking about these page:
hidden link
and
hidden link

I have already tried them in my Chrome browser, but can not see the problem you mentioned above.

Please describe detail steps for the question:
Where and how can I see the problem:
Uncaught Error: Call to a member function is_intermediary() on null in
/home/xxx/public_html/yyy/content/plugins/types/application/controllers/m2m.php:52

And your test site are using 17 plugins, and a custom theme "rise_framework", I need your permission to deactivate plugins and theme

#915653

hi, i deactiavted the plugin let me put in back now.

#915658

Hi the link you gave is correct , click any of those and edit them its a blank page. and the error will be at the log files.

example: ..../wp-admin/post.php?post=5633&action=edit >> convert pro
..../wp-admin/post.php?post=5485&action=edit >> page header

hidden link...../error_log.txt

you can do anything to the site. deactivate etc. its a staging site.

#915668

let me try reinstall the types. ok-done. no differece, the problem still remain..

#915670

i read this

3.0.1
June 11, 2018

Fix: Fatal error in Module Manager when there are relationships with native post types.
Fix: Include posts in the Pending Review status in results of toolset_get_related_posts() and toolset_get_related_post() by default, and allow for specifying own set of statuses to filter by.
Fix: An obscure bug where custom field groups weren’t showing in a listing in case a “filter” taxonomy exists on the site.
Fix: Issues with failed automatic enabling of m2m related to allowed maximum table index size....

#915676
$post_type_repository = Toolset_Post_Type_Repository::get_instance();
		$intermediary_post_type = $post_type_repository->get( $post_type );
		if( ! $intermediary_post_type->is_intermediary() ) {
			// no intermediary -> abort
			return;
		}

its poiting to this code,.

#915681

I can see the PHP 500 error after click the edit link, but your website is running 47 plugins and a custom theme, in order to isolate the compatibility problem, I need to export your website database into my localhost, test and debug, it will take time.