Bug: FluentAuth and LearnDash leads to strange behaviour when viewing / editing posts or pages
skilldrops opened this issue · 2 comments
I have installed FluentAuth and I found out, that the combination of FluentAuth with Learndash leads to strange behaviour.
After installing FluentAuth I wanted to edit a post or a page in admin area. Then a white page with an error message appears.
Message:
There has been a critical error on this website. Please check your site admin email inbox for instructions.
Learn more about troubleshooting WordPress.
This is my environment:
WordPress-Version 6.1.1
Active Theme: BuddyBoss Theme (Version 2.2.1.2)
Actual Plugin: LearnDash LMS (Version 4.4.1.2)
PHP-Version 8.0.15
What I have tried:
- I uninstall LearnDash. FluentAuth is still activated. I try to edit a post or a page in the admin view. No errors. It works fine.
- I uninstall FluentAuth. LearnDash is still activated. I try to edit a post or a page in the admin view. No errors. It works fine.
- Both plugins are installed and activated. I try to edit a post or a page in the admin view. The error happened again.
- In the FluentAuth security settings I unchecked all settings. I try to edit a post or a page in the admin view. It had no effect. The error happened again.
Then I receive an email with the following informations:
Error-Details
Ein Fehler vom Typ E_ERROR wurde in der Zeile 124 der Datei /skilldrops-www/wp-content/plugins/sfwd-lms/includes/rest-api/v2/class-ld-rest-users-controller.php verursacht. Fehlermeldung: Uncaught TypeError: LD_REST_Users_Controller_V2::rest_prepare_response_filter(): Argument #1 ($response) must be of type WP_REST_Response, WP_User given, called in /skilldrops-www/wp-includes/class-wp-hook.php on line 308 and defined in /skilldrops-www/wp-content/plugins/sfwd-lms/includes/rest-api/v2/class-ld-rest-users-controller.php:124
Stack trace:
#0 /skilldrops-www/wp-includes/class-wp-hook.php(308): LD_REST_Users_Controller_V2->rest_prepare_response_filter(Object(WP_User), Object(WP_User), Object(WP_REST_Request))
#1 /skilldrops-www/wp-includes/plugin.php(205): WP_Hook->apply_filters(Object(WP_User), Array)
#2 /skilldrops-www/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php(1091): apply_filters('rest_prepare_us...', Object(WP_REST_Response), Object(WP_User), Object(WP_REST_Request))
#3 /skilldrops-www/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php(496): WP_REST_Users_Controller->prepare_item_for_response(Object(WP_User), Object(WP_REST_Request))
#4 /skilldrops-www/wp-includes/rest-api/class-wp-rest-server.php(1171): WP_REST_Users_Controller->get_current_item(Object(WP_REST_Request))
#5 /skilldrops-www/wp-includes/rest-api/class-wp-rest-server.php(1018): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wp/v2/users/me', Array, NULL)
#6 /skilldrops-www/wp-includes/rest-api.php(535): WP_REST_Server->dispatch(Object(WP_REST_Request))
#7 /skilldrops-www/wp-includes/rest-api.php(2884): rest_do_request(Object(WP_REST_Request))
#8 [internal function]: rest_preload_api_request(Array, '/wp/v2/users/me')
#9 /skilldrops-www/wp-includes/block-editor.php(638): array_reduce(Array, 'rest_preload_ap...', Array)
#10 /skilldrops-www/wp-admin/edit-form-blocks.php(77): block_editor_rest_api_preload(Array, Object(WP_Block_Editor_Context))
#11 /skilldrops-www/wp-admin/post.php(187): require('/skilldrops-www...')
#12 {main}
thrown
Can I do something? Or can you help out?
Many thanks.
Thanks for the report. We will take a look and release and update the fix as soon as possible.
Thanks
We have fixed the issue in the latest version of FluentAuth.