We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12410
    • 353 Posts
    Hi Guys,
    Using Modx Revo 227, PHP 5.4.4, mySQL 5 and Ubuntu 12.04.
    As attached how do I get rid of these errors: 100 of them. They pertain to the extra Articles 1.6.5 perhaps.
    I deleted the files in core/cache but still errors still there. Also cleared Browser cache and cookies

    Errors; Resource URI news/article2.html already exists for resource id = 3043; skipping duplicate resource URI for resource id = 10561

    Thanks
      • 30585
      • 833 Posts
      You should address the duplicate resource issue. The 'article2.html' alias is used in more than one resource and that's causing those errors. If you go to Site > Search and enter article2 in the alias field, it will return more than one resource and there is your problem.

      Try renaming your duplicates to something else and if Articles doesn't let you modify them, use PhpMyAdmin and modify those resources straight from the database. You'll need to manually clear your core/cache folder and your brower once done.

      Hope this helps.
        A MODx Fanatic
        • 41149
        • 43 Posts
        Quote from: treigh at May 10, 2013, 06:31 AM
        You should address the duplicate resource issue. The 'article2.html' alias is used in more than one resource and that's causing those errors. If you go to Site > Search and enter article2 in the alias field, it will return more than one resource and there is your problem.

        Try renaming your duplicates to something else and if Articles doesn't let you modify them, use PhpMyAdmin and modify those resources straight from the database. You'll need to manually clear your core/cache folder and your brower once done.

        Hope this helps.

        That kind of defeats the purpose of a CMS/CMF. For example, I development and implemented a website into MODx that houses different sports teams, and they all have their own parent, and therefore have consistent pages. If we were to rename our aliases to team2.html team2-roster.html team2-gallery.html, it would be a mess and less consistent.
          The web is our sandbox, so let's develop a castle.
          • 22303 MODX Staff
          • 10,725 Posts
          The URI is the what is duplicated and checked against for duplicates, not the alias (unless you are not using use_alias_path setting, then URI and alias are about the same minus the content type extension).
            • 40045
            • 534 Posts
            What are the values of your system settings "use_alias_path" and "global_duplicate_uri_check"?
              • 12410
              • 353 Posts
              Quote from: exside at Jul 14, 2013, 08:05 AM
              What are the values of your system settings "use_alias_path" and "global_duplicate_uri_check"?

              Hi exside,
              Yes and No respectively.
              Thanks
                • 40762
                • 54 Posts
                I agree this is a major problem as it affect the inner working of many plugins and packages. Maybe the core developper should consider stricker filter or the possibility to generate random uri when facing duplicate.
                  Marc-Andre Audet
                  • 3749
                  • 24,544 Posts
                  Check to make sure that the alias and URI fields are not empty. That will make them be reported as duplicates.

                  The EmptyAlias extra will check for empty aliases (which may result in empty URIs).

                  http://modx.com/extras/package/emptyalias

                  This is a variation that will check for empty URIs, but correct any empty aliases first and clear the site cache before running it:

                  $resources = $modx->getCollection('modResource', array('uri' => ''));
                  
                  $output = '';
                  if (empty($resources)) {
                      $output .= '<p>' . 'No empty uris' . '</p>';
                  }
                  
                  $output .= "\n<ul>";
                  foreach($resources as $resource) {
                      $output .= "\n<li>" . $resource->get('pagetitle') . ' (' . $resource->get('id') . ')</li>';
                  }
                  $output .= "\n</ul>";
                  $output .= "\n<p>" . 'Finished' . '</p>';
                  
                  return $output;
                    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
                    • 33987 ☆ A M B ☆
                    • 197 Posts
                    I've never had this problem. I did have those notices when we imported ~3000 news items from an old site, where duplicates URI's were made. We had to manually change those, which is kinda what I expected because we messed up wink

                    Is this a 2.2.7 issue? My 2.2.8 sites don't have this issue. Just tested it and no issue :S
                      Sterc Internet & Marketing | MODX Founding Partner | Chairman of the MODX Advisory Board

                      In need of a MODX consult? Try our MODX Developers Experts!
                      • 3749
                      • 24,544 Posts
                      Quote from: nomark at Aug 02, 2013, 02:07 AM

                      Is this a 2.2.7 issue? My 2.2.8 sites don't have this issue. Just tested it and no issue :S

                      I have this when I clear the cache in 2.2.8:

                      Resource URI problem2.html already exists for resource id = 3412; skipping duplicate resource URI for resource id = 3414
                      Resource URI problem1.html already exists for resource id = 3411; skipping duplicate resource URI for resource id = 3413
                      Resource URI templatetest2.html already exists for resource id = 3426; skipping duplicate resource URI for resource id = 306
                      


                      These resources do have duplicate aliases and duplicate uris. In addition, there is a second problem1 Resource that isn't shown here (not sure why).

                      It's relatively easy to generate problems like these when you create resources in code. The modResource->save() method should probably be a little more picky.
                        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