Skip Navigation

[Closed] Module import fails

This support ticket is created 3 years, 1 month 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/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by Waqar 3 years, 1 month ago.

Assisted by: Waqar.

Author
Posts
#1954871

Tell us what you are trying to do? Import the Real Estate House Search Module

I get the following PHP error log:
[17-Feb-2021 21:14:52 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function OTGS\Toolset\Types\Post\Import\Associations::__construct(), 6 passed in /home2/berrylandcodev/public_html/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-common/utility/singleton_factory.php on line 79 and exactly 7 expected in /home2/berrylandcodev/public_html/wp-content/plugins/types/application/models/post/Import/Associations.php:55
Stack trace:
#0 /home2/berrylandcodev/public_html/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-common/utility/singleton_factory.php(79): OTGS\Toolset\Types\Post\Import\Associations->__construct(Object(OTGS\Toolset\Types\Post\Meta\Associations), Object(OTGS\Toolset\Types\Wordpress\Post\Storage), Object(OTGS\Toolset\Types\Wordpress\Postmeta\Storage), Object(Toolset_Relationship_Definition_Repository), Object(OTGS\Toolset\Common\M2M\Association\Repository), Object(OTGS\Toolset\Types\Post\Import\Association\Factory))
#1 /home2/berrylandcodev/public_html/wp-content/plugins/toolset-blocks/vendor/toolset/t in /home2/berrylandcodev/public_html/wp-content/plugins/types/application/models/post/Import/Associations.php on line 55
[17-Feb-2021 21:19:07 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function OTGS\Toolset\Types\Post\Import\Associations::__construct(), 6 passed in /home2/berrylandcodev/public_html/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-common/utility/singleton_factory.php on line 79 and exactly 7 expected in /home2/berrylandcodev/public_html/wp-content/plugins/types/application/models/post/Import/Associations.php:55
Stack trace:
#0 /home2/berrylandcodev/public_html/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-common/utility/singleton_factory.php(79): OTGS\Toolset\Types\Post\Import\Associations->__construct(Object(OTGS\Toolset\Types\Post\Meta\Associations), Object(OTGS\Toolset\Types\Wordpress\Post\Storage), Object(OTGS\Toolset\Types\Wordpress\Postmeta\Storage), Object(Toolset_Relationship_Definition_Repository), Object(OTGS\Toolset\Common\M2M\Association\Repository), Object(OTGS\Toolset\Types\Post\Import\Association\Factory))
#1 /home2/berrylandcodev/public_html/wp-content/plugins/toolset-blocks/vendor/toolset/t in /home2/berrylandcodev/public_html/wp-content/plugins/types/application/models/post/Import/Associations.php on line 55

What should I do?

#1955579

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

I just tested the "Toolset Framework Installer" plugin on my test website to deploy the "C&B Properties" real estate reference website and it completed successfully, without any errors or warnings.

Can you please make sure that WordPress and Toolset plugins are all updated to the latest version?

In case the issue still persists, please share the exact steps and temporary admin login details, of the website, where you're seeing these errors.

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1958393

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing these details, but the website seems to be inaccessible with the "This site can’t be reached" message.

During some further investigation, I found another report about a similar issue, for which a fix is planned in the upcoming releases.

For now, you can follow these steps:

1. Please make sure that from Toolset plugins only Types, Blocks, and Module Manager plugins are active with the latest versions.

2. Look for a file named "m2m.php" in folder:
wp-content/plugins/toolset-blocks/vendor/toolset/toolset-common/inc/public_api/

Starting from line #494, you'll see this code:


$import_associations = Toolset_Singleton_Factory::get( '\OTGS\Toolset\Types\Post\Import\Associations',
		Toolset_Singleton_Factory::get( '\OTGS\Toolset\Types\Post\Meta\Associations' ),
		Toolset_Singleton_Factory::get( '\OTGS\Toolset\Types\Wordpress\Post\Storage', $wpdb ),
		Toolset_Singleton_Factory::get( '\OTGS\Toolset\Types\Wordpress\Postmeta\Storage', $wpdb ),
		Toolset_Relationship_Definition_Repository::get_instance(),
		$association_repository,
		Toolset_Singleton_Factory::get( '\OTGS\Toolset\Types\Post\Import\Association\Factory' ),
	);

Please replace it with:


$import_associations = Toolset_Singleton_Factory::get( '\OTGS\Toolset\Types\Post\Import\Associations',
		Toolset_Singleton_Factory::get( '\OTGS\Toolset\Types\Post\Meta\Associations' ),
		Toolset_Singleton_Factory::get( '\OTGS\Toolset\Types\Wordpress\Post\Storage', $wpdb ),
		Toolset_Singleton_Factory::get( '\OTGS\Toolset\Types\Wordpress\Postmeta\Storage', $wpdb ),
		Toolset_Relationship_Definition_Repository::get_instance(),
		$association_repository,
		Toolset_Singleton_Factory::get( '\OTGS\Toolset\Types\Post\Import\Association\Factory' ),
		Toolset_Singleton_Factory::get( '\OTGS\Toolset\Common\Relationships\API\Factory' )
	);

After saving the file changes, try the import of the House Search module again.

#1958559

Thank you for the detailed response.
I made the changes you suggested and the error log nows reads as follows.

[19-Feb-2021 15:27:34 UTC] PHP Fatal error: Uncaught Error: Call to a member function resetAssociations() on bool in /home2/berrylandcodev/public_html/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-common/inc/public_api/m2m.php:515
Stack trace:
#0 /home2/berrylandcodev/public_html/wp-content/plugins/toolset-module-manager/library/wordpress-importer/modman-wp-importer.php(550): toolset_import_associations_of_child(276)
#1 /home2/berrylandcodev/public_html/wp-content/plugins/toolset-module-manager/library/wordpress-importer/modman-wp-importer.php(62): Modman_Importer->process_posts(Array)
#2 /home2/berrylandcodev/public_html/wp-content/plugins/toolset-module-manager/controllers/wp_import.php(32): Modman_Importer->import('/home2/berrylan...')
#3 /home2/berrylandcodev/public_html/wp-content/plugins/toolset-module-manager/classes/ModuleManager.php(769): Module_Manager_Wp_Import->import_posts('/home2/berrylan...')
#4 /home2/berrylandcodev/public_html/wp-content/plugins/toolset-module-manager/views/templates/import.tpl.php(397): ModuleManager::impor in /home2/berrylandcodev/public_html/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-common/inc/public_api/m2m.php on line 515

#1962289

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I couldn't reproduce these errors on my test website.

Can you please share a clone/snapshot of your website where you're importing this?
( ref: https://toolset.com/faq/provide-supporters-copy-site/ )

I've set your next reply as private.

The topic ‘[Closed] Module import fails’ is closed to new replies.