We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48589
    • 33 Posts
    Hello MODX Community,

    I'm currently working offline (XAMPP, Windows) on developing a web shop. I made a setup for it last year, but now I'm cleaning it up and making it work better. However, part of that includes some basic MODX features as making a new document, snippet, chunk, etc. The problem is: every time I save something new, it gets stored in the database with ID = 0. This goes for the everything, including TV's.

    What I have to do now, is go into the database and manually change those variables EVERY TIME I create something. Clearly, there's something not working properly here, because A) it never used to have that issue and B) it shouldn't be having it.

    I'm working with MODX Revolution 2.3.6-pl. I've setup 2.4 before, but that seems to have more issues, that I can't get it to work properly, which is why I've changed it back to 2.3.6.

    Does anyone have any idea what I could do?

    This question has been answered by zaigham. See the first response.

      • 3749
      • 24,544 Posts
      The first thing to try is to delete all files in the core/cache directory and visit the site in private or incognito mode in your browser.

      Second, check the paths in the three config.core.php files (MODX root, manager, and connectors directories) and the paths and URLs in the core/config/config.inc.php file.

      If that doesn't work, it's possible that there are still 2.4.0 files there. If you just copied the the 2.3.6 files, there are 2.4.0 files (especially in the core/model/modx/processors directory) that don't exist in 2.3.6. They would still be there and they would still be used by 2.3.6 even though they're for the wrong version.

      To revert to an earlier version, you should delete all files in the core, manager, setup, and connectors directories EXCEPT:

      The config.core.php files (root, manager, setup/includes, and connectors directories

      AND:

      The core/config/config.inc.php file.

      Those should all stay.

      Then copy in the new files (making sure to use the 1.3.6 setup directory files) and run Setup. Important: do not proceed if Setup won't let you check the "Upgrade" box.

      There may also changes to the DB in 2.4.0, so this might not work, though I don't think the changes would cause trouble in 2.3.6.


        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
        • 48589
        • 33 Posts
        Thanks for the reply. I have tried all you described above, but unfortunately that does not solve the problem. New documents are still made with ID 0
          • 3749
          • 24,544 Posts
          That suggests a corrupted or missing file in your MODX install. It's fairly common if you transfer the files individually with FTP.

          In your position, I would install UpgradeMODX in Package Manager and use it to install version 2.4.0-pl.

          I've been using 2.4.0 for some time under XAMPP with no problems. [ed. note: BobRay last edited this post 8 years, 6 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
            • 48589
            • 33 Posts
            Thanks for the suggestion. I have tried it, but unfortunately this doesn't change a thing.
            The same issue keeps occurring.

            Also, I want to point out once again that this all in an offline localhost environment. So the idea of things gone missing via FTP upload seems unlikely, since the .ZIP file was directly unzipped into my directory. But could it have anything to do with me using the advanced install?
            I suppose not, unless that UpgradeMODX also uses that. In that case, it could be that the file is simply missing in that .ZIP file.
              • 3749
              • 24,544 Posts
              I agree, but I don't know what to suggest next.
                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
                • 48589
                • 33 Posts
                I understand. And I do appreciate the help.

                I guess someone would have to check the advanced release ZIP files to see if anything's missing or not. Now, I could do that myself, but I'd be looking for a needle in a haystack. I'm sure there's someone out there who's more familiar with what's being done where and therefore should be able to locate the issue faster. But it does seem like it's something that should be looked into for the next release.
                • discuss.answer
                  • 33337
                  • 3,975 Posts
                  Could you check in phpMyadmin if ID fields are AUTOINCREMENT?
                    Zaigham R - MODX Professional | Skype | Email | Twitter

                    Digging the interwebs for #MODX gems and bringing it to you. modx.link
                    • 48589
                    • 33 Posts
                    I actually feel ashamed for not having checked that one myself.
                    That actually was the problem.
                    It confuses me, though, where that got changed in the process.

                    Thanks for pointing it out, though!
                    I've now set all IDs as the primary keys and set them to AI.
                      • 33337
                      • 3,975 Posts
                      Glad to be of some help. Might be related to XAMPP, some odd config at the time of installation.
                      You could try with a fresh test install on same XAMPP, and see if it gives the same issue.
                        Zaigham R - MODX Professional | Skype | Email | Twitter

                        Digging the interwebs for #MODX gems and bringing it to you. modx.link