• Hi there,

    Since updating to 4.7.2 I can no longer administer my site menus. The Pages/Posts/etc column appears on the left, but the section show/hide toggle doesn’t work, and more importantly the menu tree on the right is nowhere to be seen.

    Chrome inspector suggests gives the following error for load-scripts.php:

    Uncaught ReferenceError: columns is not defined
        at Object.initToggles (load-scripts.php:52)
        at Object.init (load-scripts.php:52)
        at HTMLDocument.<anonymous> (load-scripts.php:52)
        at i (jquery.js:2)
        at Object.fireWith [as resolveWith] (jquery.js:2)
        at Function.ready (jquery.js:2)
        at HTMLDocument.K (jquery.js:2)

    Anyone else had similar?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator t-p

    (@t-p)

    Have you tried:
    manually resetting the plugins folder by FTP/ SFTP (no Dashboard access required). Sometimes, an apparently inactive plugin can still cause problems. Also remember to deactivate any plugins in the mu-plugins folder (if you have created such folder). The easiest way is to rename that folder to mu-plugins-old.
    – switching to the unedited default Theme (Twenty Sixteen.) for a moment using the WP dashboard to rule out any theme-specific issue (theme functions can interfere like plugins). If you don’t have access to your admin area, use FTP/ SFTP , or your web-host’s cPanel or whatever file management application your host provides (no Dashboard access required). Navigate to /wp-content/themes/ and switch to the default theme by renaming your current theme’s folder by adding “-old” to the end of the folder name. Alternately, you can remove other themes except the default theme (Twenty Sixteen.). That will force your site to use it.
    MANUALLY updating. Download a fresh copy of the WordPress .zip file to your computer, unzip it, and use that to copy up all files and folders EXCEPT the wp-config.php file and the /wp-content/ directory. You may need to delete the old wp-admin and wp-includes folders and files on your server before uploading the new ones. Please read the Manual Update directions first.
    Backup: If you haven’t already done, always backup everything (including your database) before doing any actions, just in case something really goes wrong. You can never have enough backups!

    Thread Starter iangeek

    (@iangeek)

    Yep, done all the standard things. Still no dice. It was fine on earlier version. Will try to roll back and see if the problem persists.

    Moderator t-p

    (@t-p)

    – Please check the error logs on your server for a more specific error message and see why it’s failing. If you need help locating them, ask your hosting provider to help you with that.
    – If you cannot find error logs or if you don’t find any helpful info in the error logs, try Enabling debugging

    cyptus

    (@cyptus)

    had the same issue caused by an implementation of the filter “woocommerce_available_payment_gateways” which had an null ref error on “$woocommerce->customer”.

    I had the same thing. I lerned that it was caused by the WooCommerce Simple Payment Gateway v 1.0.8 with updated woocommerce to 3.0.6. Hope it will help someone.

    @cyptus and @piotrprkropka how did you fixed the problem?

    I’m having a similar problem, i’m using the code from here to disable shipping methods based on payment selected.

    The above code when used breaks the menu editor page and gives the following errors

    #0: *2967264 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Call to a member function get() on null in /child-theme-path/functions.php:66
    Stack trace:
    #0 /path/wp-includes/class-wp-hook.php(298): my_custom_available_payment_gateways(Array)
    #1 /path/wp-includes/plugin.php(203): WP_Hook->apply_filters(Array, Array)
    #2 /path/wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php(165): apply_filters(‘woocommerce_ava…’, Array)
    #3 /path/wp-content/plugins/woocommerce/includes/wc-account-functions.php(115): WC_Payment_Gateways->get_available_payment_gateways()
    #4 /path/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-menus.php(242): wc_get_account_menu_items()
    #5 /path/wp-admin/includes/template.php(1170): WC_Admin_Menus->nav_menu_links(NULL, Array)
    #6 /var” while reading response header from upstream
    

    If I comment out the code errors are gone and menu editor page displays correctly. Any ideas on this?

    check if $woocommerce->customer is null and skip if it is

    Yes, I had this error too, and it was caused by calling $woocommerce->cart->get_shipping_packages(); in woocommerce_available_payment_gateways filter.

    I added if( ! $woocommerce || !isset($woocommerce->cart) ) return; and it works now!

    @mklusak

    where exactly did you place that “if” statement? thanx in advance!

    Well, my function looks like this, and is placed in functions.php

    function payment_gateways_by_shipping_zone( $available_gateways  ) {
    	global $woocommerce;
    	
    	if( ! $woocommerce || !isset($woocommerce->cart) )  // NEW LINE
    		return $available_gateways;                     // NEW LINE
    	
    	$packages = $woocommerce->cart->get_shipping_packages();
    	
    	foreach( $packages as $package ) {
    		
    		$shipping_zone = WC_Shipping_Zones::get_zone_matching_package( $package );
    
    		// rest of code ...
    		
    	}
    
    	return $available_gateways;
    }
    add_filter( 'woocommerce_available_payment_gateways', 'payment_gateways_by_shipping_zone' );
    Moderator t-p

    (@t-p)

    Side note to @mklusak, @pattihis,

    If you noticed, it has been over 5 months since the OP replied.

    If you are looking for topics that could benefit from your help, try looking in https://wordpress.org/support/view/no-replies instead of piling in on this one.

    If the troubleshooting already posted made no difference for you, then, as per the Forum Welcome, please post your own topic.

    This topic is closed.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Upgrade to 4.7.2 breaks jquery in Menu admin page’ is closed to new replies.