One of the things that slows me down when I'm making a CMP is that when something breaks, there is sometimes no feedback as to what went wrong.
I have a similar, but unrelated problem with administering site permissions. When access is denied, there is often no feedback as to why. (*)
Here's a concrete example of where both of these issues happened simultaneously for me today.
In connectors/index.php around line 40 there is this code:
if (defined('MODX_REQP') && MODX_REQP === false) {
} else if (!$modx->context->checkPolicy('load')) {
@session_write_close();
die();
}
Basically what this says is that "if the user doesn't have load access in this context, then fail without any feedback".
Today I was designing a CMP and I couldn't figure out why my form submission button did nothing. Looking at firebug revealed that the the request was returning 200 OK with no content.
Firing up XDEBUG led me to the above failed permissions check, and after a couple of hours of debugging, I found out what permissions check was failing and why.
The bug was my own fault (**), but it was really hard to track down what was happening, in part because when I clicked that button, I got no feedback that there was even a permissions problem. And after I realized it was a permissions problem, there was no help to narrow it down what permission was failing.
In retrospect, enabling debugging by putting $modx->setDebug(true) at the top of connectors/index.php would have been somewhat helpful as a first step. I think that how to enable debugging should be mentioned more prominently in the docs.
Apologies for the rant. I've been complaining recently in very vague terms about MODx not providing enough feedback when something goes wrong and I finally found a specific example. I'm not sure if I should report it as a bug or not.
Michael
(*) There are many ways that a permissions check could have failed. Maybe it was a missing Context ACL. Or a missing Resource Group ACL. Or maybe the user was in the wrong User Group (or had the wrong role in the right group). Or maybe the resource was in the wrong resource group. Or even: maybe the resource used to be unsecured (and so was implicitly visible to everyone), but someone was granted write access to it, and that disabled implicit read access for everybody else.
(**) The reason for the access denied was my own fault and pretty bizarre: I had copied my CMP from another modx site on my dev box, and the CMP was setting MODX_CORE_PATH to the previous site's core directory. This meant that it was actually connecting to the other site's database. So even though I was an administrator on the site I was developing for, the connector's permission check was loading all the context ACLs from the other site.
[ed. note: michael.graham last edited this post 14 years, 6 months ago.]