Content tree not fully updating after document move on publish
Hi all,
I have a project where members can submit potential news stories via the front-end of the site. The content they create is saved as an un-published "news" node which is filed in a "Pending" folder.
The administrator then logs in to the Umbraco back office, reviews the articles in the "Pending" folder, before publishing them.
On publish (using the ContentService.Publishing event handler), I move the story in to a month/year folder (so it becomes site.com/year/month/news-story).
All is working fine, apart from one small point.
When the administrator clicks on "Publish", the content tree updates to show the node in it's new location.
However, it's still visible in the "Pending" folder until you reload the Content tab in the back office - as you can see here:
"Another test news story" has been moved to sit under it's 2017-11 folder structure, but remains visible under "Pending news".
I'm tapping in to the event handler ContentService.Publishing to move the node as part of the Publishing process.
My code for this event handler looks at each node being published in a foreach loop, works out if they are already in the right place, or if they need moving. If they need moving, a check is made to see if the year/month nodes exist. If not, I create/publish the required nodes.
... to move the news node to sit under it's appropriate month node.
As you can see from the screenshot, it's working fine - in that you can see the new "folder" nodes being created, and the news node being moved to the correct location. However, a duplicate copy (visually only) is remaining behind in it's old location.
I also tried using...
ClientTools clientTools = new ClientTools(new BasePage());
clientTools.SyncTree(pendingFolder.Path, true);
... in an attempt to force a reload of the "Pending" folder, but that seems to not be happening.
Content tree not fully updating after document move on publish
Hi all,
I have a project where members can submit potential news stories via the front-end of the site. The content they create is saved as an un-published "news" node which is filed in a "Pending" folder.
The administrator then logs in to the Umbraco back office, reviews the articles in the "Pending" folder, before publishing them.
On publish (using the ContentService.Publishing event handler), I move the story in to a month/year folder (so it becomes site.com/year/month/news-story).
All is working fine, apart from one small point.
When the administrator clicks on "Publish", the content tree updates to show the node in it's new location.
However, it's still visible in the "Pending" folder until you reload the Content tab in the back office - as you can see here:
"Another test news story" has been moved to sit under it's 2017-11 folder structure, but remains visible under "Pending news".
Any ideas?
Steve.
Hi Steve,
How are you moving the content on publish? Is it a manual job through the CMS? If so what are the exact steps that you're taking?
If it's code, can you show us that instead please?
Thanks!
Hello,
I'm tapping in to the event handler ContentService.Publishing to move the node as part of the Publishing process.
My code for this event handler looks at each node being published in a foreach loop, works out if they are already in the right place, or if they need moving. If they need moving, a check is made to see if the year/month nodes exist. If not, I create/publish the required nodes.
Then finally when everything is set, I use...
... to move the news node to sit under it's appropriate month node.
As you can see from the screenshot, it's working fine - in that you can see the new "folder" nodes being created, and the news node being moved to the correct location. However, a duplicate copy (visually only) is remaining behind in it's old location.
I also tried using...
... in an attempt to force a reload of the "Pending" folder, but that seems to not be happening.
Steve.
I also need the solution to this situation.
I couldn't figure it out - and I started working on another project for a few weeks. Back on it today - will post if I find a workaround.
is working on a reply...