We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15132
    • 2 Posts
    Hi. I’m new to this, so I hope this hasn’t been covered already.

    I ran into a problem when I first installed the system the other day. The install scripts are coded with PHP ’@’ operators on the mysql API calls, so there is no error reporting. But, when using MySQL 4.1 there is a problem with passwords unless the OLD_PASSWORD feature is enabled in MySQL. Because the errors are not reported, this becomes very hard to diagnose. What results is simply a message that MODx cannot connect to the database. It would be helpful if there was a reminder to this effect in the install documentation. It might also help if the MySQL errors were allowed to show. The way I found this and corrected it was to edit the PHP install script, remove the ’@’ operators, and finally see the error messages. The result of the error was a ’Client does not support authentication protocol’ error ... which then gets fixed with the OLD_PASSWORD feature.
      • 18409
      • 54 Posts
      I go with this in other areas as well about the lack of error reporting, and I’ve ended hacking code in other areas to get it to report exactly why it is failing.

      Modx is a wicked app, but I find if things go wrong, they just tend to die with no errors.

      A lot of this is down to snippet authers as much as the core app itself as if the snippet dies with no error Modx can’t do much about it, and modx very much has a philosophy of providing the framework that you can bolt things onto it seems (which is why it is good in many ways).

      Also, error messages often contain information that could be useful to a hacker, and so on production sites it is generally better to die quietly than display loads of infomation. (Obviously on the install script this isn’t so relevant).

      Maybe future versions of Modx could include a "debug" configuration option that could be used on testing servers and could be used by snippet authers to know whether to output any debugging info, and then switched off for a production site. It would make things quite a lot better to get more infomation like sql error messages etc.

      I use a similar thing on my own web projects, and I imagine it is a rather common technique?
      • As we say goodbye to the legacy Etomite core which MODx was originally forked from, and I introduce the new object-oriented core for MODx 0.9.7, a number of debugging and logging enhancements will be introduced, including custom error_handler registration via MODx configuration settings, and a customizable logging system (modRegistry) that will include the ability to produce and consume stateful messages into specific containers across requests (will be very useful for AJAX applications), or just write log messages to a simple text file.

        To be honest, a lot of times, the best attributes of the current MODx code are the high-level concepts and flexible approaches it models, and not necessarily the implementations of them. But I think a lot of that is about to change...
        • just write log messages to a simple text file
          This I understand just fine.
          the ability to produce and consume stateful messages into specific containers across requests
          This produced one of those "Huh?" moments, like 20 years ago when I had a Dos machine with no hard drive and two 5-1/2" floppy drives, and the first program I bought told me to "insert data disk in drive B". Hopefully this will come to be as understandable in time tongue
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
          • Quote from: sottwell at Jan 30, 2007, 09:00 AM

            the ability to produce and consume stateful messages into specific containers across requests
            This produced one of those "Huh?" moments, like 20 years ago when I had a Dos machine with no hard drive and two 5-1/2" floppy drives, and the first program I bought told me to "insert data disk in drive B". Hopefully this will come to be as understandable in time tongue
            Just think of more flexible $_SESSION variables, which get persisted across requests (i.e. they are stateful). Configure error logging from the manager in container A, use container B as a stack of error messages from context B (a web application) that are presented and available to the user in that context only, or use yet another container to store progress for an AJAX installation process. These kinds of "state machines", which are isolated from each other, can be manipulated as any array can be, are stored to disk, memory, a database table, or wherever you decide, and can be used for just about anything that needs to store or access stateful data. Unlike $_SESSIONS though, they can be ignored and avoided unless specifically needed. On Demand State Machines? Does that sound any better? Nah! LOL

            Anyway, I hope that makes it sound a little more like something useful and less like your analogy above...though as with anything, there has to be a discovery process which (hopefully) leads you to understand where to actually insert the disk.
            • Heh. I knew what drive B was, I didn’t have a clue what a "data disk" was! That’s OK, though, now I can ssh in to a server and create databases and set up limited users for them from the command line. If I can do that, I’ll figure out what your xPDO does. Hopefully it won’t take me 15 years. grin
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 26439
                • 104 Posts
                Quote from: sottwell at Jan 30, 2007, 03:48 PM

                If I can do that, I’ll figure out what your xPDO does. Hopefully it won’t take me 15 years. grin

                I think you mean "iPOD", you can listen to music on it.