Hi folks, been a lurker, now a first time poster since creating my forum. I've UTFSE here and on Google for an answer to this problem, but I can't find the answer to this issue. The problem seems simple enough to fix, but it just doesn't make sense sense why it exists. If its a bug, I'd rather just disable the phpBB Debug from being visible to visitors and regular members.my

Here's the problem:

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

I've checked line 1275 in the Core.php and this is what its pointing to:

Support Request TemplateWhat version of phpBB are you using? phpBB 3.2.1What is your board's URL?http://www.romanova.club/forum/Who do you host your board with?www.namecheap.comHow did you install your board? I used the download package from phpBB.comWhat is the most recent action performed on your board? Fresh InstallIs registration required to reproduce this issue? NoDo you have any MODs installed? NoDo you have any extensions installed? NoWhat styles do you currently have installed? prosilverWhat language(s) is your board currently using? EnglishWhich database type/version are you using? MariaDBWhat is your level of experience? New to PHP and phpBBWhat actions did you take (updating your board; installing a MOD, style or extension; etc.) prior to this problem becoming noticeable? Prior to noticing this problem, everything worked fine. After I updated my linux system and configured a simple stateful firewall/iptables on my webserver, the problem was noticed.

I uninstalled the only extension [VigLink] and disabled the prosilver theme, but I still get the following two messages back to back on the forum. Please describe your problem. The error messages appear at the very top of the forum - above the header, also in the ADP General tab in the upper left corner [above "Quick Access", but below "You are logged in as:"], it shows after each forum desciption, and in the "forum birthdays" area:

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Is this a mistake in what you wrote or is it really possible to disable the only present theme and still run the forum? ( I'm not taunting or anything: I really don't know but it doesn't seem logical to me).
edited for spelling mistakes (well ... at least the ones I noticed)

Last edited by warmweer on Fri Dec 08, 2017 7:21 pm, edited 1 time in total.

In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric HofferFormer Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

The solution to this problem is with twig and not phpbb. The version of twig in use has coding error with the count() function, which is now being flagged by php 7.2. The solution is to update twig, or for a quick fix just edit the core.php file as stated here:

The solution to this problem is with twig and not phpbb. The version of twig in use has coding error with the count() function, which is now being flagged by php 7.2. The solution is to update twig, or for a quick fix just edit the core.php file as stated here:

Is this a mistake in what you wrote or is it really possible to disable the only present theme and still run the forum? ( I'm not taunting or anything: I really don't know but it doesn't seem logical to me).
edited for spelling mistakes (well ... at least the ones I noticed)

The solution to this problem is with twig and not phpbb. The version of twig in use has coding error with the count() function, which is now being flagged by php 7.2. The solution is to update twig, or for a quick fix just edit the core.php file as stated here:

[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/template/context.php on line 204: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_acp.php on line 137: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3268)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_acp.php on line 137: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3268)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_acp.php on line 137: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3268)

This warning message still occurs on 3.2.2 and PHP 7.2.1. In my opinion this is a case where this new count( ) warning message in PHP 7.2 actually has its use, since this warning is a bug in phpBB and not simply a count( ) / isset( ) / sizeof( ) void warning message.

It occurs @ ACP System Tab, and ONLY in the four items under "General Tasks" section on the left.

It seems in /phpbb/template/context.php in the for( )-loop around line 204, at some point there is no array assigned to $block and therefore the debug warning pops. I've tried debugging it but it goes over my head. It's not a very simple solution I'd say, since you need good understanding of where all the assinged values in $block come from.

I'm not sure if this bug is already reported in the bug tracker, but if anyone would like to post it, please feel free to do so. I'm more of a lurker, but I did my 2 cents for the community with this message.

I can confirm that this bug is NOT "solved" and still exists in phpbb 3.2.4 with PHP Version 7.2. PHP 7.1 is fine but PHP 7.2 throws the following errors on any of the 4 GENERAL TASKS in the SYSTEM tab (Spiders/Robots, Mass email, PHP information and Manage report/denial reasons).

[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/template/context.php on line 204: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_acp.php on line 137: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3314)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_acp.php on line 137: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3314)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_acp.php on line 137: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3314)

The errors exist on both of the boards that I administer running PHP 7.2.