There are no PHP syntax errors in the code, but when you do that much concatenation, it's difficult to get everything right.
Is there anything in the MODX error log?
Hi James,
Other than the MODX error log, another place you can check on the cloud is the /log directory. If nothing shows in the MODX error log, you can also check where I specified.
On the topic of syntax, I will gladly defer to Bob's knowledge of syntax rather than my own, but one thing to consider is that maybe it's not the snippet itself that is causing this. You can verify by simply removing the snippet from the resource to see if the error 500 still appears.
Assuming that it is the snippet, try breaking apart the large if / else if blocks so that you're testing them one at a time. If they each work individually, then it might be how they are strung together.
If they don't work, then try replacing all of your concatenations with string literals and then if all is still messed up, try taking out some non-required parameters.
Hopes this gives you some ideas.
Regards,
Tom
It turned out to be a problem in the template that getResources was using, but many thanks for the pointers as it spurred me on to finding the fault.
I diagnosed it by removing the outer double pair square brackets which is stored in the output so that I could see the command being run and manually tried the output from there.