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

    I have a competition =). If you fix this bug, that prevents (!) at least central-european language sites to be even set up with modx:

    http://modxcms.com/bugs/task/244
    http://modxcms.com/forums/index.php/topic,2663.0.html

    I will give two Google Adwords vouchers for $55 each. (Some restrictions apply - account must be no longer than 14 days old, but you can create a new one). As a bonus I will tell you how to set up these two account with additional $50 credit. (Vouchers must be redeemed by 2006-06-30)

    OK, I’ll give you them if you promise to have a serious look at this as this bug is really sucking fucking desperation, I can’t run a modx site in my language.


      • 31337
      • 258 Posts
      Did you try the META and Header fixes that were suggested in http://modxcms.com/forums/index.php/topic,2663.0.html?
        • 29988
        • 89 Posts
        Hi again,

        I’ve made some investigations. Results? There are MANY mistakes, but partially I solved it.

        * After installation, export the whole DB and DELETE it (in PhpMyAdmin). Now open the .sql file in some editor and Search/And replace all occurances of bad charset/collocations to good. For example, I’ve changed all cp1250 to latin2. You may want to change it to utf8 - I haven’t tred utf8 yet (I don’t like it). Save the file in some encoding you prefer. Now in phpmyadmin, I think you need to adjust the charset for imported files (that saved encoding) and/or the charset of interface. Do your best in making the configuration sense.

        You should have all tables and columns in that encoding (if they are varchar or text). In some cases, you would have problems with indexes.

        * Now go to manager/index.php and find

        // connect to the database
        if(@!$modxDBConn = mysql_connect($database_server, $database_user, $database_password)) {
        die("<h2>Failed to create the database connection!</h2>. Please run the MODx <a href=’../install’>install utility</a>");
        } else {
        mysql_select_db($dbase);
        }

        Now, I’m not sure, but this may be a bug. The thing is, that AFAIK $dbase could not exist! In some cases, I needed to write the name of my DB here. Experiment. THIS NEEDS TO BE FIGURED OUT.

        After the select_db call, put

        $cp="latin2";
        MYSQL_QUERY(’SET NAMES ’.$cp.’’);
        MYSQL_QUERY(’SET CHARACTER SET ’.$cp.’’);
        MYSQL_QUERY("SET SESSION collation_connection = ’$cp_czech_ci’");
        mysql_query("SET character_set_results=$cp, character_set_connection=$cp, character_set_client=$cp");

        Adjust the $cp properly.

        * Now insert this also into dbapi.mysql.class.inc.php

        * IMPORTANT : set caching OFF for the testing page - serious mental injuries can happen if you do it with caching on....!!!!!!!!!!!!!!!

        * Check source code of your result - the meta charset should match any other declaration across the board (maybe exept for phpmyadmin meta charset)
          • 29988
          • 89 Posts
          It still converts local characters to html entities. So I have html entities in database :-|. Sorry to say that, but as the core code for rendering probably works well, the manager is just one mess. Just bugs bugs bugs bugs bugs. It’s like contradiction to every guideline a programmer should follow.

          Wherever I look in the manager, I see lousy code.

          I was just wondering, why calling makeHTML($indent,$parent,$expandAll); returns a error. So I looked up that function:

          function makeHTML($indent,$parent,$expandAll,$theme)
          {
          global $icons, $theme;

          Yes, someone added the 4th parameter and "forgotted" to change the callings. AND IN THE FUNCTION IS GLOBALIZED THE SAME VARIABLE - OH MY GOD, THIS SI SO SO TYPICAL LOUSY STYLE OF DEVELOPMENT, THAT I SEE IN EVERY MANAGER’S PHP FILE.

          I’M SORRY, BUT I’M VERY NEAR TO GIVING UP.
            • 25663 MODX Staff
            • 12,272 Posts
            The manager is indeed a mess which is why it is being completely rewritten. smiley
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Yes, and anybody can fix things and post the fixes; I’ve had a few of my small efforts actually incorporated into the core! That’s what I really love about MODx, while the code of the originating manager (which the current MODx project inherited) left a great deal to be desired, it is fairly easy to pick through, and the MODx core team is not at all unwelcoming to patches and fixes.

              But we are all eagerly looking forward to the completely reworked manager... no more frames! I tried to do something about that almost a year ago, but I’m just not (yet!) good enough for that kind of heavy lifting. So I just pick at the edges, and the little things that I can handle, and leave the major stuff to the big boys.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 4673
                • 577 Posts
                hmm, just a guess.

                Have you tried to export the sql installation files into your target language?

                I had this type of problem years ago with Japanese. I’d use mozilla (ugh, netscape) to do the character encoding and then copy/paste into my favorite editor. Then up the "newly encoded sql" file to the server for installation time.

                hmmmm
                  Tangent-Warrior smiley
                  • 29988
                  • 89 Posts
                  Hey hey - huge progress made, dear friends =)

                  The html entities encoding is in the FCKEditor. If I swithc it off, it dissappears, AFAIK. Also it’s not happening while editing TV’s.