Title: LearnDash error
Last modified: October 19, 2022

---

# LearnDash error

 *  Resolved [qwik3r](https://wordpress.org/support/users/qwik3r/)
 * (@qwik3r)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/learndash-error/)
 * I just installed this plugin and it instantly created a critical error on my 
   site. According to the automatic error email that is sent out, it appears that
   LearnDash relies on part of the REST API and I guess by it being turned off by
   default messed something up. I had to rename my LearnDash folder to get back 
   into the site.
 *     ```
       An error of type E_ERROR was caused in line 553 of the file /home/xxxx/public_html/wp-content/plugins/sfwd-lms/includes/rest-api/v2/class-ld-rest-essays-controller.php. Error message: Uncaught TypeError: Argument 2 passed to LD_REST_Essays_Controller_V2::rest_collection_params_filter() must be an instance of WP_Post_Type, null given, called in /home/xxxx/public_html/wp-includes/class-wp-hook.php on line 307 and defined in /home/xxxx/public_html/wp-content/plugins/sfwd-lms/includes/rest-api/v2/class-ld-rest-essays-controller.php:553
       Stack trace:
       #0 /home/xxxx/public_html/wp-includes/class-wp-hook.php(307): LD_REST_Essays_Controller_V2->rest_collection_params_filter()
       #1 /home/xxxx/public_html/wp-includes/plugin.php(191): WP_Hook->apply_filters()
       #2 /home/xxxx/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(2891): apply_filters()
       #3 /home/xxxx/public_html/wp-content/plugins/sfwd-lms/includes/rest-api/v2/class-ld-rest-posts-controller.php(190): WP_REST_Posts_Controller->get_collec
       ```
   

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [Dave McHale](https://wordpress.org/support/users/dmchale/)
 * (@dmchale)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/learndash-error/#post-16118742)
 * hi [@qwik3r](https://wordpress.org/support/users/qwik3r/) Sorry you’re having
   issues, but thanks for the report! I may have an idea on how to fix, and sent
   you a message on Slack to follow up. Hope to talk to you soon and see if we can
   get this fixed for you!
 *  Thread Starter [qwik3r](https://wordpress.org/support/users/qwik3r/)
 * (@qwik3r)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/learndash-error/#post-16119854)
 * Thanks. I’ll check the message there.
 *  Plugin Author [Dave McHale](https://wordpress.org/support/users/dmchale/)
 * (@dmchale)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/learndash-error/#post-16126929)
 * hi [@qwik3r](https://wordpress.org/support/users/qwik3r/)
 * I believe I’ve tracked down the issue! 🤞 Unfortunately I’m troubleshooting a
   UX update for the next version of this plugin that is holding up my next release,
   but this change WILL be included in the next version.
 * If you would like to make an update now for yourself you can edit Line 32 of `\
   disable-json-api\classes\disable-rest-api.php` and change the `init` action to`
   wp_loaded` – in my local environment that seems to work without any negative 
   side effects that I have noticed. But please let me know if you see any issues,
   if you decide to try this update!
 * Thanks again for the report, and hope this helps you use the plugin without issue!
 *  Thread Starter [qwik3r](https://wordpress.org/support/users/qwik3r/)
 * (@qwik3r)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/learndash-error/#post-16129258)
 * That seemed to do the trick in resolving the critical error. I’ll keep an eye
   out for any other issues. Thanks!
 * I’m having some trouble connecting to Metorik even though that has been checked
   off as being enabled under the settings. ;\
    -  This reply was modified 3 years, 7 months ago by [qwik3r](https://wordpress.org/support/users/qwik3r/).
      Reason: update to problem
    -  This reply was modified 3 years, 7 months ago by [qwik3r](https://wordpress.org/support/users/qwik3r/).
    -  This reply was modified 3 years, 7 months ago by [qwik3r](https://wordpress.org/support/users/qwik3r/).
 *  Plugin Author [Dave McHale](https://wordpress.org/support/users/dmchale/)
 * (@dmchale)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/learndash-error/#post-16129930)
 * Glad it’s working [@qwik3r](https://wordpress.org/support/users/qwik3r/) !
 * I can’t speak to the actual Metorik issue since I’m not sure how their endpoints
   work, but I can say that often it helps to look and see if the error talking 
   to the endpoint has the “DRA” messaging in the response or not. And sometimes
   even if you’re logged in as a particular user/role, endpoints are sometimes accessed
   without authentication. I’d recommend looking at that as a starting point.
 * Since we’ve confirmed the plugin no longer causes fatal errors on your site I’m
   going to close this ticket now, but feel free to let me know if you have any 
   continued issues in a new ticket! Cheers
 *  Thread Starter [qwik3r](https://wordpress.org/support/users/qwik3r/)
 * (@qwik3r)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/learndash-error/#post-16129960)
 * I have no idea how to look up what you’re suggesting. All I know is that the 
   plugin is blocking it. When disabled it doesn’t block it. In their docs they 
   state to make sure that app.metorik.com is not blocked. There are endpoints that
   show up in the settings for metorik, such as authentication, but turning those
   off does nothing. Please advise.
 *  [bryceadams](https://wordpress.org/support/users/bryceadams/)
 * (@bryceadams)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/learndash-error/#post-16130752)
 * Hey [@qwik3r](https://wordpress.org/support/users/qwik3r/) – Bryce from Metorik
   here. We use quite a few of the WooCommerce API endpoints, and also add some 
   of our own through the Metorik Helper plugin, so you’ll just want to make sure
   those API endpoints aren’t disabled. Any specific issues, perhaps shoot us a 
   message through our support so we can test for your site specifically and can
   let you know any errors. Cheers!
 *  Thread Starter [qwik3r](https://wordpress.org/support/users/qwik3r/)
 * (@qwik3r)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/learndash-error/#post-16132340)
 * Thanks for chiming in [@bryceadams](https://wordpress.org/support/users/bryceadams/).
   I can confirm that for ‘unauthenticated users’ in this plugin’s settings anything
   relating to Woocommerce and anything that says Metorik are not blocked. I’ve 
   been in touch with [@dmchale](https://wordpress.org/support/users/dmchale/) privately
   to try to resolve this as well.
 * Thanks.
 *  Plugin Author [Dave McHale](https://wordpress.org/support/users/dmchale/)
 * (@dmchale)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/learndash-error/#post-16135736)
 * [@qwik3r](https://wordpress.org/support/users/qwik3r/) I think at this point 
   taking [@bryceadams](https://wordpress.org/support/users/bryceadams/) up on his
   offer to look would be ideal, since nothing about DRA should be blocking anything
   if you’ve tried adjusting your settings to “allow full”. Since you’re unable 
   to debug what I sent above, with luck Bryce and team can either find out what
   else is not working properly or at least help provide more information that I
   could run with on my end.
 * Good luck, and keep me in the loop if you find more information!
 *  Thread Starter [qwik3r](https://wordpress.org/support/users/qwik3r/)
 * (@qwik3r)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/learndash-error/#post-16136089)
 * Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘LearnDash error’ is closed to new replies.

 * ![](https://ps.w.org/disable-json-api/assets/icon-256x256.png?rev=1001011)
 * [Disable REST API](https://wordpress.org/plugins/disable-json-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/disable-json-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/disable-json-api/)
 * [Active Topics](https://wordpress.org/support/plugin/disable-json-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/disable-json-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/disable-json-api/reviews/)

 * 10 replies
 * 3 participants
 * Last reply from: [qwik3r](https://wordpress.org/support/users/qwik3r/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/learndash-error/#post-16136089)
 * Status: resolved