$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.';
}
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:
- Go to System > System Settings
- Search for friendly_urls setting.
- Change it to No, and wait for it to complete.
- 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?
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.
<?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();
}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.