-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
count(): Parameter must be an array or an object that implements Countable #3226
Comments
Confirmed with Drush 9 RC1. |
@anavarre Are you sure? Drush 9 has no dependency on |
No, I'm not. It happened when installing either the Lightning or Reservoir distro, not with vanilla Drupal 8.5.x - I honestly didn't dig deeper yet. |
BTW, is it on Drush to fix the issue? It seems to me it could be a core bug https://www.drupal.org/project/drupal/issues/2928846 |
It is a general PHP 7.2 issue. count() function should not be used to count uncountable values anymore. This particular warning comes from Pear Console Table package. I referenced related issue in the ticket description. That package does not seem actively maintained. Given it is just a single class, we could simply copy it to Drush 8 codebase. |
A backtrace says the call is in function _updateRowsCols($rowdata = null) {
// ...
$this->_max_cols = max($this->_max_cols, count($rowdata));
// ...
} Console_Table class is doing it wrong because it relies on the Alternately we could |
If someone wants to make a PR for drush8, that would be appreciated. Seems like @silent operator is better than copying the lib. |
Hello,I met the same error,do you fix it out? |
Is this fixed in pear/console_table 1.3.1 / Drush 8.1.16? Not sure what the resolution was, but that seemed to be my conclusion during light testing yesterday. Didn't see the message when running 8.1.16. |
Its fixed in Pear channel. The project looked pretty dead but they fixed it
in upstream.
…On Mar 9, 2018 23:16, "Greg Anderson" ***@***.***> wrote:
Is this fixed in pear/console_table 1.3.1 / Drush 8.1.16? Not sure what
the resolution was, but that seemed to be my conclusion during light
testing yesterday. Didn't see the message when running 8.1.16.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3226 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAxiIWpXHb6xV18968fKfR92tkz9k92Hks5tcpzZgaJpZM4Q8AGs>
.
|
Can confirm that running |
Using |
drush 7 and php7.2 the same problem |
I think the PHP requirements in the documentation are not correct. Old Drush version are likely not compatible with PHP 7.2+. |
Use Console_Table 1.3.1 instead of Console_Table 1.1.5 that comes by default with drush 6.7.0 version. At https://github.com/drush-ops/drush/blob/6.x/includes/environment.inc Console_Table 1.1.5 is downloaded dynamically if it does not already exist in lib folder. So we download 1.3.1 first and rename it to 1.1.5 as a "trick" to make it work without any other change
I have Drush 7.4 and PHP 7.3.9, and I'm still seeing this issue. |
@kenahoo Drush 7 is unsupported. Updating to Drush 8 will resolve the issue. |
Thanks @Chi-teck , that indeed resolved it. |
Error sighted. If drush is globally installed this can be fixed via: |
That solved it! Thanks |
For Drush 7 users. I've added this requirement in my project
|
For Drush 7, installed globally I added this in the ~/.composer/composer.json file, and then I runned 'composer update' |
This only happens on PHP 7.2
pear/Console_Table#14
The text was updated successfully, but these errors were encountered: