We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32052
    • 38 Posts
    Hi BobRay,

    After I altered the database I got this error: Maybe had experienced the same error?

    #1064 - 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 ’ALTER TABLE modx_manager_users DROP INDEX username; ALTER TABLE modx_membergrou’ at line 2

    Is this ok?

    After that I installed winmerge to compare the two database. What should I look on the two?
    The before looks like this:

    PRIMARY KEY (`id`),
    KEY `id` (`id`),
    KEY `parent` (`parent`),
    KEY `aliasidx` (`alias`),
    FULLTEXT KEY `content_ft_idx` (`pagetitle`,`description`,`content`),
    FULLTEXT KEY `content` (`content`),
    FULLTEXT KEY `content_2` (`content`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT=’Contains the site document tree.’ AUTO_INCREMENT=57 ;

    After.sql looks like this:

    PRIMARY KEY (`id`),
    KEY `id` (`id`),
    KEY `parent` (`parent`),
    KEY `aliasidx` (`alias`),
    FULLTEXT KEY `content_ft_idx` (`pagetitle`,`description`,`content`),
    FULLTEXT KEY `content` (`content`),
    FULLTEXT KEY `content_2` (`content`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT=’Contains the site document tree.’ AUTO_INCREMENT=57 ;

    I see the default charsets are still=latin1. Does this mean that the convertion did not occured because of the error? Thanks!
      • 3749
      • 24,544 Posts
      I haven’t seen that error. What version of MODx? I haven’t tried the script with Revo because all my Revo installs already in UTF-8.

      It looks like your conversion was unsuccessful (or worse yet, partially successful -- that happens).

      If I have time (fat chance), I’ll create a Latin1 Revo file and try to see what’s happening.

      Sorry it didn’t work for you.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 32052
        • 38 Posts
        Hi BobRay,

        The error was not in MODx, It was during the alter period of the db on the local machine.
        Anyway I’m using MODx EVO 1.0.4 rev 6981.

        Was it because of the phpMyAdmin version? I’m using a latest version of XAMPP and the remote
        phpMyAdmin was 2.11.10.

        Cheers!
          • 3749
          • 24,544 Posts
          It could be the PHP version, or it could be that my code won’t work with the MODx 1.0.4 DB.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 17270
            • 13 Posts
            Hey folks,

            similar issue here. My database seems to be able to store international characters (I can see them in phpMyAdmin), but web sign-up e-mail is sent via sendmail with international characters not displayed. I’ve just re-created the entire database to make sure it’s using UTF8:

            Database Charset utf8
            Database Collation Charset utf8_unicode_ci

            Sendmail sends the e-mail with the following settings:
            X-Mailer: Content Manager - PHP/5.2.9
            Mime-version: 1.0
            Content-Type: text/plain; charset=UTF-8
            Content-Transfer-Encoding: BASE64

            The e-mail client recognizes it’s a UTF8 encoding (I’m using Thunderbird). But the international characters are not there. What may be causing the problem?

            Many thanks!
              • 3749
              • 24,544 Posts
              Quote from: livewire at Sep 11, 2010, 08:38 AM

              Hey folks,

              similar issue here. My database seems to be able to store international characters (I can see them in phpMyAdmin), but web sign-up e-mail is sent via sendmail with international characters not displayed. I’ve just re-created the entire database to make sure it’s using UTF8:

              Database Charset utf8
              Database Collation Charset utf8_unicode_ci

              Sendmail sends the e-mail with the following settings:
              X-Mailer: Content Manager - PHP/5.2.9
              Mime-version: 1.0
              Content-Type: text/plain; charset=UTF-8
              Content-Transfer-Encoding: BASE64

              The e-mail client recognizes it’s a UTF8 encoding (I’m using Thunderbird). But the international characters are not there. What may be causing the problem?

              Many thanks!


              Sendmail (especially older versions) doesn’t always play nice with UTF-8. Google "sendmail unicode" to see some solutions.

              Someone else may have a more modx-specific solution.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 17270
                • 13 Posts
                FWIW, I’ve managed to make sure e-mail body text displays international characters correctly. I’ve done this by changing the default setting of PHPMailer class (in manager/includes/controls/class.mailer.php) to use quoted-printable encoding instead of 8-bit.

                Original code:
                 /**
                   * Sets the Encoding of the message. Options for this are "8bit",
                   * "7bit", "binary", "base64", and "quoted-printable".
                   * @var string
                   */
                  public $Encoding          = '8bit';


                Current code:
                 /**
                   * Sets the Encoding of the message. Options for this are "8bit",
                   * "7bit", "binary", "base64", and "quoted-printable".
                   * @var string
                   */
                  public $Encoding          = 'quoted-printable';


                Unfortunately, subject line is still showing
                =?UTF-8?Q?<my_subject_line>?=

                If anyone knows how to fix it, please post here. In the meantime, I’ll try creating subject lines that don’t contain international characters.
                  • 17270
                  • 13 Posts
                  It looks like international characters are displayed correctly in e-mail sent when Manager User is created, but not when Web User is created. I looked into save_user_processor.php and save_web_user_processor.php files (in /manager/processors/) and found that the two sendMailMessage() functions are different: Manager User processor is using PHPMailer class (and sends international characters correctly) and Web User processor doesn’t. I tried copying over the function from save_user_processor.php to save_web_user_processor.php but couldn’t make the Web User processor send any e-mail at all - not sure what the problem is, could anyone assist please?

                  Currently, my sendMailMessage() function in save_user_processor.php:
                  function sendMailMessage($email, $uid, $pwd, $ufn) {
                  	global $signupemail_message;
                  	global $emailsubject, $emailsender;
                  	global $site_name, $site_start, $site_url;
                  	global $modx;
                  	$manager_url = $site_url . "manager/";
                  	$message = sprintf($signupemail_message, $uid, $pwd); // use old method
                  	// replace placeholders
                  	$message = str_replace("[+uid+]", $uid, $message);
                  	$message = str_replace("[+pwd+]", $pwd, $message);
                  	$message = str_replace("[+ufn+]", $ufn, $message);
                  	$message = str_replace("[+sname+]", $site_name, $message);
                  	$message = str_replace("[+saddr+]", $emailsender, $message);
                  	$message = str_replace("[+semail+]", $emailsender, $message);
                  	$message = str_replace("[+surl+]", $manager_url, $message);
                  	
                  	# include PHP Mailer
                  	include_once "../includes/controls/class.phpmailer.php";
                  
                  	# send form
                  	$mail = new PHPMailer();
                  	$mail->IsMail();
                  	$mail->CharSet = $modx->config['modx_charset'];
                  	$mail->AddAddress($email);
                  	$mail->From		= $emailsender;
                  	$mail->FromName	= $site_name;
                  	$mail->Subject	= $emailsubject;
                  	$mail->Body		= $message;
                  	if(!$mail->send()) {
                  		webAlert('An Error occurred: ' . $mail->ErrorInfo);
                  		exit;
                  	}
                  }
                  



                  My sendMailMessage() function in save_web_user_processor.php:
                  function sendMailMessage($email, $uid, $pwd, $ufn) {
                  	global $websignupemail_message;
                  	global $emailsubject, $emailsender;
                  	global $site_name, $site_start, $site_url;
                  	$message = sprintf($websignupemail_message, $uid, $pwd); // use old method
                  	// replace placeholders
                  	$message = str_replace("[+uid+]", $uid, $message);
                  	$message = str_replace("[+pwd+]", $pwd, $message);
                  	$message = str_replace("[+ufn+]", $ufn, $message);
                  	$message = str_replace("[+sname+]", $site_name, $message);
                  	$message = str_replace("[+saddr+]", $emailsender, $message);
                  	$message = str_replace("[+semail+]", $emailsender, $message);
                  	$message = str_replace("[+surl+]", $site_url, $message);
                  	
                  	# include PHP Mailer
                  	include_once "../includes/controls/class.phpmailer.php";
                  
                  	# send form
                  	$mail = new PHPMailer();
                  	$mail->IsMail();
                  	$mail->CharSet = $modx->config['modx_charset'];
                  	$mail->AddAddress($email);
                  	$mail->From		= $emailsender;
                  	$mail->FromName	= $site_name;
                  	$mail->Subject	= $emailsubject;
                  	$mail->Body		= $message;
                  	if(!$mail->send()) {
                  		webAlert('An Error occurred: ' . $mail->ErrorInfo);
                  		exit;
                  	}
                  }
                  


                  Thanks a lot!