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
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
Quote from: treigh at May 10, 2013, 06:31 AMYou 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.
-
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).
What are the values of your system settings "use_alias_path" and "global_duplicate_uri_check"?
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
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;
-
☆ 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
Is this a 2.2.7 issue? My 2.2.8 sites don't have this issue. Just tested it and no issue :S
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.