11-14-05 12:48 PM
Hi Herman,
please test if the problem is resolved if you do a Commit action after each
delete.
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------
"Herman Nijland" <hipponl@yahoo.com> wrote in message
news:uLvfK%23P6FHA.3616@TK2MSFTNGP10.phx.gbl...
> L.S.
> We have a real nasty problem with users deleting channels with
> subchannels.
> In short:
> We added a 'Delete Channel' option to the user console, available to
> Channel Managers. This works ok for channels without subchannels, and cms
> nicely returns to the parent channel.
> When users delete a channel with subchannels something weird happens. The
> subchannels are deleted, but when cms returns to the parent channel it
> doesn't display the content, but it returns with a 'The page cannot be
> found' error. So, somehow the parent channel gets messed up when deleting
> a subchannel, but only for a while - after a timespan of an hour to a day
> the channel returns.
> It sometimes helps to start Site Manager and access the channel, but not
> always.. wild ideas welcome!
>
> Thanks in advance,
> Herman
>
> P.S. the code for the 'Delete Channel' routine:
> public string DeleteChannel(Channel thisChannel)
> {
> if (thisChannel != _cContext.RootChannel)
> {
> Channel returnChannel = thisChannel.Parent;
> deleteChannelContent(thisChannel);
> return returnChannel.Url + _
> "&WBCMODE=PresentationUnpublished&wbc_purpose=Basic";
> }
> else
> {
> return thisChannel.Url + _
> "&WBCMODE=PresentationUnpublished&wbc_purpose=Basic";
> }
> }
>
> private void deleteChannelContent(Channel thisChannel)
> {
> try
> {
> foreach (Posting delposting in thisChannel.Postings)
> {
> delposting.Delete();
> }
> foreach (Channel subChannel in thisChannel.Channels)
> {
> deleteChannelContent(subChannel);
> }
> thisChannel.Delete();
> _cContext.CommitAll();
> }
> catch
> {
> _cContext.RollbackAll();
> throw;
> }
> }
[ Post a follow-up to this message ]
|