We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38306
    • 12 Posts
    Hey guys i am having some problems with my first modx project.

    1) in the navigation tree (left side), there are any sites displayed exept "web". But they are on the Frontend side and i can also edit them over "www.xxx.com/manager/?a=30&id=yy". I thought that is a permissons problem so i run that test_config file (https://github.com/craftsmancoding/modx_utils/blob/master/test_config.php) "http://www.alpcronmoarhof.com/test_config.php".
    These error seems strange.
    $root_conf = file_get_contents(MODX_BASE_PATH.'config.core.php');
    $mgr_conf = file_get_contents(MODX_MANAGER_PATH.'config.core.php');
    $conn_conf = file_get_contents(MODX_CONNECTORS_PATH.'config.core.php'); 
    
    if ($root_conf != $mgr_conf || $root_conf != $conn_conf || $mgr_conf != $conn_conf) {
    	$errors[] = 'The contents of your config.core.php files do not match.';
    }
    :

    Shouldn't they be different? I mean shouldn't $root_conf point on "/var/www/h05er423/alpcronmoarhof.com/" and $mgr_conf point on "/var/www/h05er423/alpcronmoarhof.com/manager/"

    So thats my first problem.

    2) For the friendly urls i got always a lot of theese errors "Resource URI already exists for resource id = 1; skipping duplicate resource URI for resource id = 40" and in the wayfinder menu all links pointed to the root. Thats because in the site_contet (Databank) the URI fields are all empty. When i update page by page in the manager these value gets added, but how can I do that all at once?

    Thanks for your help!
      • 23491 ☆ A M B ☆
      • 1,056 Posts
      Quote from: nailik at Jan 13, 2013, 09:48 AM


      2) For the friendly urls i got always a lot of theese errors "Resource URI already exists for resource id = 1; skipping duplicate resource URI for resource id = 40" and in the wayfinder menu all links pointed to the root. Thats because in the site_contet (Databank) the URI fields are all empty. When i update page by page in the manager these value gets added, but how can I do that all at once?


      @nailik, one way to regenerate the URIs via the MODx Manager is by following these steps:


      1. Go to System > System Settings
      2. Search for friendly_urls setting.
      3. Change it to No, and wait for it to complete.
      4. Change it back to Yes.

      NOTE: I pulled this from a previous post here: https://forums.modx.com/thread/80495/edited-alias-but-front-end-still-using-old-alias#dis-post-443536

      Ideally there would be a way built-in to the manager without having to change FURL settings, or at a minimum part of the clear cache function. This is the only automated way I know to regenerate a site's URIs.

      Does that help?
        Mike Reid - www.pixelchutes.com
        MODx Ambassador / Contributor
        [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
        ________________________________
        Where every pixel matters.
        • 38306
        • 12 Posts
        Thanks @pixelchutes

        Quote from: pixelchutes at Jan 13, 2013, 11:09 AM

        @nailik, one way to regenerate the URIs via the MODx Manager is by following these steps:


        1. Go to System > System Settings
        2. Search for friendly_urls setting.
        3. Change it to No, and wait for it to complete.
        4. Change it back to Yes.

        NOTE: I pulled this from a previous post here: https://forums.modx.com/thread/80495/edited-alias-but-front-end-still-using-old-alias#dis-post-443536

        Ideally there would be a way built-in to the manager without having to change FURL settings, or at a minimum part of the clear cache function. This is the only automated way I know to regenerate a site's URIs.

        Does that help?

        Well, no that doesn't work. Cause as i see it, it always skips it like the error says "Resource URI already exists for resource id = 1; skipping duplicate resource URI for resource id = 40".
        All in all it wouldn't be a problem to do manually (opening resource -> deleting a letter in the title -> add letter again ->save), there are »only« about 100 pages.

        The bigger problem is the missing resource tree. Btw only resources aren't displayed. Templates, snippets, chunks... work fine.
          • 23491 ☆ A M B ☆
          • 1,056 Posts
          Quote from: nailik at Jan 13, 2013, 12:07 PM
          Thanks @pixelchutes
          Well, no that doesn't work. Cause as i see it, it always skips it like the error says "Resource URI already exists for resource id = 1; skipping duplicate resource URI for resource id = 40".
          All in all it wouldn't be a problem to do manually (opening resource -> deleting a letter in the title -> add letter again ->save), there are »only« about 100 pages.

          The bigger problem is the missing resource tree. Btw only resources aren't displayed. Templates, snippets, chunks... work fine.

          Hmmm, I would have thought that would have at least populated the empty `uri` fields.

          What do the `uri` field values look like in the database after completing the suggested steps? (Are they still empty, can you see hierarchy, duplicate values, etc?)

          As for the missing resource tree, do you see anything meaningful in the MODx Error log?

          NOTE: Your config.core.php files should all be the same (e.g. point to the same location: Your MODX_CORE_PATH) In other words, there are three config.core.php files pointing to one location, not three config.core.php file pointing to different locations.

          The script you ran simply helps you to determine if the locations referenced in each file are not in sync with one another.
            Mike Reid - www.pixelchutes.com
            MODx Ambassador / Contributor
            [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
            ________________________________
            Where every pixel matters.
            • 38306
            • 12 Posts
            Quote from: pixelchutes at Jan 13, 2013, 12:53 PM

            Hmmm, I would have thought that would have at least populated the empty `uri` fields.

            What do the `uri` field values look like in the database after completing the suggested steps? (Are they still empty, can you see hierarchy, duplicate values, etc?)

            As for the missing resource tree, do you see anything meaningful in the MODx Error log?

            NOTE: Your config.core.php files should all be the same (e.g. point to the same location: Your MODX_CORE_PATH) In other words, there are three config.core.php files pointing to one location, not three config.core.php file pointing to different locations.

            The script you ran simply helps you to determine if the locations referenced in each file are not in sync with one another.

            Thanks for your fast help,

            The fields stay always empty. The alias fields are filled correctly (so i could maybe use an sql command to duplicate that?). There is "automatic_alias" in the furl settings (which i have on "yes"), but the alias field stays empty?

            About the tree:
            okay, so i may got that wrong. i just controlled one file (the one in the root). I gotta find the others and I'll take a look there.

            Update
            I did now checked all »config.core.php's« (and cleared and flushed everything). When i check it again on here http://www.alpcronmoarhof.com/test_config.php i get any errors. but still the tree isn't showing and the furls aren't working. [ed. note: nailik last edited this post 13 years, 8 months ago.]
              • 23491 ☆ A M B ☆
              • 1,056 Posts
              I would double check your alias fields are populated, and then probably more importantly, check the "parent" relationship of the migrated resources. If the tree is not showing up, its most likely a symptom of orphaned resources. (e.g. MODX documents pointing to a parent ID that does not exist as a valid container, etc)

              If the site is not too terribly large, or the hierarchy not too complex, you could also consider updating all `parent` values in modx_site_content to zero (0) and see if they show up in the tree after clearing the site cache. If they do, you can then drag & drop to put them back into place.

              However, if the site is very large / complex, I would simply recommend reviewing the parent values are referencing valid resources, and if not, update them to the correct values and try clearing the cache and refreshing the tree.

              Once you do get the resources showing up in the tree with the correct hierarchy, then try running the steps from my original post to correctly populate the `uri` fields.
                Mike Reid - www.pixelchutes.com
                MODx Ambassador / Contributor
                [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                ________________________________
                Where every pixel matters.
                • 38306
                • 12 Posts
                I can't set every parent back to 0 atm but they look alright, i see no problem there. I mean every nummber in "parent" exists as an "id".

                Just from my last post which i updated to late:
                The URI fields stay always empty. The ALIAS fields are filled correctly (so i could maybe use an sql command to duplicate that?). There is "automatic_alias" in the furl settings (which i have on "yes"), but the (non manually filled) ALIAS fields stay empty. Isn't it supposed to fill that?

                Maybe it has to do with my php version 5.2!? I will call there tomorrow and ask if they can do an update.

                I have also added the error log, maybe someone finds something there...

                Thanks again.
                  • 3749
                  • 24,544 Posts
                  Try putting this script in a snippet. Put a tag for it on a page and view the page:

                  <?php
                  $docs = $modx->getCollection('modResource');
                  foreach($docs as $doc) {
                      $aliasPath = $doc->getAliasPath();  // You may not actually need these two lines
                      $doc->set('uri', $aliasPath);       // just saving the doc might do it
                      $doc->save();   
                  }


                  It should update all the resources, though you may still have trouble if you have duplicate aliases.

                  Your config looks fine, as far as I can tell. If you can edit and save resources using the direct URL and can see and edit elements in the Manager, your paths and permissions must all be good. It sounds like your only problem is the empty uri field, which hopefully the code above will fix.
                    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
                    • 38306
                    • 12 Posts
                    Quote from: BobRay at Jan 13, 2013, 11:32 PM
                    Try putting this script in a snippet. Put a tag for it on a page and view the page:

                    <!--?php
                    $docs = $modx--->getCollection('modResource');
                    foreach($docs as $doc) {
                        $aliasPath = $doc->getAliasPath();  // You may not actually need these two lines
                        $doc->set('uri', $aliasPath);       // just saving the doc might do it
                        $doc->save();   
                    }


                    It should update all the resources, though you may still have trouble if you have duplicate aliases.

                    Your config looks fine, as far as I can tell. If you can edit and save resources using the direct URL and can see and edit elements in the Manager, your paths and permissions must all be good. It sounds like your only problem is the empty uri field, which hopefully the code above will fix.

                    Great thanks, that fixed my furl problem. It is now running perfect!

                    But my tree is still empty...
                      • 3749
                      • 24,544 Posts
                      The next things to try are:

                      Turn off the compress_js and compress_css System Settings
                      Log out
                      Repair the DB tables in PhpMyAdmin
                      Manually delete all files in the core/cache directory
                      Clear your browser cache and cookies (leftover cookies can cause all kinds of weirdness)
                      Log back in


                      If that doesn't work, the odds are that one or more resources lack integrity (e.g., a resource is its own parent or has a nonexistent parent).
                        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