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?