Home › Forums › Support › Warning: count(): Parameter must be an array or an object that implements Count
- This topic has 18 replies, 3 voices, and was last updated 6 years, 7 months ago by Tom.
-
AuthorPosts
-
October 5, 2017 at 9:04 am #397978John
Using the GeneratePress Theme 1.4, after activating the GP Premium plugin, Version 1.4.3, the below Warning messages appear at Dashboard > Pages, and at Dashboard > Posts:
Warning: count(): Parameter must be an array or an object that implements Countable in D:\Server\data\htdocs\2017\wp-admin\includes\template.php on line 1447
Warning: count(): Parameter must be an array or an object that implements Countable in D:\Server\data\htdocs\2017\wp-admin\includes\template.php on line 1447
> However, no problems. Everything seems to operate as expected
&
> Why I think Generate Press Pro plugin is the cause.
I created a new install of WordPress 4.8.2. The default theme is 2017. No Warning messages.
I installed and activated Generate Press Theme 1.4. No Warning messages
I installed and activated the GP Premium plugin. The Warning messages appeared.
I deactivated the GP Premium plugin. No Warning messages.
&
> I am using Windows 7 Pro 64 bit.
> “D:\Server\data\htdocs\2017” is the path to the install of WordPress.
> I am very puzzled because obviously no one else had this problem. I did a search on “Warning” and “Warning:” and “Count()” . I found no other instances of the Warning Messages.October 5, 2017 at 9:35 am #398014TomLead DeveloperLead DeveloperHmm, haven’t had any other reports of this. I wonder if it’s a server thing.
Do you have a live server you’ve tested on? It could be due to hosting the site on Windows 7.
January 20, 2018 at 7:57 am #475686EnricoI have the same problem in two of my sites that use GP Premium. The other 3 are immune.
The warning is displayed in the sites if I use Php 7.2.1 with GP premium. With Php 7.1 and GPP there is no problem.
I have no warning with Php 7.2.1 only when GP Premium plugin is deactivated.This is one warning in one of the two sites.
Warning: count(): Parameter must be an array or an object that implements Countable in /home/jobseeke/public_html/yourcopywriter.it/wp-includes/media.php on line 1206
If you want to see it I need to activate php 7.2 first.
January 20, 2018 at 9:35 am #475773TomLead DeveloperLead DeveloperWhat if you deactivate all of the GPP modules? Same error?
January 20, 2018 at 10:08 am #475785EnricoHi Tom,
it is the blog module, now I have disabled it and so I can use PHP 7.2.1 with GPP without having the the warning in the site.January 20, 2018 at 10:28 am #475795EnricoWhat is strange is that I use GPP with the blog module activated in a third site and I am not having this warning on the third site if I activate php 7.2.1.
The third site, that is immune, it is the newest. It bore with https, the other two had to be converted to htpps.
For the moment I don’t remember or notice other difference.January 22, 2018 at 1:01 pm #477412TomLead DeveloperLead DeveloperI just updated our development server to PHP 7.2 and I’m not able to reproduce this issue. Can you confirm which pages you’re seeing the warnings on?
January 23, 2018 at 12:13 am #477724EnricoIf you go to yourcopywriter.it you will see the problem. I can not keep the warning for long time. So if you don’t go there soon I will deactivate the blog module again. In this case we will try again tomorrow for you.
January 23, 2018 at 12:53 am #477731EnricoThis is the Warning in home page You can see the warnings on all the site’s pages if php 7.2.1 is active with blog module.
I think you went to sleep, so now I have deactivated again the blog module. Let me know how and when you want to see it.
January 23, 2018 at 11:06 pm #478544TomLead DeveloperLead DeveloperLooking into this some more – will update ASAP 🙂
January 24, 2018 at 3:37 pm #479233TomLead DeveloperLead DeveloperStill having trouble reproducing this. Do you have custom sizes added for your featured images in Customize > Layout > Blog > Featured Images?
January 25, 2018 at 12:39 am #479386EnricoNo I did’ set custom size but when I deselect “infinite scroll” the warning disappeared.
I set infinite scroll again and so the warning is back.You have to exit customize to see the warning.
This are some of the setting I have when the warning is displayed.
And this is the export of the blog setting:
{“excerpt_length”:”25″,”read_more”:”Continua a leggere”,”masonry”:true,”masonry_width”:”width2″,”masonry_most_recent_width”:”width4″,”masonry_load_more”:”+ Altro”,”masonry_loading”:”Caricamento…”,”post_image”:true,”post_image_position”:””,”post_image_alignment”:”post-image-aligned-center”,”post_image_width”:””,”post_image_height”:””,”date”:true,”author”:true,”categories”:false,”tags”:false,”comments”:true,”column_layout”:true,”columns”:”50″,”featured_column”:true,”single_date”:true,”single_author”:true,”single_categories”:false,”single_tags”:false,”infinite_scroll”:true,”infinite_scroll_button”:true,”single_post_image_position”:”inside-content”,”page_post_image_position”:”above-content”}
January 28, 2018 at 8:01 pm #482095TomLead DeveloperLead DeveloperHaven’t given up on this – just haven’t been able to replicate it yet. Will update you ASAP.
January 29, 2018 at 5:06 am #482397EnricoI stopped using masonry since it create one issue of first load alignment on category page with Yoast. (You gave me a code to fix it but it is not good if used with an other plugin I use)
The side effect of not using masonry is that the warning disapprender on blog and category, even when I use infinite scroll with php 7.2.
The warning now it is displayed only on some pages, if I use the blog module with infinite scroll and Php 7.2.
So, try to set also the masonry, to try to replicate the warning and check several pages. I hope this information will help you.
For me this it is not an issue since I don’t need to use php 7.2. I could stay with php 7.1 for long time.
I have read somewhere that in php 7.2.3 this warning will not be display on production. I am not sure I understood this correctly but a warning should not be displayed on a production site and I didn’t find a way to stop it.
January 29, 2018 at 7:23 pm #483132TomLead DeveloperLead DeveloperFound it! Will push out a quick fix this week.
For now, try adding this:
add_action( 'after_setup_theme', 'tu_fix_72_warning' ); function tu_fix_72_warning() { add_filter( 'wp_calculate_image_srcset', '__return_empty_array', 20 ); }
-
AuthorPosts
- You must be logged in to reply to this topic.