Hi there,
I'd like to reopen my previous ticket: https://toolset.com/forums/topic/undefined-constant-is_profile_page-in-php-8/
At the suggestion from @Nigel, I added a simple 'is_defined' check for the failure to detect the `IS_PROFILE_PAGE` constant, but the result is a new PHP fatal error:
PHP Fatal error: Uncaught Error: Call to undefined function is_defined() in /var/www/html/wp-content/plugins/types-access/application/controllers/filters/backend_filters.php:271
Stack trace:
#0 /var/www/html/wp-includes/class-wp-hook.php(310): OTGS\Toolset\Access\Controllers\Filters\BackendFilters->save_user_options(2640)
#1 /var/www/html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#2 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#3 /var/www/html/wp-includes/user.php(2446): do_action('profile_update', 2640, Object(WP_User), Array)
#4 /var/www/html/wp-includes/user.php(2567): wp_insert_user(Array)
#5 /var/www/html/wp-content/mu-plugins/rhdwp-toolset-functions-shortcodes.php(164): wp_update_user(Array)
#6 /var/www/html/wp-includes/class-wp-hook.php(308): rhdwp_muse_approve_pending_user('')
#7 /var/www/html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#8 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#9 /var/www/html/wp-admin/admin-ajax.php(188): do_action('wp_ajax_rhdwp_m...')
#10 {main}
thrown in /var/www/html/wp-content/plugins/types-access/application/controllers/filters/backend_filters.php on line 271
It seems to me, the only thing failing here is the
BackendFilters->save_user_options()
method, which is hooked when updating user data. This is firing when I call
, and it's preventing us from doing non-Toolset things with our users in an AJAX call. We've been doing this without issue for more than 2 years before we updated to PHP 8.0, on this site and on others.
Can you please advise? Thanks very much.
Cheers,
Nick
Hello,
I assume we are talking about your another thread:
https://toolset.com/forums/topic/undefined-constant-is_profile_page-in-php-8/
That issue has already been escalated to our developers, but has not been fixed.
For the new issue:
Call to undefined function is_defined()
Please try to change the PHP function name "is_defined" to "defined", and test again.
More help:
hidden link