I am trying to: Save a user profile in the back-end.
Link to a page where the issue can be seen:
I expected to see: save confirmation message
Instead, I got: an error message in the debug log, see below
----
PHP Fatal error: Uncaught Error: Undefined constant "OTGS\Toolset\Access\Controllers\Filters\IS_PROFILE_PAGE" in /public/wp-content/plugins/types-access/application/controllers/filters/backend_filters.php:271
----
Using undefined constants is now a fatal error since PHP8.
The problematic line is:
if ( ! IS_PROFILE_PAGE && ! is_network_admin() && current_user_can( 'promote_user', $user_id ) ) {
elsewhere in the code existence of the constant is checked before using such as here:
if ( defined( 'IS_PROFILE_PAGE' )
&& ! IS_PROFILE_PAGE
&& ! is_network_admin()
&& current_user_can( 'promote_user', $profileuser->ID )
) {
Hi,
Thank you for contacting us and I'd be happy to assist.
While it does seem like a good practice to include a 'defined' check for a constant, I couldn't reproduce this error on my test website, with PHP8 and the Access plugin.
To report this, I'll need to know the exact steps to reproduce this error. Are you using any third-party plugin or custom code to change the user roles or user profile functionality in the admin area?
regards,
Waqar