We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34020
    • 18 Posts
    I just updated a site that has been running perfectly fine with 2.2.1-dev to 2.2.4-pl.

    Overall everything is working ok, but in several custom snippets the following syntax has stopped working:

    $chapter = $modx->getObject('AppChapters', array('userid' => $leader->get('id')));


    Specifically,
    array('userid' => $leader->get('id'))


    If I set $leader->get('id') to an id that should work just fine, like 11, it doesn't work either. See:
    $chapter = $modx->getObject('AppChapters', array('userid' => 11));



    HOWEVER, if I put the number in quotes it works fine. Both of these work.

    $chapter = $modx->getObject('AppChapters', array('userid' => "$leader->get('id')"));

    $chapter = $modx->getObject('AppChapters', array('userid' => "11");


    The problem isn't with any relationships. I just have to put quotes around it to make it work. I can continue to do that for all of the snippets, but it seems like a band-aid approach. Is this a bug with xpdo?

    Any ideas what could be causing this?

      • 34020
      • 18 Posts
      So in a completely unrelated post I found the source of the problem.

      https://forums.modx.com/thread/73277/getobject-in-script-resolver-no-longer-works#dis-post-407435

      I had database caching enabled. I simply disabled it and everything started working again. Not sure exactly why that would affect it yet, but I'm 100% positive that's the issue.

      Hopefully tomorrow I can regain the 8 hrs that I lost yesterday and today. smiley