wordpressfile-uploadplupload

Upload suddenly failing from WP Bakery Single Image Block


I am having an issue regarding uploading an image from WP Bakery's Single Image Block Upload.

Steps taken to track this issue

Upon inspection of the request made to WP's wp-admin/async_upload.php, on Chrome, I get this response:

{"success":false,"data":{"message":"","filename":"food-2373414_1920.jpg"}}

I attempted to track the issue in wp-admin/ajax-actions.php, and the error first occurs around line 2561 which has the following snippet:

$attachment_id = media_handle_upload( 'async-upload', $post_id, $post_data );    

if ( is_wp_error( $attachment_id ) ) {
    echo wp_json_encode(
        array(
            'success' => false,
            'data'    => array(
                'message'  => $attachment_id->get_error_message(),
                'filename' => esc_html( $_FILES['async-upload']['name'] ),
            ),
        )
    );

    wp_die();
}

Note: I say first occurs because the request dies and can't follow up in the next lines. So, at this time, the block above is the first obstacle.

Dumping $attachment_id

WP_Error::__set_state(array(
   'errors' => 
  array (
    'upload_error' => 
    array (
      0 => '',
    ),
  ),
   'error_data' => 
  array (
  ),
))

Configurations and Environment

PHP 7.2 w/ Mod Security disabled from Cpanel, w/ GD & Imagick

Server Apache

0777 Permissions at uploads folder

Wordpress Settings :

WP Version: 5.4.1

URL and Site URL's both start with https://

User is Administrator

Theme: Business Consulting

Other information researched and findings:

Other possible causes :

I edit Wordpress content in https://.

Every listing's pages, does not show the Mixed Content warnings, but when I edit a give article from the theme, there a lot's of MC warnings. That does not seem to hinder the upload, but for now I will leave them as it is. The request to async_upload is made via SSL, so I don't think the MC's are the cause. But for Murphy's Law sake, I will replace the http:// to https:// and try again.

Thank you in advance for your help.


Solution

  • I was able to figure it out.

    The problem is that, when I changed the slugs from on of the Advice theme's sections ( adv_cases to adv_portfolio ), the upload from articles that were previously registered before this changed were not working.

    I solved it by duplicating or creating a new post, and voilá, the upload works.