• Resolved Learn About Logistics

    (@learn-about-logistics)


    After upgrading to Yoast 3.0.2 (3.0.1 also exhibited same issue), we have an issue in the Media section when trying to edit an image.

    Cropping an image or scaling won’t allow pixels to be typed in. It keeps reverting to saying NaN in the input area and won’t allow any scaling or cropping, even when drawing the bounding box for crop, it gives the same error.

    It is not just an input area issue, it won’t allow the crop/scale at all.

    See: https://www.learnaboutlogistics.com/downloads/YoastMediaError.png

    Console log shows: Uncaught TypeError: Cannot read property ‘value’ of null
    wp-seo-post-scraper-302.min.js?ver=3.0.2

    This worked prior to the update to Version 3.0.2. As suggested, we have tried clearing the cache and it didn’t resolve the issue. We don’t have any external Cache plugins either.

    It works as expected when the Yoast SEO plugin is deactivated.

    https://www.ads-software.com/plugins/wordpress-seo/

Viewing 15 replies - 1 through 15 (of 15 total)
  • I’m having the exact same issue. It also appears to have been an issue with earlier releases about a year ago. Has this been resolved?

    Same problem here with Yoast 3.0.7.

    I was getting the same bug for Taxonomy Pages
    Just add below code in your theme functions.php to fix that issue in YOAST SEO 3.0.7 Plugin

    function wpdocs_dequeue_script() {
    if ( $GLOBALS[‘pagenow’] === ‘edit-tags.php’ && filter_input( INPUT_GET, ‘action’ ) === ‘edit’ ) {
    $term = filter_input( INPUT_GET, ‘taxonomy’, FILTER_DEFAULT, array( ‘options’ => array( ‘default’ => ” ) ) );
    $taxonomy = get_taxonomy( $term);
    $is_public = $taxonomy->public;
    echo “arya”;
    if ($is_public===false) {
    wp_deregister_script( ‘wp-seo-term-scraper’ );
    }
    }
    }
    add_action( ‘admin_enqueue_scripts’, ‘wpdocs_dequeue_script’, 100 );

    I added your code into the functions.php file but nothing changed, still have the NaN when trying to change the size.

    below is the code I have now in functions.php after adding in your code.
    Can you help please
    Many thanks

    <?php
    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) exit;
    
    // BEGIN ENQUEUE PARENT ACTION
    
    // AUTO GENERATED - Do not modify or remove comment markers above or below:
    
    if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
        function chld_thm_cfg_parent_css() {
            wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css' );
        }
    endif;
    add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css' );
    function wpdocs_dequeue_script() {
    if ( $GLOBALS['pagenow'] === 'edit-tags.php' && filter_input( INPUT_GET, 'action' ) === 'edit' ) {
    $term = filter_input( INPUT_GET, 'taxonomy', FILTER_DEFAULT, array( 'options' => array( 'default' => '' ) ) );
    $taxonomy = get_taxonomy( $term);
    $is_public = $taxonomy->public;
    echo "arya";
    if ($is_public===false) {
    wp_deregister_script( 'wp-seo-term-scraper' );
    }
    }
    }
    add_action( 'admin_enqueue_scripts', 'wpdocs_dequeue_script', 100 );
    
    // END ENQUEUE PARENT ACTION

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been damaged by the forum’s parser.]

    Hi YvonneTaylor,
    Can you show me the exact page and also screenshot of error you getting.

    I have the same problem as the people above. When I try to resize any of my photos in the media library when I change the width the height changes to NaN and visaversa.
    For example, below is the size of an image I have 460 x 493. When I try to resize from 494 to 393 the figure in the box with 460 changes to NaN.

    It would appear to be something to do with Yoast, I have Yoast premium.

    Scale Image
    Original dimensions 460 × 493

    NaN
    ×
    393
    Scale

    I can confirm the same problem with version 3.0.7. If I deactivate Yoast SEO (free), the scaling functionality returns.

    https://www.theshelterblog.com

    The code posted by mrkhanakia (post #4) did not work for me. I still need to deactivate Yoast SEO to resize images.

    I’m having this issue too. Has it been fixed for you?

    I too have this issue, has yoast fixed this yet?

    Just wanted to confirm Yoast is causing this for me as well.Can’t crop images. Just NAN and NAN. What a weird one.

    We are having the same issue:
    Using WordPress 4.4.2 and reverted to Twenty Sixteen theme.
    All plugins disabled except for Yoast SEO Version 3.0.7.
    Here is a screen shot (also showing one of two Yoast js errors in console: https://screencast.com/t/bQb9wfYx6f

    FYI – I have updated to Yoast 3.1 and this seems to have fixed the issue!

    It works okay now for me, after the last update.

    This is still broken for me even with Yoast Version 3.1.2 – deactivating Yoast makes the image crop function work again.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Yoast SEO 3.0.2 Breaks Media>Edit>Crop / Scale Functionality – Gives NaN error’ is closed to new replies.