Skip to content
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

[] operator not supported #8

Open
lottaar opened this issue May 8, 2017 · 3 comments
Open

[] operator not supported #8

lottaar opened this issue May 8, 2017 · 3 comments

Comments

@lottaar
Copy link

lottaar commented May 8, 2017

Hi,

I've upgraded my site to MODX 2.5.7 and moved it to a new web server with PHP 7.1. Now I get the below error when using Archivist 1.2.4-pl. Is it due to incompatibility with PHP 7 and is there a quick way of solving it?

Thanks!

Fatal error: Uncaught Error: [] operator not supported for strings in /var/www/vhosts/mydomain.com/httpdocs/core/cache/includes/elements/modsnippet/2.include.cache.php:60 Stack trace: #0 /var/www/vhosts/mydomain.com/httpdocs/core/model/modx/modscript.class.php(70): include() #1 /var/www/vhosts/mydomain.com/httpdocs/core/model/modx/modparser.class.php(521): modScript->process() #2 /var/www/vhosts/mydomain.com/httpdocs/core/model/modx/modparser.class.php(250): modParser->processTag(Array, true) #3 /var/www/vhosts/mydomain.com/httpdocs/core/model/modx/modresponse.class.php(69): modParser->processElementTags('', '<!DOCTYPE html ...', true, false, '[[', ']]', Array, 9) #4 /var/www/vhosts/mydomain.com/httpdocs/core/model/modx/modrequest.class.php(137): modResponse->outputContent(Array) #5 /var/www/vhosts/mydomain.com/httpdocs/core/model/modx/modx.class.php(1146): modRequest->prepareResponse() #6 /var/www/vhosts/mydomain.com/httpdocs/core/cache/includes/elements/modplugin/1.include.cache.php(76): modX->sendForwar in /var/www/vhosts/mydomain.com/httpdocs/core/cache/includes/elements/modsnippet/2.include.cache.php on line 60

@Mark-H
Copy link

Mark-H commented May 25, 2017

Suspect this line caused by either an invalid &where property, or no &where property. Code should check better if it's an array or not.

Perhaps this can be used as workaround &where=`[]` to pass it an empty json array.

@jonleverrier
Copy link

jonleverrier commented May 25, 2017

had the same issue.

adding &where=[] worked for me. I'm running PHP7.1.1

thanks @Mark-H !

@lottaar
Copy link
Author

lottaar commented May 26, 2017

Indeed, adding &where=[] to my [[!getArchives]] call did the trick for me as well.

Thanks guys!

jcdm added a commit to jcdm/Archivist that referenced this issue Jul 8, 2017
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants