Welcome Guest Search | Active Topics | Members | Log In | Register

rev. 3106 InvalidCastException in Convert.ToInt32(Object value)
balbes Offline
#1 Posted : Thursday, January 28, 2010 11:04:10 PM(UTC)

Rank: YAF Lover

Medals: Medal of Honor: Portal Puzzle Master: Given to YAF community members who help unravel the Portal Puzzle and YAF.Bug Killer Medal of Honor: Medal for being a kick-ass bug killer.

Joined: 7/21/2009(UTC)
Posts: 67
Location: Mukhosransk, Russia

Thanks: 13 times
Was thanked: 7 time(s) in 6 post(s)
Occurs when "UsrAlbums" value = DBNull
in
YAF.Controls\Header.cs - line 221
YetAnotherForum.NET\controls\AlbumList.ascx.cs - line 121
YetAnotherForum.NET\pages\cp_editalbumimages.ascx.cs - lines 91, 398, 400, 422
YetAnotherForum.NET\pages\profile.ascx.cs - line 100

Fix
Check "UsrAlbums" is not DBNull
DotNetNuke Russian Community (YAF latest svn build)
1 user thanked balbes for this useful post.
Jaben on 2/1/2010(UTC)
bbobb Online
#2 Posted : Thursday, January 28, 2010 11:51:13 PM(UTC)


Rank: YAF Developer

Medals: Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.Medal of Honor for a YAF Database Key Player: Holds the key to YAF database. Bow down!Medal of Honor for the Support Knight: Given to a community member who has answered lots of support questions.

Joined: 10/21/2008(UTC)
Posts: 646
Location: Moscow

Thanks: 19 times
Was thanked: 77 time(s) in 69 post(s)
Should be fixed in r.3107.
1 user thanked bbobb for this useful post.
balbes on 1/29/2010(UTC)
balbes2 Offline
#3 Posted : Sunday, February 07, 2010 7:43:21 PM(UTC)
Rank: YAF Forumling

Joined: 2/7/2010(UTC)
Posts: 1

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
rev. 3144

fix
balbes2 attached the following image(s):
capture_02082010_082126.jpg
balbes Offline
#4 Posted : Monday, February 08, 2010 7:08:23 PM(UTC)

Rank: YAF Lover

Medals: Medal of Honor: Portal Puzzle Master: Given to YAF community members who help unravel the Portal Puzzle and YAF.Bug Killer Medal of Honor: Medal for being a kick-ass bug killer.

Joined: 7/21/2009(UTC)
Posts: 67
Location: Mukhosransk, Russia

Thanks: 13 times
Was thanked: 7 time(s) in 6 post(s)
rev. 3150
balbes attached the following image(s):
capture_02092010_065834.jpg
DotNetNuke Russian Community (YAF latest svn build)
balbes Offline
#5 Posted : Monday, February 08, 2010 7:12:50 PM(UTC)

Rank: YAF Lover

Medals: Medal of Honor: Portal Puzzle Master: Given to YAF community members who help unravel the Portal Puzzle and YAF.Bug Killer Medal of Honor: Medal for being a kick-ass bug killer.

Joined: 7/21/2009(UTC)
Posts: 67
Location: Mukhosransk, Russia

Thanks: 13 times
Was thanked: 7 time(s) in 6 post(s)
Fix for this issue

1. Alter procedure user_upgrade
Code:

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[yaf_user_upgrade](@UserID INT)
AS
BEGIN
    DECLARE @RankID       INT
    DECLARE @Flags        INT
    DECLARE @MinPosts     INT
    DECLARE @NumPosts     INT
    DECLARE @BoardId      INT
    DECLARE @RankBoardId  INT
    -- Get user and rank information
    SELECT @RankID = b.RankID,
           @Flags = b.Flags,
           @MinPosts = b.MinPosts,
           @NumPosts = a.NumPosts,
           @BoardId = a.BoardId
    FROM   [dbo].[yaf_User] a
           INNER JOIN [dbo].[yaf_Rank] b
                ON  b.RankID = a.RankID
    WHERE  a.UserID = @UserID
    
    -- If user isn't member of a ladder rank, exit
    IF (@Flags & 2) = 0
        RETURN
    
    SELECT @RankBoardId = BoardID
    FROM   [dbo].[yaf_Rank]
    WHERE  RankID = @RankID
    
    IF @RankBoardId <> @BoardId
        SELECT TOP 1
               @RankID = RankID
        FROM   [dbo].[yaf_Rank]
        WHERE  BoardId = @BoardId
               AND (Flags & 2) = 2
               AND MinPosts <= @NumPosts
        ORDER BY
               MinPosts DESC
    ELSE
        -- See if user got enough posts for next ladder group
        SELECT TOP 1
               @RankID = RankID
        FROM   [dbo].[yaf_Rank]
        WHERE  BoardId = @BoardId
               AND (Flags & 2) = 2
               AND MinPosts <= @NumPosts
               AND MinPosts > @MinPosts
        ORDER BY
               MinPosts
    
    IF @@ROWCOUNT = 1
        UPDATE [dbo].[yaf_User]
        SET    RankID = @RankID
        WHERE  UserID = @UserID
