-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes issue #8 by providing a default 'where' value #10
base: develop
Are you sure you want to change the base?
Conversation
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.
Anyone know if there is a maintainer for Archivist? Any volunteers? 😃 |
What is the procedure within the MODX community to become the official maintainer of an existing package? I would be interested to take this one. |
This pull request has been mentioned on Community. There might be relevant details there: https://community.modx.com/t/archivist-landing-page-blank/1420/1 |
Is this repo still maintained? This pull request needs to be merged. |
@@ -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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If where contains an invalid JSON, the following line has to be added.
$where = !empty($where) ? $where : array();
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 in the snippet if no setting has been passed from the snippet call.