We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9768
    • 13 Posts
    Not sure whether this has been raised previously; a search for "sqlParser" didn’t throw up anything I recognised as this
    issue.

    Relevant environment:
    MODx 0.9.2.1
    MySQL 3.23.57

    I am a new user. Installed everything including demo pages.

    Noticed various things not working, such as the "Most Recent" page list.

    On investigation, found that various items loaded at install time that should have been multi-line had been loaded without linebreaks. For example, ListRelated snippet was all one line and started
    // --------------------// Snippet: ListRelated// --------------------// Version: 1.0 beta 1// Date: September 6

    Eventually traced this to code in install/sqlParser.class.php at line 82:
    // strip out comments and \n for mysql 3.x
    if ($this->dbVersion <4.0) {
    $sql_do = preg_replace("~COMMENT.*[^’]?’.*[^’]?’~","",$sql_do);
    $sql_do = str_replace(’\r’, "", $sql_do);
    $sql_do = str_replace(’\n’, "", $sql_do);
    }
    which has removed all the newlines from the code snippets, rendering many (all?) of them nonfunctional.

    I have no idea what version of MySQL has a problem with the \r and \n, but it isn’t the one I’m using (3.23.57).

    Commenting out the statements that remove the \r and \n has fixed the problem for me ... I think ... ;->

    If I’m posting this in the wrong forum, would some moderator please tell me where it ought to be instead?
      • 33337
      • 3,975 Posts
      Zaigham (aka zi) Reply #2, 20 years ago
      Welcome to the MODx fjpb, you’ve posted in the right forum. smiley

      I don’t have a clue myself, but someone will be going to answer it soon, though your PHP version, and browser/platform information would be more helpful.

      best regards.

      zi
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link