• Resolved mwendell

    (@mwendell)


    Clients are unable to upload images in media library. The user-presented error is vague, but in the logs we’re seeing this:

    mod_fcgid: stderr: PHP Fatal error: Call to a member function update_attached_file() on a non-object in /var/www/vhosts/darkintelligencegroup.com/httpdocs/wp-content/plugins/ewww-image-optimizer/common.php on line 814

    I’ve patched this in the plugin code by wrapping an is_object() conditional around the update_attached_file() function call, like this:

    
    function ewww_image_optimizer_update_attached_file_w3tc( $meta, $id ) {
    	global $ewww_debug;
    	$ewww_debug .= 'ewww_image_optimizer_update_attached_file_w3tc()<br>';
    	list( $file_path, $upload_path ) = ewww_image_optimizer_attachment_path( $meta, $id );
    	$w3_plugin_cdn = w3_instance( 'W3_Plugin_Cdn' );
    	if (is_object($w3_plugin_cdn)) {
    		$w3_plugin_cdn->update_attached_file( $file_path, $id );
    	}
    	return $meta;
    
    }
    

    Naturally though, this just disables the image update in the CDN, so I expect further issues down the line. But at least for today the clients can upload images.

    We’re using the very latest version of W3 Total Cache and version 2.5.0 of EWWW Image Optimizer.

    Any suggestions appreciated. It looks like this might be a W3TC issue, but I thought I’d hit up you folks as well.

    Thanks!
    m.

    • This topic was modified 9 years, 4 months ago by mwendell. Reason: formatting
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘W3 Total Cache/CDN Integration Problem – W3_Plugin_Cdn’ is closed to new replies.