We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2214
    • 33 Posts
    I accidentally moved a parent document (products) under its own child document (test). Now (products), (test) and all documents under (products) are no longer showing in the document tree. Is there any way to list all document IDs and change their parent? Or to revert this? It seems like a logical problem that should have thrown an error.

    To reiterate the original tree before I screwed up:

    (home)
    --(products)
    ----(test)

    ModX .95

    Any help would be greatly appreciated!
      • 26903
      • 1,336 Posts
      You can do this by updating your database directly, the site_content table has a ’parent’ column, in your case you would need to reset the hierarchy as it was, i.e. the parent of products should be the id of home and the parent of test should be the id of products. You can use a tool such as PHPMyAdmin to do this or the mysql CLI for instance. I’d log out of manager first, do the change then log in again.

      Note, please make sure you have database backup before you do this if you are at all unsure, the update is trivial but this should not stop you being prudent.
        Use MODx, or the cat gets it!
        • 2214
        • 33 Posts
        OK, thanks. I see the parent table. When I view it, I get:
        2 0
        18 2
        3 4
        1 6
        3 8
        2 9
        1 10
        7 11
        3 12
        8 13
        2 25
        3 33
        6 50
        6 51
        5 52
        10 57
        5 72
        1 73
        2 96
        2 98
        1 99
        12 131
        1 253
        4 258
        2 259
        2 261
        4 266

        Can you give me an example of how I would make this change?
          • 26903
          • 1,336 Posts
          Firstly you need the id’s of the docs in question, i.e. Home, products and test. Say these are 1,2 and 3(they wont be but just for example).

          From the fault description above the parent of Home should be OK so there’s nothing to do here.
          Set the ’parent’ of doc id 2(products) to be 1(Home) and the ’parent’ of 3(test) to be 2(product)
          Also check that the ’isfolder’ column of Home(1) and products(2) is set to 1 and that it is set to 0 for test.

          The numbers on your system will be different but the principle is the same.

          The list above doesn’t really tell me anything as I don’t know what the columns are(id,parent?) and how these relate to the document title.

            Use MODx, or the cat gets it!
            • 2214
            • 33 Posts
            I figured it out. Thanks for the help!