• Hi, I have upgraded to WordPress 4.4, but in a specific page of the website I get this warning.

    Warning: array_map(): Argument #2 should be an array in /home/jscm/webapps/XXXXX/wp-includes/category-template.php on line 1158

    How can I fix it?
    Can you help me?

    I use WordPress 4.4 with woothemes Canvas 5.9.10 (framework 6.2.2). The problem is visible in the specific “Magazine Page” of the Theme. Instead the warning reports a wordpress file.

Viewing 15 replies - 31 through 45 (of 54 total)
  • Thread Starter jscmal

    (@jscmal)

    I see also another problem in the Canvas Theme, with the slider in the Magazine Template Page.

    In practice, the images in the slider are not properly re-sized vertically. In practice the image goes hidden at left and right

    did you experience this?

    That’s a different issue, jscmal. It should go in a new topic.

    The latest version of WP does not seem to include the following file ‘wp-includes/compat.php’.

    However, the wp-settings.php file still calls for it.
    require( ABSPATH . WPINC . ‘/compat.php’ );

    When I comment this line out of the wp-settings file, the sites load.

    Anyone else this work for?

    Thread Starter jscmal

    (@jscmal)

    Dough Smith … it is related with this topic because it is a consequence of the Worpress 4.4. upgrade. Just like the problem with the breadcrumbs.

    Here we are talking about how the upgrade affected the woothemes.

    My Canvas Theme is showing these 2 problems.

    If you are having similar issues, please create a new post. No issue is the same unless you are running on the same host on the same plan with the plugins and themes.

    Thank you

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    @othellobloke WordPress does include the wp-includes/compat.php file. Make sure that you have a complete copy of the WordPress files. Download the ZIP and do a manual install if some appear to be missing.

    Thread Starter jscmal

    (@jscmal)

    What is the function of the compat.php file?

    This post is related to the original Post Title… Warning message….

    Just my two cents, we have this issue in a PLUGIN of ours, we will post a solution/fix if we can locate the issue. We are also using Default Twenty-Twelve theme and no additional addons.

    Here are two errors we currently are experiencing after the update to 4.4

    [10-Dec-2015 01:45:06 UTC] PHP Notice: Trying to get property of non-object in /home/myfoodpress/public_html/dev.myfoodpress.com/wp-includes/category-template.php on line 1153

    [10-Dec-2015 01:45:06 UTC] PHP Warning: array_map(): Argument #2 should be an array in /home/myfoodpress/public_html/dev.myfoodpress.com/wp-includes/category-template.php on line 1158

    Also @ryan Paul the post is regarding “Upgrading” to WP 4.4 as the thread title suggests, the previous install should still have the compat.php file already loaded.

    Moderator James Huff

    (@macmanx)

    This issue will be corrected in WordPress 4.4.1, unless corrected by the individual theme and plugin authors first: https://core.trac.www.ads-software.com/ticket/34723

    There is no ETA for 4.4.1 yet beyond “when we’re sure it’s ready.”

    https://www.ads-software.com/support/topic/read-this-first-wordpress-44-master-list?replies=6&view=all#post-7760865

    Had the same problem on one of my sites. As James Huff pointed on WordPress 4.4 Master List a few hours ago, a patch for this problem has been made:

    https://core.trac.www.ads-software.com/attachment/ticket/34723/34723.patch

    To fix, open your category-template.php and replace lines 1144 – 1158…

    function get_the_terms( $post, $taxonomy ) {
    	if ( ! $post = get_post( $post ) )
    		return false;
    
    	$terms = get_object_term_cache( $post->ID, $taxonomy );
    	if ( false === $terms ) {
    		$terms = wp_get_object_terms( $post->ID, $taxonomy );
    		$to_cache = array();
    		foreach ( $terms as $key => $term ) {
    			$to_cache[ $key ] = $term->data;
    		}
    		wp_cache_add( $post->ID, $to_cache, $taxonomy . '_relationships' );
    	}
    
    	$terms = array_map( 'get_term', $terms );

    …with the new code from the patch:

    function get_the_terms( $post, $taxonomy ) {
    	if ( ! $post = get_post( $post ) )
    		return false;
    
    	$terms = get_object_term_cache( $post->ID, $taxonomy );
     	if ( false === $terms ) {
     		$terms = wp_get_object_terms( $post->ID, $taxonomy );
    		if ( ! is_wp_error( $terms ) ) {
    			$to_cache = array();
    			foreach ( $terms as $key => $term ) {
    				$to_cache[ $key ] = $term->data;
    			}
    			wp_cache_add( $post->ID, $to_cache, $taxonomy . '_relationships' );
     		}
     	}
    
    	if ( ! is_wp_error( $terms ) ) {
    		$terms = array_map( 'get_term', $terms );
    	}

    So is now line 1144 – 1162. This fix will be included in the future 4.4.1 I suppose

    ronald.kubo Thank you very much solved the problem on my website.

    Moderator James Huff

    (@macmanx)

    Thanks, ronald.kubo!

    I have confirmed that the patch above does fix the problem for me as well.

    Confirmed, also thought I might add some info for others having this problem. Many of the comments make it seem like this is a theme or WooCommerce issue.

    I experienced this error on a site with the following…..

    • Using Genesis Framework
    • Had used WooCommerce at one time, but it was removed and database tables were deleted
    • Disabling all plugins had no effect
    • Other sites with same theme and plugins not having this problem
Viewing 15 replies - 31 through 45 (of 54 total)
  • The topic ‘Warning after the upgrade to WP 4.4’ is closed to new replies.