After upgrading to 3 I get error: [2022-03-31 14:09:34] (ERROR . . . /core/cache/includes/elements/modx/revolution/modsnippet/1.include.cache.php : 129) PHP warning: count(): Parameter must be an array or an object that implements

What could be the problem?
How do I get rid of it?
Seemingly it has no impact on the site

[2022-03-31 14:09:34] (ERROR @ /home/haurdalhus/public_html/core/cache/includes/elements/modx/revolution/modsnippet/1.include.cache.php : 129) PHP warning: count(): Parameter must be an array or an object that implements Countable

What exactly is your snippet with the ID=1?

UpgradeMODX

  • but that gave me no errors on other sites (upgraded several already)
    I uninstalled and reinstalled: No change - still same error

Are you sure itā€™s UpgradeMODX?

Although this extra has a snippet called ā€œUpgradeMODXWidgetā€, there is no call to count() in it, to produce the warning.


Maybe the servers for the other sites are configured differently (error_reporting, display_errors, etc.) and donā€™t display a message for warnings.

Sorry Harry,
I did not ā€˜unfoldā€™ the snippets.
It is ā€˜Archivistā€™ - used in ā€˜MODx Sample Siteā€™

I think I have seen this issue as well after updating PHP to version 8:

If you upgraded PHP to 7.2 or above that might explain it.

I posted a quick fix for this on the page linked above

It seems, this is the approved fix for the problem:

1 Like

Yes, that seems to eliminate the problem.
Thank you all.

1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting ā€œ+ New Topicā€.