We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14946
    • 3 Posts
    OK, I’ve gotta be missing something obvious here.

    I just installed modx on a local system. Created a registered user, logged-in as the user. Added a comment to a blog.

    If there is a single quote mark in the text of either the heading or body, I get the following error.

    Since there’s a single quote in the error message, and I do not get the error here, there is obviously a fix! (Or else the error does not occur in forum postings...)

    It is pretty obvious why this is happening - modx needs to escape single-quotes in the SQL query, but is not!

    P.S. Since I was able to post this without getting the error, perhaps this error is specific to blog comments.

    -----

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’t use single quotes!auser 7Oct2006 12:09PM
    SQL: INSERT INTO `modx`.modx_site_content (pagetitle,alias,parent,createdon,createdby,editedon,editedby,published,deleted,hidemenu,template,content) VALUES(’My first blog entry! - User comments’,’usrcmt-38’,’38’,’1160248168’,’0’,’0’,’0’,’1’,’0’,’1’,’0’,’
    You can’t use single quotes!auser 7Oct2006 12:09PM
    Nuff said!
    [[UserComments? &hostid=`38`]]’) ;
    [Copy SQL to ClipBoard]

      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: jtara at Oct 07, 2006, 02:12 PM

      P.S. Since I was able to post this without getting the error, perhaps this error is specific to blog comments.
      This is not a core code issue; this is an issue with the aging UserComments snippet. You might want to search the MODx site regarding this snippet (I recommend searching from google using the syntax "site:modxcms.com UserComments") or consider upgrading to the new comments snippet, Jot.
        • 14946
        • 3 Posts
        Thanks for the quick reply! I’ll upgrade to jot.

        Sorry, just test-driving MODx for the first time, so I’m REAL fuzzy on what parts go with what. The forums seem organized around code layout, rather than functionality, so kinda hard to know just where to post.

        Is there some sort of "newbie gotchas" guide? I’m having issues with captchas, as well. (PHP error message on one system, no error but no captchas on another...)
          • 13003
          • 18 Posts
          jtara, captchas got me as well. they require FreeType and GD installed, otherwise it won’t work right for ya.