From a3103a44b79d2fea41bf567858210fb23a38c1ce Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 9 Jul 2017 00:28:46 +0930 Subject: [PATCH] Fixes issue #8 by providing a default 'where' value There's been an issue with PHP7 (or MODX 2.5.7 - not totally sure which) where the user must add a &where=`[]` to the getArchives call to avoid a server 500 error. This update provides that default if no setting has been passed from the snippet call. --- .../archivist/elements/snippets/snippet.getarchives.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/components/archivist/elements/snippets/snippet.getarchives.php b/core/components/archivist/elements/snippets/snippet.getarchives.php index a1c5339..aff94e3 100644 --- a/core/components/archivist/elements/snippets/snippet.getarchives.php +++ b/core/components/archivist/elements/snippets/snippet.getarchives.php @@ -49,7 +49,7 @@ } /* get filter by year, month, and/or day. Sanitize to prevent injection. */ -$where = $modx->getOption('where',$scriptProperties,false); +$where = $modx->getOption('where',$scriptProperties,"[]"); $where = is_array($where) ? $where : $modx->fromJSON($where); $parameters = $modx->request->getParameters(); @@ -113,4 +113,4 @@ } else { return 'You must have getResources downloaded and installed to use this snippet.'; } -return $output; \ No newline at end of file +return $output;