This thread is resolved. Here is a description of the problem and solution.
Problem:
There is a problem when using the Broadcast Plugin and Toolset Types - when broadcasting, a Fatal error happens and the site is neither broadcasted, nor can we delete already broadcasted pages.
The error is
PHP Fatal error: Uncaught InvalidArgumentException: incorrect post type in /types/vendor/toolset/toolset-common/inc/autoloaded/field/group/post.php:69
Solution:
This should be resolved in any latest Broadcast Plugin updates, if not yet available the Author of the Broadcast Plugin can provide the patch.
NOTE
If you see the same error but do not use Broadcast plugin, maybe you use Multisite Post Duplicator
Please open a ticket with us and Multisite Post Duplicator in the case, so we can work on adjustments there as well.
This support ticket is created 5 years, 2 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.
Our next available supporter will start replying to tickets in about 6.50 hours from now. Thank you for your understanding.
After updating Toolset and Broadcast plugins one week ago, my multisite hidden link is giving me errors when I try to save a post after unlinking it to a previously linked child blog. The opposite action instead - adding a broadcast to a previously unlinked child blog - gives no issues. Are you still in contact with Broadcast's plugin author to solve this recent compatibility issue? My multisite worked fine for more than two years before this update...
Here is the WP_debug error message if it can be helpful:
Notice: Constant WP_POST_REVISIONS already defined in /www/wp-content/plugins/perfmatters/inc/functions.php on line 267 Fatal error: Uncaught InvalidArgumentException: incorrect post type in /www/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group/post.php:69 Stack trace: #0 /www/wp-content/plugins/types/application/models/field/group/repeatable/service.php(605): Toolset_Field_Group_Post->__construct(Object(WP_Post)) #1 /www/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group/post_factory.php(409): Types_Field_Group_Repeatable_Service->group_contains_rfg_or_prf(141) #2 [internal function]: Toolset_Field_Group_Post_Factory->{closure}(Object(OTGS\Toolset\Common\Field\Group\GroupDisplayResult)) #3 /www/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group/post_factory.php(286): array_filter(Array, Object(Closure)) #4 /www/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group/post_factory.php(458): Toolset_Field_Group_Post_Factory->filter_groups(Array, Array, Array) #5 /www/wp-content/plugins/types/vendor/toolset/types/embedded/i in /www/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group/post.php on line 69
The website is having technical issues. Check the site administrator's inbox for instructions.
Thank you Shane, I'm going to write to the Broadcast plugin developer to see if he can get in touch with your team. In the meantime I'd keep this thread open: if he gives me some indications for you I'll write them here.
Hello, I have received the email from the BroadCast Plugin but unfortunately as I mentioned before in all other tickets, A) an old API is used in that plugin and B) we are not able to replicate this problem without "hacking" the databases (means, it is not replicable easily on a clean fresh install with clear steps, but only by manually "destroying" or altering data in the database, or of course, on certain duplicates we received).
Do you know the exact steps that lead to this issue?
I see you mention the update, did you update to any Toolset Types version above 3.0 when this started happen?
If so, it's clearly due to the API used in that Plugin, which will work only with pre-Types 3-0 Relationships, but not newer.
We know what the technical error is, the MS Site ID gets mixed up and does not port to our code, which gets touched while you broadcast posts.
However there is A) no reason for the code to be even touched and B) no reason for the Site ID's to get mixed up, unless the Broadcast Plugin here pushes wrong data.
The Author asked me to offer some solutions to unhook everything that Toolset does on save_post so to let his plugin run, but this will not be a viable solution, since there is not just one major hook to remove, there are several added to the save_post action.
I am currently working once again on this, I would appreciate it immensely if you could:
- provide clear steps that lead to the issue if you know them
- let me know what precise update was culprit, and if the issue is gone when reverting to that version
- finally, provide a copy of your site, if possible, so we can look at it?
Maybe users reported the problem but none of them was returning to provide required details later.
So I can use every bit of information you can give me
The cache is managed by Flywheel, there are no caching plugins. Anyway we cleared the cache several times via Flywheel's dashboard but the issue remained.
I will have to feedback on this tomorrow as my shift is about to finish, however good news, the package is pulling faster than expected, in about 30 minutes it should be downloaded.
I will then tomorrow deploy it locally (I hope that will be successful 🙂 ) and see what I can find, let's solve this issue once for all
I deployed the package and the database, had to remove a few plugins to log in successfully, and wrap a existing WordPress install around what you sent me since that was missing.
I managed to rescue to blogs (main and one other) and make it work on local servers.
I created a new page, and had no issues whatsoever to broadcast it.
I had no error in the console, and the post (page) is broadcasted
I had better luck with a native post.
There I can see the error.
I started disable plugins and as I had suspected as soon every non TOOLSET or BROADCAST plugin is disabled the issue is resolved.
Since you do use cache, both Server and plugins, it might be due to that.
Note however I am still able to see the issue when deleting a broadcasted post, so it's not entirely solved yet.
I will now ask the developers to have a look directly.
Please try to upload and replace the existing file on your site (after a backup/testing site) in your Broadcast "threewp-broadcast-premium-pack" plugin under path:
threewp-broadcast-premium-pack/src/toolset
The new file to use instead of the existing toolset.php there: hidden link
That fixed the issue for me, both when broadcasting and when removing a broadcast.
Can you confirm this?
Please make a backup first or try on a staging site.
I tried on the duplicate, where it worked.
Bravo Beda! I uploaded your file and now there are no more broadcast issues. Thanks a lot for your great job! I would also like to thank Edward, author of the Broacast plugin, who worked with you on the problem.
Great, guys!!!
Could you specifically look after relationships, Repeatable Field Groups and such?
I mean, when you use them, on your site, check if everything works fine.
I'd also like to emphasize that the work done here (coding) is entirely "props to" Edward from the Broadcast plugin and changes will be done there.
I barely tested 🙂 and confirmed the issue as well as shared the insight with Edward.