Change WordPress user roles and capabilities Forums Bug Reports Strange error with Elegant Themes when attempting to update Reply To: Strange error with Elegant Themes when attempting to update

#1552
Vladimir
Keymaster

Hi,

Thanks. For the additional information and provided code.
Richard from WP Engine was almost right when wrote: “does look like a plugin conflict between it and the Divi theme made by Elegant Themes.”. It is a conflict between WordPress and the Divi theme. As if you get update error for any other plugin you will get the similar error message replacement from Divi theme.
I found a reason, why instead of the URE plugin update error we see the error message from the Divi theme in this case.
There is this function (I have an older version possibly) at the themes/Divi/epanel/custom_functions.php file:


add_filter( 'gettext', 'et_admin_update_theme_message', 20, 3 );
function et_admin_update_theme_message( $default_translated_text, $original_text, $domain ) {
	global $themename;
    $theme_page_message = 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a>. <em>Automatic update is unavailable for this theme.</em>';
	$updates_page_message = 'Update package not available.';

    if ( is_admin() && $original_text === $theme_page_message ) {
        return __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a>. <em>Before you can update your Elegant Themes, you must first install the <a href="https://www.elegantthemes.com/members-area/documentation.html#updater" target="_blank">Elegant Updater Plugin</a> to authenticate your subscription.</em>', $themename );
    }

	if ( is_admin() && $original_text === $updates_page_message ){
		return __( 'Before you can update your Elegant Themes, you must first install the <a href="https://www.elegantthemes.com/members-area/documentation.html#updater" target="_blank">Elegant Updater Plugin</a> to authenticate your subscription.', $themename );
	}

    return $default_translated_text;
}

This function does not check a $domain value. I’m sure it should. If we add


 if ($domain!='Divi') {
     return $default_translated_text;
 }

to the begin of the function above, we will see the correct error message:


An error occurred while updating User Role Editor Pro: Update package not available.

which in other cases is replaced by the message from the Divi theme code, as this function makes replacement not for the ‘Divi’ text domain only, but and for the default one too.
Contact Elegant Themes support to fix this issue.