I can't seem to get a snippet to load properly in a secondary context. I have my primary website at domain1.com and the secondary at sub.domain2.com. I used the instructions here to setup the subdomain:
http://rtfm.modx.com/revolution/2.x/administering-your-site/contexts/creating-a-subdomain-from-a-folder-using-virtual-hosts. This part worked without a problem. The page, sub-pages with friendly urls, chunks, and so on all load fine. Here are the context settings:
The anonymous user group has load privileges on the context (this was done by default when the context was added). I did add a resource group on domain1.com to make a members only area. However, it looks like by default anonymous users can access any pages without a resource group applied (the non-member areas).
The test snippet makes a simple timestamp:
<?php
return date('Y-m-d h:m:s');
If I use this snipped in the primary context, no problem. If I try it in the secondary site, it doesn't work. And here is the strange part. After it loads successfully in the primary context, then it can load in the secondary context. Once it loads successfully in the primary context, the timestamp updates each time I refresh the page on domain2. If I clear the cache, it doesn't work anymore until it loads successfully in the primary context again.
I added a debug script to the snippet to see when it is triggering:
$modx->setLogLevel(modX::LOG_LEVEL_DEBUG);
$modx->log(modX::LOG_LEVEL_DEBUG, 'test snippet fired');
When I run this in the web context, the message appears in the error log as anticipated. However, when I run it on domain2, the timestamp updates, but there is no record in the log. It looks like the snippet is blocked somehow, so it pulls the php from the cache.
I am running modx 2.2.13 SDK. The security settings are the default with the exception of adding a resource group for the members only area. It looks like this might be a permissions issue, but I can't seem to find anything that makes sense to change. I have cleared the cache, flushed permissions, and flushed all sessions to ensure the anonymous user is seen as having privileges to access the domain2 context. Any ideas?