END


2. Update broken users rank
Code:

DECLARE @user_id      INT 
DECLARE users_cursor  CURSOR 
FOR
    SELECT [UserID]
    FROM   [dbo].[yaf_User]

OPEN users_cursor
FETCH NEXT FROM users_cursor INTO @user_id
WHILE @@FETCH_STATUS = 0
BEGIN
    EXEC [dbo].[yaf_user_upgrade]
         @UserID = @user_id
   
    FETCH NEXT FROM users_cursor INTO @user_id
END
CLOSE users_cursor
DEALLOCATE users_cursor
DotNetNuke Russian Community (YAF latest svn build)
Ederon Offline
#6 Posted : Tuesday, February 09, 2010 12:33:14 AM(UTC)


Rank: YAF Developer

Medals: Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.Medal of Honor for the Support Knight: Given to a community member who has answered lots of support questions.

Joined: 1/7/2007(UTC)
Posts: 1,209
Location: Heart of Europe

Thanks: 1 times
Was thanked: 10 time(s) in 8 post(s)
Thanks!
When I post FP:Ederon in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting.
Ederon Offline
#7 Posted : Monday, February 15, 2010 10:58:31 AM(UTC)


Rank: YAF Developer

Medals: Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.Medal of Honor for the Support Knight: Given to a community member who has answered lots of support questions.

Joined: 1/7/2007(UTC)
Posts: 1,209
Location: Heart of Europe

Thanks: 1 times
Was thanked: 10 time(s) in 8 post(s)
Fixed in rev.3194. Thanks again!
When I post FP:Ederon in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting.
balbes Offline
#8 Posted : Monday, February 15, 2010 6:49:17 PM(UTC)

Rank: YAF Lover

Medals: Medal of Honor: Portal Puzzle Master: Given to YAF community members who help unravel the Portal Puzzle and YAF.Bug Killer Medal of Honor: Medal for being a kick-ass bug killer.

Joined: 7/21/2009(UTC)
Posts: 67
Location: Mukhosransk, Russia

Thanks: 13 times
Was thanked: 7 time(s) in 6 post(s)
Please update [dbo].[yaf_Rank] to [{databaseOwner}].[{objectQualifier}Rank] at line 5682 in procedures.sql
balbes attached the following image(s):
procedures.jpg
DotNetNuke Russian Community (YAF latest svn build)
herman_herman Offline
#9 Posted : Monday, February 15, 2010 7:10:48 PM(UTC)


Rank: YAF MVP

Medals: Medal of Honor for the SQL Scout: Medal for kicking ass at SQL and helping with database development.Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.Medal of Honor for The Eyes of the Community: Given for being a community hawk, always watching and helping fellow users.

Joined: 5/18/2007(UTC)
Posts: 636
Location: Iran - Tehran

Thanks: 57 times
Was thanked: 36 time(s) in 34 post(s)
balbes wrote:
Please update [dbo].[yaf_Rank] to [{databaseOwner}].[{objectQualifier}Rank] at line 5682 in procedures.sql

Ok.Thanks balbes.
Half of my life was elapsed in front of monitors, waiting for progress bars to reach their 100%.
Ederon Offline
#10 Posted : Monday, February 15, 2010 9:58:57 PM(UTC)


Rank: YAF Developer

Medals: Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.Medal of Honor for the Support Knight: Given to a community member who has answered lots of support questions.

Joined: 1/7/2007(UTC)
Posts: 1,209
Location: Heart of Europe

Thanks: 1 times
Was thanked: 10 time(s) in 8 post(s)
balbes wrote:
Please update [dbo].[yaf_Rank] to [{databaseOwner}].[{objectQualifier}Rank] at line 5682 in procedures.sql

Blushing thx
When I post FP:Ederon in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting.
Jaben Offline
#11 Posted : Tuesday, February 16, 2010 9:41:10 AM(UTC)

Rank: YAF Head Dude

Medals: Medal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.Medal of Honor for the Support King: Given to a community member who tirelessly answers tons of support questions.

Joined: 10/9/2004(UTC)
Posts: 4,152
Location: Raleigh, NC

Thanks: 35 times
Was thanked: 94 time(s) in 49 post(s)
balbes wrote:
Please update [dbo].[yaf_Rank] to [{databaseOwner}].[{objectQualifier}Rank] at line 5682 in procedures.sql

Thanks balbes, but everyone: please start to use the issue tracker. This was already listed in the issue tracker.
"I have a simple philosophy: Fill what's empty. Empty what's full. Scratch where it itches.”.

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 RC4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.168 seconds.