We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15566
    • 73 Posts
    I have had reports from users that they are getting the occasional error. I have looked in the System Events and I have found this:

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « Execution of a query to the database failed - Unknown column ’birmingham’ in ’where clause’ »
    SQL: SELECT parent FROM `xxxxxx`.`xxxxxx_site_content` WHERE id=birmingham


    The ’birmingham’ that it mentions here is an alias of a document within a directory. There are other errors mentioning the other aliases of the same directory. Any ideas?

    The only place, in any of the files, that I can find a similar sql line is in move_document_processor.php. In there (on line 24) I have just tried changing

    $sql = "SELECT parent FROM $dbase.`".$table_prefix."site_content` WHERE id=".$_REQUEST[’id’].";";

    to

    $sql = "SELECT parent FROM $dbase.`".$table_prefix."site_content` WHERE id=’".$_REQUEST[’id’]."’;";

    But I am sure this isn’t where my problem is coming from - but it’s worth a try(!?)
    • Something is passing the alias instead of the document ID to whatever is generating that query. The move function is fine the way it is; it always gets the document ID. By "users" do you mean manager users? If so, I would suspect a plugin or module code. If you mean front-end user, check snippets. If it were a core issue it would be happening to everyone.
        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
        • 15566
        • 73 Posts
        It is happening on the front-end, I have checked my snippets and I haven’t done any calls asking for the parent I have even searched all the files and the whole of the database just to be sure.

        It would be helpful if the error could give me something else to go on.
          • 5340
          • 1,624 Posts
          Switch off your snippets one by one in the template and tell which one is causing the problem

          Maybe you upgraded something.
          • Version of MODx, please. TVs? Plugins? Something is probably using the $modx->db->select() function, passing it the alias instead of the ID in the where parameter. Whatever it is it needs to be pinned down and fixed.
              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
              • 15566
              • 73 Posts
              The version installed is Evolution 1.0

              There are some basic TVs created - nothing too clever that should cause a problem. Just the usual inputs from a manager.

              Plugins installed:
              Forgot Manager Login
              Image TV Preview
              Inherit Parent Template
              Search Highlighting
              TinyMCE

              Installed Snippets (plus several bespoke ones)
              WebLoginPE
              WebLogin
              MaxiGallery

              It’s hard to tell you everything really as there is quick a few little custom bits. One of the pages is here:

              http://www.varsitybars.com/bars/birmingham.html

              The problem is I haven’t seen the problem, other people have, but not all the time. If I knew one particular action would cause it I could go through a process of elimination until it is found.

              When I upgraded I left all snippets/plugins/chunks as they were.