• Welcome to Tux Reports: Where Penguins Fly. We hope you find the topics varied, interesting, and worthy of your time. Please become a member and join in the discussions.

Error while creating Thread for Custom Post

Charles_cz

Baby Bird
Hi guys, I have upgraded to XenWord Pro 2018.02.04 and XenForo 2

Now I have a problem when I enable creating Thread for Custom Post. I am getting error as shown below. That is important part for me. How can I fix that? It has worked before the upgrade.

Please let me know. Thank you. Charles




An exception occurred: [TypeError] Argument 2 passed to XF\Service\Thread\Creator::__construct() must be an instance of XF\Entity\Forum, null given, called in /home/evergr49/public_html/forum/src/XF/Container.php on line 274 in src/XF/Service/Thread/Creator.php on line 49

  1. XF\Service\Thread\Creator->__construct() in src/XF/Container.php at line 274
  2. XF\Container->createObject() in src/XF/App.php at line 1322
  3. XF\App->XF\{closure}() in src/XF/Container.php at line 228
  4. XF\Container->create() in src/XF/App.php at line 2466
  5. XF\App->service() in src/XF.php at line 526
  6. XF::service() in /home/evergr49/public_html/wp-content/plugins/Xenword20180204/src/Includes/Threads/Post.php at line 85
  7. XenWord\Includes\Threads\Post->insert() in /home/evergr49/public_html/wp-content/plugins/Xenword20180204/src/Includes/Threads/Post.php at line 59
  8. XenWord\Includes\Threads\Post->xenword_transitions() in /home/evergr49/public_html/wp-includes/class-wp-hook.php at line 286
  9. WP_Hook->apply_filters() in /home/evergr49/public_html/wp-includes/class-wp-hook.php at line 310
  10. WP_Hook->do_action() in /home/evergr49/public_html/wp-includes/plugin.php at line 453
  11. do_action() in /home/evergr49/public_html/wp-includes/post.php at line 4036
  12. wp_transition_post_status() in /home/evergr49/public_html/wp-includes/post.php at line 3496
  13. wp_insert_post() in /home/evergr49/public_html/wp-includes/post.php at line 3654
  14. wp_update_post() in /home/evergr49/public_html/wp-admin/includes/post.php at line 377
  15. edit_post() in /home/evergr49/public_html/wp-admin/post.php at line 194
 

Gracie

Dogs Times Writer
Hi

The second argument represents the forum which must be passed to the Creator Service in XenForo. I haven't tried custom posts so let me set this up and I'll add in different wp_die statements to see where something is going wrong.

I'll post after setting up the server.
 

Charles_cz

Baby Bird
Actually I am not sure if that helps but I tried regular post to see if that will creates thread but it did not work out either so I guess it is not necessarily tied to custom posts.

I tried to disable all plug-ins except XenWord and set default Twenty Seventeen wordpress theme to make sure nothing else is messing with it. Here is the error I got when I created new post and tried to save it with option to create new thread in forum enabled and checked YES.

I am on PHP 7.1.7 and WordPress 4.9.4 running Twenty Seventeen theme.


An exception occurred: [TypeError] Argument 2 passed to XF\Service\Thread\Creator::__construct() must be an instance of XF\Entity\Forum, null given, called in /home/evergr49/public_html/forum/src/XF/Container.php on line 274 in src/XF/Service/Thread/Creator.php on line 49

XF\Service\Thread\Creator->__construct() in src/XF/Container.php at line 274
XF\Container->createObject() in src/XF/App.php at line 1322
XF\App->XF\{closure}() in src/XF/Container.php at line 228
XF\Container->create() in src/XF/App.php at line 2466
XF\App->service() in src/XF.php at line 526
XF::service() in /home/evergr49/public_html/wp-content/plugins/Xenword20180204/src/Includes/Threads/Post.php at line 85
XenWord\Includes\Threads\Post->insert() in /home/evergr49/public_html/wp-content/plugins/Xenword20180204/src/Includes/Threads/Post.php at line 59
XenWord\Includes\Threads\Post->xenword_transitions() in /home/evergr49/public_html/wp-includes/class-wp-hook.php at line 286
WP_Hook->apply_filters() in /home/evergr49/public_html/wp-includes/class-wp-hook.php at line 310
WP_Hook->do_action() in /home/evergr49/public_html/wp-includes/plugin.php at line 453
do_action() in /home/evergr49/public_html/wp-includes/post.php at line 4036
wp_transition_post_status() in /home/evergr49/public_html/wp-includes/post.php at line 3496
wp_insert_post() in /home/evergr49/public_html/wp-includes/post.php at line 3654
wp_update_post() in /home/evergr49/public_html/wp-admin/includes/post.php at line 377
edit_post() in /home/evergr49/public_html/wp-admin/post.php at line 194
 
Last edited:

Gracie

Dogs Times Writer
Please see my PM to you with an unreleased version in which post setting options are included.
 
Top