Archivist Landing Page Blank

Having updated to PHP 7.2, Archivist now loads a blank page from the [[+url]] in the navigation link Tpl chunk called by [[!Archivist?]] , so for example, the archive link to shows a blank page, with a ‘HTTP ERROR 500’

The error log shows
/home/p/public_html/core/cache/includes/elements/modsnippet/1.include.cache.php : 142) PHP warning: count(): Parameter must be an array or an object that implements Countable

We see this stack trace:
mod_fcgid: stderr: #0 /home/p/public_html/core/model/modx/modscript.class.php(70): include()
mod_fcgid: stderr: #1 /home/p/public_html/core/cache/includes/elements/modsnippet/4.include.cache.php(61): modScript->process(NULL)
mod_fcgid: stderr: #2 /home/p/public_html/core/model/modx/modscript.class.php(70): include(’/home/p/publi…’),
mod_fcgid: stderr: #3 /home/p/public_html/core/model/modx/modparser.class.php(536): modScript->process(Array)
mod_fcgid: stderr: #4 /home/p/public_html/core/model/modx/modparser.class.php(250): modParser->processTag(Array, true),
mod_fcgid: stderr: #5 /home/p/public_html/core/model/modx/modresponse.class.php(69): modParser->processElementTags(’’, ‘…’, true, false, ‘[[’, ‘]]’, Array, 9)
mod_fcgid: stderr: #6 /home/p/public_html/core/model/modx/modrequest.class.php(137): modResponse->outputContent(Array),
mod_fcgid: stderr: #7 /home/p/public_html/core/model/modx/modx.class.php(1144): modRequest->prepareResponse(),
mod_fcgid: stderr: #8 /home/p/public_html/core/cac in /home/p/public_html/core/cache/includes/elements/modsnippet/2.include.cache.php on line 60

Tried this fix, but no joy:

Apache - PHP 7.2 Modx 2.7.1

Just a further update - the site was previously on php 5.2 before migration to 7.2 and this issue starting.

1 Like

So this was solved for PHP 7.2. In Snippets, in the getArchives snippet, Line 60 is changed with an additional line
$where[] = 'FROM_UNIXTIME(‘.$filterField.’,"%Y") = "'.$year.'"';
$where =[];
$where[] = 'FROM_UNIXTIME(‘.$filterField.’,"%Y") = "'.$year.'"';

Ignore the Github link above, as that change has no effect. PHP updates means the $where needs to be declared as an array first. Be great to see this fixed in Archivist as there’s no updates at the time of writing.

That’s what the linked issue actually does; when the &where parameter defaults to [] that causes it to start as an array when it is json_decode()'d.

Perhaps you’ve provided a different &where in your snippet call that isn’t valid JSON?

Hi Mark,
Yes, we were running a &where parameter on the snippet, but removing that parameter completely from the snippet call, clearing cache and implementing the Github fix still didn’t solve the issue…
The above workaround has solved it for now.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.