I just exported toolset views, forms and types and imported to another site. The new site is getting this error
Warning: Invalid argument supplied for foreach() in /home/customer/www/502deals.com/public_html/wp-content/plugins/wp-views/backend/Models/ContentTemplate/UsagePostType.php on line 141
Any help is appreciated and let me know if you need more info. Thank You for your time.
Thank you for the information. Given that the message is a warning, it would be considered as non-critical. Is there just one instance of the notice? Also does it appear when you visit a particular page or is it just in our php log only once.
The issue isn't caused by the view but by the content template assigned to the view.
If you remake this content template then it should remove this error for you. As I say it is just a warning and shouldn't affect your usage of the plugin.
I suspect this notice is only showing because your wordpress debugging is enabled in your wp-config.php file.
Thank you for the patience. I took a copy of your site so that I can test this issue further here.
The issue is being caused by 4 of your content templates.
"Content Template for Listing PDF Download"
"Content template for Listings "
" Content Template for Listings w Email Gate"
"Edit Listing"
Were these 4 templates imported from another site that have different custom post types assigned ? If so then this seems to be the cause as their originally assigned post types are no longer available. Deleting these resolved the issue on my end.
Those content templates are assigned to the "listings" custom post type just as they were on the original site. Deleting my hardwork is not a solution. This was created, exported and imported using toolset. This should work. Also most of those content templates aren't even attached to a post type.
These are the templates that are causing the issue.
Were these templates assigned to different post types on the website where you exported them from?
If so then you may need to re-export them and re-import them after you've removed the post type assignment. It would appear that the original post type assignments are still stored in the export data for the content templates.
Please let me know if this is possible to do.
Thanks,
Shane
That is not possible since that is not the case. The custom post type and content templates were made using toolset and exported and imported using toolset. No changes were made to those assignments nor the custom post type before, during or after import/export. Only 1 is assigned to the "Listings" CPT and 1 is the content template for the edit form for the CPT. The others are not assigned.
"Content Template for Listing PDF Download" NOT ASSIGNED
"Content template for Listings " NOT ASSIGNED
" Content Template for Listings w Email Gate" ASSIGNED TO LISTINGS CPT
"Edit Listing" USED AS CONTENT TEMPLATE FOR EDIT OF LISTINGS CPT
So you're saying these content templates were not assigned to a post type. Were the post types from the original site exported as well ?
Also how were the templates migrated? Was it done manually or was it done using a migration plugin? These templates are definitely this issue as when I removed them from my copy of your site the issue was no longer present.
Please let me know so I can see how best we can come up with any alternatives.
They were migrated using toolset's Export/Import feature. Types, CRED Forms, Views, Content Templates were all migrated using Toolset's built in export/import feature.
You will need to install it on the site that you're exporting from and this site as well. This allows you to export the content templates as modules.
Once you've done this please let me know. Also if i'm able to get access to the site that you're exporting the content templates from please let me know.