Problem upgrading from an old version to a new version
-
Hi There,
I’ve had a problem upgrading RCP from an old version to the latest version.
The problem we were having was when people were editing posts, they were accidentally setting them as being restricted.
The problem lied in the line 53 of core/includes/admin/metabox-view.php
<option value="registered-users"<?php selected( true, empty( $sub_levels ) && ! is_numeric( $access_level ) && ! empty( $user_role ) && 'All' !== $user_role ); ?>><?php _e( 'Members with a certain role', 'rcp' ); ?></option>
The problem was that the
$user_role
variable, based on thercp_user_level
, was set to “None”, meaning that this line was selecting the “Members with a certain role” variable (instead of “Unrestricted”, which was being selected but then deselected). The client was forgetting to change it to unrestricted, and making edited content restricted.
I’ve had to put a hotfix in of the following:-<option value="registered-users"<?php selected( true, empty( $sub_levels ) && ! is_numeric( $access_level ) && ! empty( $user_role ) && 'All' !== $user_role && 'None' !== $user_role ); ?>><?php _e( 'Members with a certain role', 'rcp' ); ?></option>
But this means that the plugin can’t be updated. Is this a fix you can apply to the plugin? Or is there a better way to fix this (changing “rcp_user_level” to “All” resulted in the content being restricted) – as this is a large site and don’t want to waste time changing all these posts.
Thanks.
- The topic ‘Problem upgrading from an old version to a new version’ is closed to new replies.