• Resolved eyejan

    (@eyejan)


    Could you please investigate this issue and verify why the callback is receiving a WP_Post_Type object instead of a WP_Term? It appears the filter is being triggered in a context where the second argument is not a term, which leads to the fatal error.

    It would also be helpful if you could add the necessary type checks or fallbacks inside filter_course_category_term_link() to prevent the function from throwing a fatal error when unexpected data is passed. This would safeguard the site against similar failures in the future.

    Please advise on next steps or provide a patch.

    [17-Nov-2025 17:17:38 UTC] PHP Fatal error: Uncaught TypeError: TUTOR\Course_Filter::filter_course_category_term_link(): Argument #2 ($term) must be of type WP_Term, WP_Post_Type given, called in /var/www/vhosts/…/httpdocs/wp-includes/class-wp-hook.php on line 324 and defined in /var/www/vhosts/…/httpdocs/wp-content/plugins/tutor/classes/Course_Filter.php:338
    Stack trace: 0 /var/www/vhosts/…/httpdocs/wp-includes/class-wp-hook.php(324): TUTOR\Course_Filter::filter_course_category_term_link() 1 /var/www/vhosts/…/httpdocs/wp-includes/plugin.php(205): WP_Hook->apply_filters() 2 /var/www/vhosts/…/httpdocs/wp-includes/taxonomy.php(4744): apply_filters() 3 /var/www/vhosts/…/httpdocs/wp-content/plugins/seo-by-rank-math/includes/frontend/paper/class-taxonomy.php(105): get_term_link() 4 /var/www/vhosts/…/httpdocs/wp-content/plugins/seo-by-rank-math/includes/frontend/paper/class-paper.php(372): RankMath\Paper\Taxonomy->canonical() 5 /var/www/vhosts/…/httpdocs/wp-content/plugins/seo-by-rank-math/includes/frontend/paper/class-paper.php(354): RankMath\Paper\Paper->generate_canonical() 6 /var/www/vhosts/…/httpdocs/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-post-variables.php(577): RankMath\Paper\Paper->get_canonical() 7 /var/www/vhosts/…/httpdocs/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-post-variables.php(108): RankMath\Replace_Variables\Post_Variables->get_url() 8 /var/www/vhosts/…/httpdocs/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-manager.php(119): RankMath\Replace_Variables\Post_Variables->setup_post_variables() 9 /var/www/vhosts/…/httpdocs/wp-includes/class-wp-hook.php(324): RankMath\Replace_Variables\Manager->setup() 10 /var/www/vhosts/…/httpdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 11 /var/www/vhosts/…/httpdocs/wp-includes/plugin.php(565): WP_Hook->do_action() 12 /var/www/vhosts/…/httpdocs/wp-includes/class-wp.php(835): do_action_ref_array() 13 /var/www/vhosts/…/httpdocs/wp-includes/functions.php(1342): WP->main() 14 /var/www/vhosts/…/httpdocs/wp-blog-header.php(16): wp() 15 /var/www/vhosts/…/httpdocs/index.php(17): require(‘…’) 16 {main}

    thrown in /var/www/vhosts/…/httpdocs/wp-content/plugins/tutor/classes/Course_Filter.php on line 338

Viewing 1 replies (of 1 total)
  • Hey @eyejan ,

    Thank you for reporting this and for sharing the detailed error log. Based on the stack trace, it appears that another plugin or theme is filtering the taxonomy link in a way that passes a WP_Post_Type object instead of a WP_Term, which leads to the fatal error when Tutor LMS expects the second parameter to be a valid term object.

    To proceed, please first check for any plugin or theme conflicts, as we are not able to reproduce this issue on a clean installation with the latest Tutor LMS version. You can follow these steps:

    1. Deactivate all plugins except Tutor LMS and test again.
    2. If the issue disappears, reactivate plugins one-by-one to identify the conflicting one.
    3. Switch temporarily to a default theme such as Twenty Twenty-Five to rule out theme-related filters.

Viewing 1 replies (of 1 total)

The topic ‘PHP Fatal error’ is closed to new replies.