Home Forums Theme support Parameter must be an array or an object that implements Countable in Cora theme

This topic contains 3 replies, has 2 voices, and was last updated by  7Theme Support 3 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Hello sir/madam,

    I’ve some compatibility issues on your WordPress Cora theme i purchased.
    I’m running PHP 7.2XX

    It shows me the error below:

    Warning: count(): Parameter must be an array or an object that implements Countable in /home/public_html/wp-content/themes/cora/7league/shortcodes.php on line 4198

    Below you’ll find the line in shortcodes.php on line 4198:

    for($i=0;$i<count($social_media);$i++) {

    How to solve this?

    Could you please provide me the last updated version (for PHP 7.2xx) of this theme?

    Many thanks in advance,

    Best regards,

    Dirk-Jan

    Hi,

    no worry, it’s not an error, it’s only a warning. The problem is that these messages are visible on your website, because those notices are only for developer. This is a security issue, because a hacker can provoke such kind of message and hack your website. Please check if in your hosting panel is a setting for “PHP Errors and Warnings”, and turn it off.

    Please note: there is no problem with the theme, it’s only a warning. The theme is working without any problem.

    Hi,

    Thank you for your quick reply.
    Sorry, but i think this issue:

    Warning: count(): Parameter must be an array or an object that implements Countable in /home/public_html/wp-content/themes/cora/7league/shortcodes.php on line 4198

    is related to an PHP conflict error instead of just a ”warning”
    Is this because i noticed the social media buttons are also not visible on my website, after imported all the demo-content of the theme.

    When i check a related topic online, i noticed this:

    From PHP 7.2.0 count() will now yield a warning on invalid countable types passed to the array_or_countable parameter.

    You can check this topic about this issue here:https://mage2.pro/t/topic/5216/2

    I’m not a programmer, but i think line 4198 of cora/7league/shortcodes.php in your Cora theme needs to be adjusted to fix this issue:

    This is the line:
    for($i=0;$i<count($social_media);$i++) {

    Do you know what i need to adjust to this code-line above to fix this issue?

    Looking forward to hear from you,

    Best regards,

    D.J.

    Ok, we made an update, it’s available now, you can download it in your account. But you should really change your PHP settings, that’s really an security issue

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.