We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36782
    • 109 Posts
    oops, jeez - sorry, totally mis-read that! been working way too long today smiley

    So input type is MigX; it's using image-type inputs to build it's collection.
    Output type is default, which is a json string, which I'm parsing into an array, and grabbing the first image from the first index.

    -g
      • 3749
      • 24,544 Posts
      Ah. I don't know enough about MigX to help. It could just be a bug in MigX or maybe it doesn't like your TV value.


      ------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using.
      MODX info for everyone: http://bobsguides.com/modx.html
        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
        • 36782
        • 109 Posts
        ...ok, what the heck are these??
        


        Migx might not like my stuff, but these things are in all my static elements (elements which I have checked 'is static' and used files for.)

        I didn't think to scan the database itself, thank you Bob! I will see if I can get rid of them. So far they have re-appeared twice, despite having switched to non-static. But I'll find a way!
          • 3749
          • 24,544 Posts
          Those suggest a mismatched character encoding. While you're in the DB, check the collation of the relevant tables *and* fields (on the Structure tab). If MODX is using UTF-8 and you see something else in the DB, it could explain some of your problems.

          If so, see this before you try to fix it: http://bobsguides.com/convert-db-utf8.html

          You might as well repair the tables too while you're there.


          ------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using.
          MODX info for everyone: http://bobsguides.com/modx.html
            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
            • 36782
            • 109 Posts
            Thanks so much smiley
            Once again you've saved my bacon. I will read that page, and check my database.
            i feel a little foolish for all the fuss, when it really was so simple and obvious. I always just let Modx pick, and never paid attention to whether everything matched.

            OK, do I put the [SOLVED] on the thread, or does a moderator do that?

              • 3749
              • 24,544 Posts
              You can put [SOLVED] in there yourself, but don't do that (or thank me) until you're sure it works. wink


              ------------------------------------------------------------------------------------------
              PLEASE, PLEASE specify the version of MODX you are using.
              MODX info for everyone: http://bobsguides.com/modx.html
                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
                • 36782
                • 109 Posts
                Hi,
                yeah, the database is in latin-swedish, and modx is using utf-8. sad

                Trying to fix it w/ your script but I keep getting a string of errors starting w/ this one:
                Error
                SQL query:
                
                ALTER TABLE xo2fh_site_content ADD INDEX  `uri` (  `uri` ) ;
                
                
                MySQL said: 
                
                #1170 - BLOB/TEXT column 'uri' used in key specification without a key length . 
                


                I fix it, and then get a bunch of others.

                That's ok, though. honestly, this project will only take me maybe 2 hours to rebuild, so I will jsut do it from scratch. It's not that bad.

                So it is solved, in that the charset was the issue.

                Thanks again for your help

                -g
                  • 3749
                  • 24,544 Posts
                  The uri field didn't exist when I wrote the code (so long ago that I can't find the original project code). I had that problem with some other fields, but can't remember how I solved it.

                  If that's just happening with the uri field, you could just remove the uri index in PhpMyAdmin (after writing down all the values) then add it back after you're done. Be sure to just remove the index, not the field itself.

                  I think you could also do a search-and-replace operation on the SQL code before running it and replace:

                  ALTER TABLE modx_site_content ADD INDEX `uri`(`uri`);<br />


                  with

                  ALTER TABLE modx_site_content ADD INDEX `uri`(`uri(333)`);<br />


                  but I haven't tried it.



                  ------------------------------------------------------------------------------------------
                  PLEASE, PLEASE specify the version of MODX you are using.
                  MODX info for everyone: http://bobsguides.com/modx.html [ed. note: BobRay last edited this post 14 years, 3 months ago.]
                    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
                    • 36782
                    • 109 Posts
                    yeah, I ended up switching it to varchar(255) just to get past the error, but it hung on a bunch more errors after that, and I figured it was better to start fresh.

                    Of course now I'm having more Migx trouble, so this is pretty much turning into a nightmare smiley oh well. 3rd time is a charm perhaps.

                    -g
                      • 3749
                      • 24,544 Posts
                      I spent all day and most of the night working on a new version. I think I have it, but haven't fully tested it.

                      Just getting the index size was pretty nasty. It's in a field called 'Sub_part'. I never would have found it if uri didn't have such an odd size (333).

                      Then, the syntax for adding the index back -- not my first guess wink

                      ALTER TABLE modx_site_content ADD INDEX `uri`(`uri`(333));


                      It worked with no complaints from PhpMyAdmin, but I also didn't get a success message after the query. Everything looks right, but I'll do a dump of the two DBs tomorrow and see if they're the same.


                      ------------------------------------------------------------------------------------------
                      PLEASE, PLEASE specify the version of MODX you are using.
                      MODX info for everyone: http://bobsguides.com/modx.html
                        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