SP2, SP1a channel manipulation bug?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > SP2, SP1a channel manipulation bug?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    SP2, SP1a channel manipulation bug?  
Martin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-24-06 12:50 PM

Hi Stefan,

I have a little class to help with channel navigation in my CMS site.

In the constructor I have the following code
Dim currentChannel, tmpChannel As channel
Dim tmpLevel As Integer
Dim appSR As AppSettingsReader

currentChannel = CmsHttpContext.Current.Channel
' rootChannel = CmsHttpContext.Current.RootChannel()
' Work around for spurious bug accessing RootChannel()

' Work out what leve the current channel is at
_level = 0
++        tmpChannel = currentChannel
While Not tmpChannel.IsRoot
tmpChannel = tmpChannel.Parent
_level += 1
End While
_rootChannel = tmpChannel

' Get level 1 channel
xx        currentChannel = CmsHttpContext.Current.Channel
**        tmpChannel = currentChannel
tmpLevel = _level
While tmpLevel > 1
tmpChannel = tmpChannel.Parent
tmpLevel -= 1
End While
'tmpChannel now has level 1 channel in it if one exists

Before I put in the line marked xx, the line marked ** fails with a null
reference exception.  I can't understand it as the line marked with ++ above
works fine.  It looks like a CMS bug to me, but I might have missed
something (??)

Why is it necessary to have the line xx to make this work?  I have only
tried the work around with SP2.

Thanks
Martin







[ Post a follow-up to this message ]



    Re: SP2, SP1a channel manipulation bug?  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-24-06 12:50 PM

Hi Martin,

what kind of problem do you get?
An exception?
What kind of exception?
Is there a call stack coming with this exception?
Did "currentChannel" get an instance in the first assignment?
If yes: does currentChannel contain "null" or not in the ** line?

Actually the code should work fine.
This would either be a bug or a database inconsistancy.

Please open a support case to get this analyzed in more details.

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
----------------------


"Martin" <x@y.z> wrote in message
news:%235C9MNNIGHA.3944@tk2msftngp13.phx.gbl...
> Hi Stefan,
>
> I have a little class to help with channel navigation in my CMS site.
>
> In the constructor I have the following code
>        Dim currentChannel, tmpChannel As channel
>        Dim tmpLevel As Integer
>        Dim appSR As AppSettingsReader
>
>        currentChannel = CmsHttpContext.Current.Channel
>        ' rootChannel = CmsHttpContext.Current.RootChannel()
>        ' Work around for spurious bug accessing RootChannel()
>
>        ' Work out what leve the current channel is at
>        _level = 0
> ++        tmpChannel = currentChannel
>        While Not tmpChannel.IsRoot
>            tmpChannel = tmpChannel.Parent
>            _level += 1
>        End While
>        _rootChannel = tmpChannel
>
>        ' Get level 1 channel
> xx        currentChannel = CmsHttpContext.Current.Channel
> **        tmpChannel = currentChannel
>        tmpLevel = _level
>        While tmpLevel > 1
>            tmpChannel = tmpChannel.Parent
>            tmpLevel -= 1
>        End While
>        'tmpChannel now has level 1 channel in it if one exists
>
> Before I put in the line marked xx, the line marked ** fails with a null
> reference exception.  I can't understand it as the line marked with ++
> above works fine.  It looks like a CMS bug to me, but I might have missed
> something (??)
>
> Why is it necessary to have the line xx to make this work?  I have only
> tried the work around with SP2.
>
> Thanks
> Martin
>







[ Post a follow-up to this message ]



    Re: SP2, SP1a channel manipulation bug?  
Martin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-24-06 11:06 PM

Hi Stefan,

It's a null reference exception I get.  The call stack stops at the ** line.
The currentChannel did get an instance in the first assignment, and so far
as I can tell it's value looks as expected on the second line where I use it
(ie. it's not null, and the channel display name is as expected).

As I have a work around, I don't want to raise a call which may turn out to
be chargeable.  However I don't mind troubleshooting if there would be no
charge.

Thanks
Martin

"Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
news:%23CwVkTOIGHA.3036@tk2msftngp13.phx.gbl...
> Hi Martin,
>
> what kind of problem do you get?
> An exception?
> What kind of exception?
> Is there a call stack coming with this exception?
> Did "currentChannel" get an instance in the first assignment?
> If yes: does currentChannel contain "null" or not in the ** line?
>
> Actually the code should work fine.
> This would either be a bug or a database inconsistancy.
>
> Please open a support case to get this analyzed in more details.
>
> 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
> ----------------------
>
>
> "Martin" <x@y.z> wrote in message
> news:%235C9MNNIGHA.3944@tk2msftngp13.phx.gbl... 
>
>







[ Post a follow-up to this message ]



    Re: SP2, SP1a channel manipulation bug?  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-24-06 11:06 PM

Hi Martin,

actually you should get an instance for the first line.
No idea why it does not work.
Without a support case it's hard to analyze this issue.

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
----------------------


"Martin" <x@y.z> wrote in message
news:O$3M5JQIGHA.964@tk2msftngp13.phx.gbl...
> Hi Stefan,
>
> It's a null reference exception I get.  The call stack stops at the **
> line.
> The currentChannel did get an instance in the first assignment, and so far
> as I can tell it's value looks as expected on the second line where I use
> it (ie. it's not null, and the channel display name is as expected).
>
> As I have a work around, I don't want to raise a call which may turn out
> to be chargeable.  However I don't mind troubleshooting if there would be
> no charge.
>
> Thanks
> Martin
>
> "Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
> news:%23CwVkTOIGHA.3036@tk2msftngp13.phx.gbl... 
>
>







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:38 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register