Skip Navigation

[Resolved] No image preview in image library after update types

This support ticket is created 4 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 28 replies, has 2 voices.

Last updated by Shane 4 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1547069

There are no more image previews in the media library.
Images are working when you make a post or page with them, but no previews.

#1547495

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

Thank you for getting in touch.

This actually sounds similar to a plugin conflict. If you have not yet tried this, could you temporarily disable all the non-toolset plugins and check again to see if the issue still remains.

Thanks,
Shane

#1547821

I made a clone of the website, I disabled all plugins, problem remains.
Disabled Types, previews where working again

#1548489

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

Would you mind allowing me to have admin access to the site so that I can have a look at this ?

Thanks,
Shane

#1549909

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2020-03-13 at 9.39.42 AM.png

Hi Robert,

Could you send me a screenshot of what you see on your end as i'm not seeing the issue you are experiencing. See Screenshot.

The images without previews don't show up regardless of whether Types is enabled or not.

Thanks,
Shane

#1550553

Try to upload a new image with and without Types activated

#1552667

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

I was able to see the issue and the error being generated when I try to upload an image is


hires_ok.png Post-
processing of the image failed. If it is a photo or a large image, resize it to 2500 pixels and upload the file again.

Are you running any form of custom code that is related to Types?

I tested this out on my test site and I was not able to replicate the issue.

Looking forward to hearing from you.

Thanks,
Shane

#1553571

Custom code, I guess you mean in the function.php
Is there a way that I can send you the file?

#1553703

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

You can copy and paste all the code here in the forum but wrap them in the code tags for them to be formatted. You can click on formatting instructions to see what kind of formatting we can use in the forum.

Also if you remove all the custom code does the issue still occur ?

Thanks,
Shane

#1553761

I renamed the functions.php in the child theme, nothing changed

This is the code

<?php
// Add custom Theme Functions here

function translate_woocommerce($translation, $text, $domain) {
    if ($domain == 'woocommerce') {
        switch ($text) {
            case 'SKU':
                $translation = 'Productnummer';
                break;
            case 'SKU:':
                $translation = 'Productnummer:';
                break;
        }
    }
    return $translation;
}

add_filter('gettext', 'translate_woocommerce', 10, 3);

/**
 * Format order number with invoice number settings
 */
add_filter( 'wpo_wcpdf_raw_document_number', 'wpo_wcpdf_raw_document_number', 10, 4 );
function wpo_wcpdf_raw_document_number( $number, $settings, $document, $order ) {
    if ( $document->get_type() == 'invoice' ) {
        $number = $order->get_order_number();
    }
 
    return $number;
}

/* WooCommerce: The Code Below Removes Checkout Fields */

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_address_2']);
unset($fields['billing']['billing_state']);

return $fields;
}

add_action( 'woocommerce_before_checkout_form', 'wnd_checkout_message_bottom', 10 );

function wnd_checkout_message_bottom( ) {
 echo '<div class="wnd-checkout-message"><h4>Bent u een bedrijf? Vul dan onderaan dit formulier, uw gegevens in.</h4>
</div>';
}


add_filter( 'wpo_wcpdf_templates_totals', 'wpo_wcpdf_custom_add_shipping_method', 10, 3 );
function wpo_wcpdf_custom_add_shipping_method ( $totals_data, $document_type, $document ) {
	$order = $document->order;
	foreach ($totals_data as $key => $total) {
		if ( $total['type'] == 'shipping' && !array_key_exists( 'method', $total ) ) {
			$totals_data[$key]['value'] .= nl2br( "\n" . " " . $order->get_shipping_method() );
		}
	}
	return $totals_data;
}




function wooc_extra_register_fields() {?>
                <p class="form-row form-row-first">
       <label for="reg_billing_first_name"><?php _e( 'Voornaam', 'woocommerce' ); ?><span class="required">*</span></label>
       <input type="text" class="input-text" name="billing_first_name" id="reg_billing_first_name" value="<?php if ( ! empty( $_POST['billing_first_name'] ) ) esc_attr_e( $_POST['billing_first_name'] ); ?>" />
       </p>
       <p class="form-row form-row-last">
       <label for="reg_billing_last_name"><?php _e( 'Achternaam', 'woocommerce' ); ?><span class="required">*</span></label>
       <input type="text" class="input-text" name="billing_last_name" id="reg_billing_last_name" value="<?php if ( ! empty( $_POST['billing_last_name'] ) ) esc_attr_e( $_POST['billing_last_name'] ); ?>" />
       </p>
           <p class="form-row form-row-wide">
           <label for="reg_billing_phone"><?php _e( 'Bedrijfsnaam', 'woocommerce' ); ?></label>
           <input type="text" class="input-text" name="billing_company" id="reg_billing_address_1" value="<?php esc_attr_e( $_POST['billing_company'] ); ?>" />
           </p>
<p class="form-row form-row-wide">
           <label for="reg_billing_phone"><?php _e( 'Land', 'woocommerce' ); ?></label>
           <input type="text" class="input-text" name="billing_country" id="reg_billing_country" value="<?php esc_attr_e( $_POST['billing_country'] ); ?>" />
           </p>
           <p class="form-row form-row-first">
           <label for="reg_billing_first_name"><?php _e( 'Postcode', 'woocommerce' ); ?><span class="required">*</span></label>
           <input type="text" class="input-text" name="billing_postcode" id="reg_billing_postcode" value="<?php if ( ! empty( $_POST['billing_postcode'] ) ) esc_attr_e( $_POST['billing_postcode'] ); ?>" />
           </p>
           <p class="form-row form-row-last">
           <label for="reg_billing_last_name"><?php _e( 'Plaats', 'woocommerce' ); ?><span class="required">*</span></label>
           <input type="text" class="input-text" name="billing_city" id="reg_billing_city" value="<?php if ( ! empty( $_POST['billing_city'] ) ) esc_attr_e( $_POST['billing_city'] ); ?>" />
           </p>
	<p class="form-row form-row-wide">
       <label for="reg_billing_phone"><?php _e( 'Telefoonnummer', 'woocommerce' ); ?></label>
       <input type="text" class="input-text" name="billing_phone" id="reg_billing_phone" value="<?php esc_attr_e( $_POST['billing_phone'] ); ?>" />
       </p>
           <div class="clear"></div>
           <?php
     }
     add_action( 'woocommerce_register_form_start', 'wooc_extra_register_fields' );

