Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Bug in Banner skin object in 5.6?Bug in Banner skin object in 5.6?
Previous
 
Next
New Post
1/13/2012 5:15 PM
 

It appears there is a bug in the Banner skin object that was likely introduced around 5.6, where you can't use the BannerTypeId attribute in your skin. Here is the offending code:

Dim BannerType As Integer
If AllowNullBannerType Then
    If Not String.IsNullOrEmpty(BannerTypeId) Then
        BannerType = Int32.Parse(CType(BannerTypeId, String))
    End If
Else
    If String.IsNullOrEmpty(BannerTypeId) Then
        BannerType = PortalController.GetPortalSettingAsInteger("BannerTypeId", PortalSettings.PortalId, 1)
    End If
End If

 If you don't set AllowNullBannerType (which defaults to false) and you DO set BannerTypeId, then the BannerType int doesn't get set. The good news is there is a workaround by setting AllowNullBannerType="true" if you want to set BannerTypeId, but I don't think that was the original intention for that property. Hopefully this helps someone; it broke banners in my site after upgrading (good thing I upgraded on a test site first!)

 
New Post
1/13/2012 7:27 PM
 
Have you upgraded to 6 yet? I had submitted a number of fixes that I believe were included in 6.1.1 or 6.1.2 for the banner skin object.

Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
1/14/2012 10:26 AM
 

I wish I could, but there are some issues I have to address in some old custom modules before I can upgrade my client to version 6. It looks like the bug still exists in 6.1.2, though:

int BannerType = 0;
if (AllowNullBannerType)
{
    if (!string.IsNullOrEmpty(BannerTypeId))
    {
        BannerType = Int32.Parse(Convert.ToString(BannerTypeId));
    }
}
else
{
    if (string.IsNullOrEmpty(BannerTypeId))
    {
        BannerType = PortalController.GetPortalSettingAsInteger("BannerTypeId", PortalSettings.PortalId, 1);
    }
}
 

 If AllowNullBannerType is false, then BannerType ONLY gets set if BannerTypeId is NOT set (unless I'm totally reading this wrong!) Maybe you could change the code above to:

 int BannerType = 0;
if (AllowNullBannerType)
{
    if (!string.IsNullOrEmpty(BannerTypeId))
    {
        BannerType = Int32.Parse(Convert.ToString(BannerTypeId));
    }
}
else
{
    if (!int.TryParse(BannerTypeId, out BannerType))
    {
        BannerType = PortalController.GetPortalSettingAsInteger("BannerTypeId", PortalSettings.PortalId, 1);
    }
}

 That way BannerType gets set to the value passed in IF it can be parsed as an integer, otherwise it gets set to the PortalSetting value. Regardless, we can still work around it by setting AllowNullBannerType=true if we want to use BannerTypeId as an attribute so it's a pretty low priority issue... I just figured I'd share the find just in case it helps someone out.

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Bug in Banner skin object in 5.6?Bug in Banner skin object in 5.6?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out