Skip Navigation

[Resolved] Reopen: Undefined constant IS_PROFILE_PAGE in PHP 8

This support ticket is created 2 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 2 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#2528707

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

wp_update_user()

, 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

#2530071

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