Skip to content

Commit

Permalink
Fixes issue #8 by providing a default 'where' value
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jcdm authored Jul 8, 2017
1 parent 5d7fbe1 commit a3103a4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -113,4 +113,4 @@
} else {
return 'You must have getResources downloaded and installed to use this snippet.';
}
return $output;
return $output;

1 comment on commit a3103a4

@rthrash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Community. There might be relevant details there:

https://community.modx.com/t/archivist-landing-page-blank/1420/1

Please sign in to comment.