Search code examples
c#asp.netfriendly-urlumbracoumbraco-blog

Umbraco friendly URL not working after manully change the database


As been requested, I wrote some code which basically change the document's date (the document of umbraco blog).

I have changed every place I can find the date, and makes all the date displays fine, and I have adjusted the path to make it correct.

Now, the url indicated in the umbraco.library.NiceUrl(id) is not working, but previous url is still working.... Just wondering is there any file which 'temporarily' or 'permanently' store the friendly url mapping? if so, how can i modify that?!

Btw, where is the umbraco cache file stored?

btw, umbraco version 4.0.3, restart the website still not working, change the document title will result in old url's title changed, but new url is still not working...


Solution

  • The progress report and possible solution.

    in /config/umbracoSettings.config

    Disable the cache will do the job, basically:

    False

    This is a bit overkill, however it temporarily solves my issue... (above need restart of the website as well, it seems only disable the persist to disk, the url itself is still cached in a Hashtable, refer to: umbraco.presentation.requestHandler.cs)

    ok, cannot find from document, debugging umbraco gives me following working code:

    umbraco.library.UpdateDocumentCache(docId);
        var elem = umbraco.content.Instance.XmlContent.GetElementById(docId.ToString()); 
       umbraco.content.Instance.XmlContent.GetElementById(origParentId.ToString()).RemoveChild(elem);    
    
    umbraco.content.Instance.XmlContent.GetElementById(parentId.ToString()).AppendChild(elem);