1 amoun Apr 19, 2018 13:30
3 amoun Apr 19, 2018 17:34
Another call to count()
In file [/inc/items/model/_items.funcs.php]
Line 908 in v6.9.5
Line 915 in v6.10 beta
Modified with addition of square brackets to::
$where = count([$where]) > 0
4 amoun Apr 19, 2018 17:52
One more call to count()
In file [/inc/items/model/_items.funcs.php]
Line 990 in v6.10
Line 983 in v6.9.5
I wonder if SELECT count(*)
is proper?
Added square brackets and excerpts are showing ok in
v6.9.5 / php5.4.41
v6.9.5 / php7.2.4
$all_excerpt = $DB->get_var( 'SELECT count([*]) FROM evonet_items__item WHERE post_excerpt IS NULL AND '.$where_condition );
$recreated_excerpts = 0;
5 fplanque Apr 20, 2018 00:44
You are mixing up the PHP count function with the SQL count function. Same name but different functions.
6 amoun Apr 20, 2018 00:52
Hi Francois
Do you mean in post #4 SELECT count([*])
but that the php function ones are do need the square brackets?
I've removed the brackets from the SQL function
7 amoun Apr 20, 2018 10:09
I've just noticed an alternative warning, which may have been there before as I hadn't check single posts and scrolled down. This warning is below the post and before the feedback, whether I'm logged in or not. So much for my 'fix' :)
Notice: Array to string conversion in H:\xampp\htdocs\calstock.org.uk\inc\items\model_item.funcs.php on line 905
Solution ??
Looking at http://php.net/manual/en/migration72.incompatible.php#migration72.incompatible.warn-on-non-countable-types
I noticed that the function
count()
requires an array i.e.count([some data])
notcount(some data)
so I enclosed the data$show_statuses
in square brackets and the warning has goneI hope this is a reasonable solution, could some one confirm?
Just checked v6.9.7 and it is the same so have modified the file before upgrading
Just checked v6.10 beta and it is the same.
Modification working on my b2evo 6.9.5 with php5.4.41