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

getObject() without criteria crashes collection methods work #105

Open
spectrum48k opened this Issue Dec 26, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@spectrum48k
Copy link

spectrum48k commented Dec 26, 2016

Summary

getObject() without criteria causes nesting level error for collection methods.

Step to reproduce

  1. clear cache for 'someClass' db objects
  2. $modx->getObject('someClass') and $modx->getCollection('someClass') after that.

Observed behavior

execution of php script stops with "nesting_level_error"..
trace_screen

debugging results:
in case of no cache files created for db objects of 'someClassKey':
->getObject('someClassKey'); and ->getCollection('someClassKey') (or ->getMany('someAliasOfClassKey')) after that
shoots to cache file with same md5 prefix, but collection methods need different nesting of arrays inside cache files. This causes wrong recursion and nesting level error when collection loads from cache. So, ->getObject() without unique criteria is bad practice for current xPDO caching principle of version that I use (MODX Revolution 2.3.3-pl (traditional)).

Expected behavior

expected single instance of 'someClass' object and collection array of 'someClass' objects in results.

Environment

MODX version MODX Revolution 2.3.3-pl (traditional)

@spectrum48k

This comment has been minimized.

Copy link

spectrum48k commented Jun 16, 2017

_028

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment