Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-7696

When bulk messaging, if the message contains a ' character, sending fails.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.7.1, 1.8
    • Component/s: Messages
    • Labels:
      None
    • Environment:
      win 2k3, but probably all MySQL environments
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE

      Description

      This only occurs with the ' character messing up the MySQL syntax as shown in the following error message. An easy workaround is simply not to use this character, but it's easy to forget

      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 'm testing the messaging system, please reply if you get this.', 1, 1164621775, '' at line 1

      INSERT INTO mdl_message ( USERIDFROM, USERIDTO, MESSAGE, FORMAT, TIMECREATED, MESSAGETYPE ) VALUES ( 2, 118, 'I'm testing the messaging system, please reply if you get this.', 1, 1164621775, 'direct' )

      Something went wrong while messaging selected users. Some may have received the email.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              lazyfish Yu Zhang added a comment -

              Hi, should be fixed now, thanks for the report!

              Show
              lazyfish Yu Zhang added a comment - Hi, should be fixed now, thanks for the report!
              Hide
              aborrow Anthony Borrow added a comment -

              Yu - Just for consistency, any chance of getting the addslashes patch applied to Moodle 1.6 Stable? Thanks - Anthony

              Show
              aborrow Anthony Borrow added a comment - Yu - Just for consistency, any chance of getting the addslashes patch applied to Moodle 1.6 Stable? Thanks - Anthony
              Hide
              lazyfish Yu Zhang added a comment -

              Hi Anthony, added in 1.6 as well. Cheers, Yu

              Show
              lazyfish Yu Zhang added a comment - Hi Anthony, added in 1.6 as well. Cheers, Yu
              Hide
              ghassan.geara Ghassan Geara added a comment -

              Not only the ' character initiates this error. It's unpredictable.
              Many times, teachers calls, they send me the message, which sometimes is very short and doesn't contain any special chars. What they get is the message "Sorry, message could not be delivered to all recipients"
              Cheers, Gass

              Show
              ghassan.geara Ghassan Geara added a comment - Not only the ' character initiates this error. It's unpredictable. Many times, teachers calls, they send me the message, which sometimes is very short and doesn't contain any special chars. What they get is the message "Sorry, message could not be delivered to all recipients" Cheers, Gass

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    17/Jan/07