-
Bug
-
Resolution: Fixed
-
Minor
-
1.8
-
None
-
PostgreSQL
-
MOODLE_18_STABLE
-
MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
If you make a comment on a database table that has a ' in you get errors, at least in Postgres but it may apply to other database types as well.
For example, I made the following change in my copy of lib/xmldb/generators/postgres7.class.php
from
$comment.= " IS '" . substr($xmldb_table->getComment(), 0, 250) . "'";
to
$comment.= " IS '" . addslashes(substr($xmldb_table->getComment(), 0, 250)) . "'";
This fixed it but I'm not sure it's the right approach, also it probably affects other databases most of which I can't test on, so I think somebody who has a clue how that code works should fix it, not me.
For now I have changed my comment to not include a ' symbol. I think this solution may be ok for 1.8.