Support » Plugin: Search & Filter » Warning: count(): Parameter must be an array or an object that implements

  • Hi!

    Im getting this error when I press search after choosing one or more options:

    “Warning: count(): Parameter must be an array or an object that implements Countable in /storage/content/62/219662/projekt.fridalovborg.se/public_html/wp-content/plugins/search-filter/of-taxonomy-walker.php on line 122 Warning: count(): Parameter must be an array or an object that implements Countable in /storage/content/62/219662/projekt.fridalovborg.se/public_html/wp-content/plugins/search-filter/of-taxonomy-walker.php on line 122 Warning: count(): Parameter must be an array or an object that implements Countable in /storage/content/62/219662/projekt.fridalovborg.se/public_html/wp-content/plugins/search-filter/of-taxonomy-walker.php on line 122 Warning: count(): Parameter must be an array or an object that implements Countable in /storage/content/62/219662/projekt.fridalovborg.se/public_html/wp-content/plugins/search-filter/of-taxonomy-walker.php on line 122”

    My local website works like a charm but when I uploaded the page on ftp I´m getting this error.

    http://projekt.fridalovborg.se/tag/motoriken/

    • This topic was modified 2 years, 8 months ago by fridalovborg.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Did you find a solution? I have the same problem!

    same problem!

    I commented line 122; the problem seems to be solved!

    Thread Starter fridalovborg

    (@fridalovborg)

    Hi! Sorry for late reply but I think the solution of this was to add ob_start(); in the file wp-includes/pluggable.php on line 2 (after <?php).

    Please admin delete this message if Im wrong!

    I have the same issue. I’m using a shortcode as below:
    $searchAndFilter = do_shortcode(‘[searchandfilter post_types=”resource,post,event” add_search_param=”1″ fields=”search,content-type,post_types,events” types=”,checkbox,checkbox,checkbox” operators=”,or,or,or” show_count=”,1,1,1″ order_by=”,slug,slug,slug” order_dir=”,asc,asc,asc” hide_empty=”,1,1,1″ headings=”Search Keyword,Search Type,,” submit_label=”Search” search_placeholder=””]’);
    Then I’m getting the below warning:
    ( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /Applications/XAMPP/xamppfiles/htdocs/wp-content/plugins/search-filter/of-taxonomy-walker.php on line 122
    And it seems like the $this->defaults is a string (=’of-contenttype’) and that’s why the warning on PHP 7.2.
    I’ve changed it to below:
    if(is_string($this->defaults) && $this->defaults != ” )
    $noselected = 1;
    else
    $noselected = count($this->defaults);
    But can you guys fix it in the next version please?
    Thanks

    To fix this issue I simply commented line 17 of file of-taxonomy-walker.php

    
    $this->defaults = $defaults;
    

    And added following code below it

    
    if( !is_array($defaults) ) {
    	$this->defaults[] = $defaults;
    }
    else{
    	$this->defaults = $defaults;
    }
    

    Result code:

    
    // $this->defaults = $defaults;
    if( !is_array($defaults) ) {
    	$this->defaults[] = $defaults;
    }
    else{
    	$this->defaults = $defaults;
    }
    

    goede middag,
    Ik ben al 3 weken aan het vechten om mijn wp weer werkbaar te krijgen.
    Deze melding blijft bestaan:
    “Warning: count(): Parameter must be an array or an object that implements Countable in D:\Inetpub\vhosts\npvr.nl\httpdocs\WP\wp-admin\includes\template.php on line 1422″

    Wat is er gebeurt sinds eind dec 2018
    – de website is van hosting veranderd, voorheen Nitroserve, nu Exacthost en sindsdien zijn alle problemen ontstaan.
    – volledige backup gemaakt van zowel de database als van alle mappen en bestanden via Fillzilla
    – de gevraagde update’s uitgevoerd in mijn wp-dashboard: plugins aanvankelijk gelukt, later deze melding; ” must be an array or an object that implements Countable in D:\Inetpub\vhosts\npvr.nl\httpdocs\WP\wp-includes\kses.php on line 895″
    – Thema’s updaten deels gelukt. Bij het updaten van mijn hoofdthema “Divi” ging het mis, kreeg ik een Error 500 en een volledig wit scherm (geen site meer dus). Voorgaande terug gezet en site weer zichtbaar. Via de Elegant themes support deels hulp gehad om mijn divi goed te kunnen updaten met susses. Ik kan alleen nog steeds niets toevoegen; geen pagina’s, geen berichten, geen media… niets!
    – er werd/wordt ook gevraagd naar een update van wp van 4… naar 5.0.3 en dat lukt dus niet. Ik blijf bovenstaande warning krijgen
    – nwe versie van wp 5.0.3. gedownload, uitgepakt en alles geupload via filleZila behalve de wp-content map (volgens advies ExactHost en de stappen van https://kinsta.com/blog/reinstall-wordpress/)
    – gevolg:

    Fatal error: Uncaught TypeError: Argument 2 passed to WPSEO_Link_Watcher::save_post() must be an instance of WP_Post, null given, called in D:\Inetpub\vhosts\npvr.nl\httpdocs\WP\wp-includes\class-wp-hook.php on line 288 and defined in D:\Inetpub\vhosts\npvr.nl\httpdocs\WP\wp-content\plugins\wordpress-seo\admin\links\class-link-watcher.php:41 Stack trace: #0 D:\Inetpub\vhosts\npvr.nl\httpdocs\WP\wp-includes\class-wp-hook.php(288): WPSEO_Link_Watcher->save_post(0, NULL) #1 D:\Inetpub\vhosts\npvr.nl\httpdocs\WP\wp-includes\class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #2 D:\Inetpub\vhosts\npvr.nl\httpdocs\WP\wp-includes\plugin.php(453): WP_Hook->do_action(Array) #3 D:\Inetpub\vhosts\npvr.nl\httpdocs\WP\wp-includes\post.php(3747): do_action(‘save_post’, 0, NULL, false) #4 D:\Inetpub\vhosts\npvr.nl\httpdocs\WP\wp-includes\theme.php(1793): wp_insert_post(Array, true) #5 D:\Inetpub\vhosts\npvr.nl\httpdocs\WP\wp-content\themes\Divi\epanel\custom_functions.php(95): wp_update_custom_css_post(‘#lees-meer {\n\tb…’) #6 in D:\Inetpub\vhosts\npvr.nl\httpdocs\WP\wp-content\plugins\wordpress-seo\admin\links\class-link-watcher.php on line 41

    Ik heb dus dringend hulp nodig van iemand die mij daadwerkelijk kan helpen
    Naar mijn gevoel wordt ik nu al 3 weken van het kastje naar de muur gestuurd.
    Graag spoedig adequate hulp graag,
    alvast heel hartelijk dank
    Rita Manaï

    • This reply was modified 2 years, 3 months ago by Rietje54.
    • This reply was modified 2 years, 3 months ago by Rietje54.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Warning: count(): Parameter must be an array or an object that implements’ is closed to new replies.