I have a snippet (sn_get_gallery_array) that creates a php array of information about my Gallery photo albums. The resulting array is quite small, two subarrays each with about 30 strings, and is returned at the the end of the snippet using
.
In another snippet (sn_galleries) I have
$gals = $modx->runSnippet('sn_get_gallery_array'); to get the returned array, but it always returns an empty array.
I know the array in sn_get_gallery_array is not empty - within the sn_get_gallery_array snippet I can dump the array into a log file and see the array elements, and I can copy the array into a $_SESSION variable and later access them from there.
So why does runSnippet() return an empty array? I don't have problems returning strings via runSnippet(), so I know it's not a syntax issue. I manually refreshed the cache a few times but that didn't make any difference. There are no errors either in ModX or in my server logs. Any ideas about what's wrong here?