function wooc_validate_extra_register_fields( $username, $email, $validation_errors ) {
      if ( isset( $_POST['billing_postcode'] ) && empty( $_POST['billing_postcode'] ) ) {
             $validation_errors->add( 'billing_postcode_error', __( '<strong>Error</strong>: Postcode is verplicht!', 'woocommerce' ) );
      }
      if ( isset( $_POST['billing_city'] ) && empty( $_POST['billing_city'] ) ) {
             $validation_errors->add( 'billing_city_error', __( '<strong>Error</strong>: Plaats is verplicht!.', 'woocommerce' ) );
      }
      if ( isset( $_POST['billing_first_name'] ) && empty( $_POST['billing_first_name'] ) ) {
             $validation_errors->add( 'billing_first_name_error', __( '<strong>Error</strong>: First name is required!', 'woocommerce' ) );
      }
      if ( isset( $_POST['billing_last_name'] ) && empty( $_POST['billing_last_name'] ) ) {
             $validation_errors->add( 'billing_last_name_error', __( '<strong>Error</strong>: Last name is required!.', 'woocommerce' ) );
      }
         return $validation_errors;
}
add_action( 'woocommerce_register_post', 'wooc_validate_extra_register_fields', 10, 3 );

function wooc_save_extra_register_fields( $customer_id ) {
    if ( isset( $_POST['billing_phone'] ) ) {
                 // Phone input filed which is used in WooCommerce
                 update_user_meta( $customer_id, 'billing_phone', sanitize_text_field( $_POST['billing_phone'] ) );
          }
      if ( isset( $_POST['billing_first_name'] ) ) {
             //First name field which is by default
             update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) );
             // First name field which is used in WooCommerce
             update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST['billing_first_name'] ) );
      }
      if ( isset( $_POST['billing_last_name'] ) ) {
             // Last name field which is by default
             update_user_meta( $customer_id, 'last_name', sanitize_text_field( $_POST['billing_last_name'] ) );
             // Last name field which is used in WooCommerce
             update_user_meta( $customer_id, 'billing_last_name', sanitize_text_field( $_POST['billing_last_name'] ) );
      }


  
      if ( isset( $_POST['billing_company'] ) ) {
             //First name field which is by default
             update_user_meta( $customer_id, 'billing_company', sanitize_text_field( $_POST['billing_company'] ) );
             // First name field which is used in WooCommerce
             update_user_meta( $customer_id, 'billing_company', sanitize_text_field( $_POST['billing_company'] ) );
      }
      if ( isset( $_POST['billing_country'] ) ) {
             // Last name field which is by default
             update_user_meta( $customer_id, 'billing_country', sanitize_text_field( $_POST['billing_country'] ) );
             // Last name field which is used in WooCommerce
             update_user_meta( $customer_id, 'billing_country', sanitize_text_field( $_POST['billing_country'] ) );
      }


    if ( isset( $_POST['billing_address_1'] ) ) {
                 // Phone input filed which is used in WooCommerce
                 update_user_meta( $customer_id, 'billing_address_1', sanitize_text_field( $_POST['billing_address_1'] ) );
          }
      if ( isset( $_POST['billing_postcode'] ) ) {
             //First name field which is by default
             update_user_meta( $customer_id, 'billing_postcode', sanitize_text_field( $_POST['billing_postcode'] ) );
             // First name field which is used in WooCommerce
             update_user_meta( $customer_id, 'billing_postcode', sanitize_text_field( $_POST['billing_postcode'] ) );
      }
      if ( isset( $_POST['billing_city'] ) ) {
             // Last name field which is by default
             update_user_meta( $customer_id, 'billing_city', sanitize_text_field( $_POST['billing_city'] ) );
             // Last name field which is used in WooCommerce
             update_user_meta( $customer_id, 'billing_city', sanitize_text_field( $_POST['billing_city'] ) );
      }
}
add_action( 'woocommerce_created_customer', 'wooc_save_extra_register_fields' );
#1555135

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

Just an update here. I'm trying to create a copy of your site so that I can test here locally.

I find that disabling multiple plugins on your site at the same time would cause the connection to time out so I'm trying to put the site in an environment that is more controlled.

Thanks you for your continued patience.

#1555433

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

I'm still having difficulties creating a copy of the test site itself.

I am not able to replicate this issue at all. DO you have any other installation that is not a multisite where the issue can be seen ?

Please let me know as soon as possible so that i could possibly get a copy of that.

Thanks,
Shane

#1555763

No I don't have that same issue on a other site, it started after a update.
I also tried everything to find out why this happens.

#1556753

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

I did another round of testing but was unsuccessful once again. I thought it would be related to a multisite setup but again the issue doesn't exist.

The last thing for me to try is to test the multisite with your theme to see if there is a conflict there.

Would you mind providing me with FTP access to the site ?

Right now the issue seems to be related to
Failed to load resource: the server responded with a status of 500 (Internal Server Error) async-upload.php

I would like to enable the debugging for wordpress to see what other errors might be showing up.

Thanks,
Shane

#1557501

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

I'm working on the site now.