-
- 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.
-
- 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.
-
- 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.