hope someone has an idea on this one. I have a process where when a certain document type is published AND it sits in an "unreviewed" queue the node is published and moved to another "folder" (parent node). However, the link to the document still has the unreviewed parent node in it rendering the page as not found on the "front-end". This all happens in the Document_AfterPublish event. I may be answering my own question here, but should I be doing this in Document_BeforePublish?
Did this get resolved at all? I am doing something similar. On a publish I am moving a node, everything works well except the Link to document and Alternative link. if I republish the site then this works, however if I run this umbraco.library.RefreshContent(); then it does not appear to work.
I am doing all this work in the AfterPublish event
I'm calling RefreshContent() in the AfterSave event and its working for me - maybe try it in there? (it still gets called when a node gets published, I think it happens before the publish events)
Moving a document not updating "Link to document"
Hi forum,
hope someone has an idea on this one. I have a process where when a certain document type is published AND it sits in an "unreviewed" queue the node is published and moved to another "folder" (parent node). However, the link to the document still has the unreviewed parent node in it rendering the page as not found on the "front-end". This all happens in the Document_AfterPublish event. I may be answering my own question here, but should I be doing this in Document_BeforePublish?
Wanted some input before I push to prod.
Thanks all!
-- Nik
Nik,
You should try the AfterDocumentUpdateCache event instead of AfterPublish (Lee has pointed that out not so long ago in a post on this forum)
Hope this helps.
Regards,
/Dirk
Ok, will check that out. Thanks for the pointer Dirk.
-- Nik
This is an old thread but I found a solution that worked for me here - http://our.umbraco.org/wiki/reference/api-cheatsheet/moving-a-document
You need to add this line of code after you move the document...
Hi all,
Did this get resolved at all? I am doing something similar. On a publish I am moving a node, everything works well except the Link to document and Alternative link. if I republish the site then this works, however if I run this umbraco.library.RefreshContent(); then it does not appear to work.
I am doing all this work in the AfterPublish event
Any help greatfully recieved!
thanks,
Steve
Quick update.
I'm now trying to call umbraco.library.RefreshContent(); in the AfterUpdateDocumentCache event, but to no avail....
Any suggestions??
Hi Steve,
I'm calling RefreshContent() in the AfterSave event and its working for me - maybe try it in there? (it still gets called when a node gets published, I think it happens before the publish events)
is working on a reply...