abcd
  • Posts: 39
  • Joined: 03/04/2007
Dear All,
I just upgrade my yaf forum to version 1.9.6.1 (Date: 18-03-2012).
I meet the issue in email verify, it shows all Chinese character and have no link to active for new member.
please help me to fix this issue.
Thank a lot.
Sponsor
tha_watcha
  • Posts: 4132
  • Joined: 06/03/2010
Originally Posted by: abcd 

Dear All,
I just upgrade my yaf forum to version 1.9.6.1 (Date: 18-03-2012).
I meet the issue in email verify, it shows all Chinese character and have no link to active for new member.
please help me to fix this issue.
Thank a lot.



Why did you upgrade to an old release and not the latest version (issue is still present in YAF 2.0)? The issue will be fixed in 2.1.

You have two options to resolve this issue you can modify the source of the version you use and apply the changes in the file yafsrc/YAF.Core/Extensions/MailMessageExtensions.cs, which i posted https://github.com/YAFNE...8b692d98afdf937e6b2fa9bc  here.

Or if you are unable to compile the source code, you upgrade to YAF 2.0 and use the fixed dlls i posted here http://forum.yetanotherf...--problem.aspx#post61961 
UserPostedImage
tha_watcha
  • Posts: 4132
  • Joined: 06/03/2010
There is a procedure which can take very long, if you didn't have display names enabled then there is a workaround for you here.
UserPostedImage
abcd
  • Posts: 39
  • Joined: 03/04/2007
Dear Tha_watcha,
I remove these lines from tables.sql in install folder:
Quote:

if exists (select top 1 1 from [{databaseOwner}].[{objectQualifier}Message] where UserDisplayName IS NULL)
exec('[{databaseOwner}].[{objectQualifier}forum_initdisplayname]')
GO


but another error happen:

Quote:

Server Error in '/' Application.

FILE:
mssql/constraints.sql

ERROR:
Cannot create more than one clustered index on table 'dbo.yaf_UserProfile'. Drop the existing clustered index '_dta_index_yaf_UserProfile_c_7_492426714__K1' before creating another.
Could not create constraint. See previous errors.

STATEMENT:
if not exists (select top 1 1 from sys.indexes where object_id=object_id('[dbo].[yaf_UserProfile]') and name='PK_yaf_UserProfile')
alter table [dbo].[yaf_UserProfile] with nocheck add constraint [PK_yaf_UserProfile] primary key clustered(UserID,ApplicationName)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: FILE:
mssql/constraints.sql

ERROR:
Cannot create more than one clustered index on table 'dbo.yaf_UserProfile'. Drop the existing clustered index '_dta_index_yaf_UserProfile_c_7_492426714__K1' before creating another.
Could not create constraint. See previous errors.

STATEMENT:
if not exists (select top 1 1 from sys.indexes where object_id=object_id('[dbo].[yaf_UserProfile]') and name='PK_yaf_UserProfile')
alter table [dbo].[yaf_UserProfile] with nocheck add constraint [PK_yaf_UserProfile] primary key clustered(UserID,ApplicationName)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[Exception: FILE:
mssql/constraints.sql

ERROR:
Cannot create more than one clustered index on table 'dbo.yaf_UserProfile'. Drop the existing clustered index '_dta_index_yaf_UserProfile_c_7_492426714__K1' before creating another.
Could not create constraint. See previous errors.

STATEMENT:
if not exists (select top 1 1 from sys.indexes where object_id=object_id('[dbo].[yaf_UserProfile]') and name='PK_yaf_UserProfile')
alter table [dbo].[yaf_UserProfile] with nocheck add constraint [PK_yaf_UserProfile] primary key clustered(UserID,ApplicationName)]
YAF.Classes.Data.LegacyDb.system_initialize_executescripts(String script, String scriptFile, Boolean useTransactions) +1540
YAF.Core.Services.InstallUpgradeService.ExecuteScript(String scriptFile, Boolean useTransactions) +188
YAF.Core.Services.InstallUpgradeService.UpgradeDatabase(Boolean fullText, Boolean upgradeExtensions) +205
YAF.Install._default.Wizard_NextButtonClick(Object sender, WizardNavigationEventArgs e) +1559
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +584
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +84
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804



thanks for your help
bbobb
  • Posts: 1558
  • Joined: 21/10/2008
Quote:

Drop the existing clustered index '_dta_index_yaf_UserProfile_c_7_492426714__K1' before creating another.


DROP INDEX _dta_index_yaf_UserProfile_c_7_492426714__K1
It can't be done from installation scripts automatically because in each case index name can vary.
(and there is a special drop index maintanance sp somewhere in tables.sql, I'm not sure that it works in all cases)

Your case is very rare because you have caught a version in development bug.

As to initdisplayname this is a code you can try to replace it in tables.sql. It should work even for a forum like yours.
I don't have time to wipe out possible bugs, because I don't use MS SQL Server, but still I can help anyone who will try it to wipe them.

create procedure [{databaseOwner}].[{objectQualifier}forum_initdisplayname] as

begin
	declare @tmpUserName nvarchar(255)
	declare @tmpUserDisplayName nvarchar(255)
	declare @tmpLastUserName nvarchar(255)
	declare @tmpLastUserDisplayName nvarchar(255)
	declare @tmp int
	declare @tmpUserID int
	declare @tmpLastUserID int

	 update d
      set    d.UserDisplayName = ISNULL((select top 1 f.UserDisplayName FROM [{databaseOwner}].[{objectQualifier}Forum] f
          join [{databaseOwner}].[{objectQualifier}User] u on u.UserID = f.UserID where u.UserID = d.UserID), 
           (select top 1 f.UserName FROM [{databaseOwner}].[{objectQualifier}Forum] f
          join [{databaseOwner}].[{objectQualifier}User] u on u.UserID = f.UserID where u.UserID = d.UserID ))	    
       from  [{databaseOwner}].[{objectQualifier}Forum] d where d.UserDisplayName IS NULL OR d.UserDisplayName = d.UserName;
		
		/* declare fc cursor for
		select ForumID, LastUserID from [{databaseOwner}].[{objectQualifier}Forum]
		where (LastUserDisplayName IS NULL OR LastUserName IS NULL) and LastUserID IS NOT NULL
		FOR UPDATE		
		open fc
		
		fetch next from fc into @tmp,@tmpLastUserID
		while @@FETCH_STATUS = 0
		begin
		select @tmpLastUserDisplayName = u.DisplayName,  @tmpLastUserName = u.Name FROM [{databaseOwner}].[{objectQualifier}User] u WHERE u.UserID = @tmpLastUserID
		update [{databaseOwner}].[{objectQualifier}Forum] set LastUserDisplayName = @tmpLastUserDisplayName, LastUserName = @tmpLastUserName where [{databaseOwner}].[{objectQualifier}Forum].ForumID = @tmp 	
		fetch next from fc into @tmp,@tmpLastUserID
		end
		close fc
		deallocate fc */

		update d
       set    d.UserDisplayName = ISNULL((select top 1 f.UserDisplayName FROM [{databaseOwner}].[{objectQualifier}ShoutboxMessage] f
          join [{databaseOwner}].[{objectQualifier}User] u on u.UserID = f.UserID where u.UserID = d.UserID), 
           (select top 1 f.UserName FROM [{databaseOwner}].[{objectQualifier}ShoutboxMessage] f
          join [{databaseOwner}].[{objectQualifier}User] u on u.UserID = f.UserID where u.UserID = d.UserID ))	    
       from  [{databaseOwner}].[{objectQualifier}ShoutboxMessage] d where d.UserDisplayName IS NULL OR d.UserDisplayName = d.UserName;
		
	/*	declare sbc cursor for
		select ShoutBoxMessageID,UserID from [{databaseOwner}].[{objectQualifier}ShoutboxMessage]
		where UserDisplayName IS NULL
		FOR UPDATE		
		open sbc
		
		fetch next from sbc into @tmp,@tmpUserID
		while @@FETCH_STATUS = 0
		begin
		select @tmpUserDisplayName = u.DisplayName,  @tmpUserName = u.Name FROM [{databaseOwner}].[{objectQualifier}User] u WHERE u.UserID = @tmpUserID
		update [{databaseOwner}].[{objectQualifier}ShoutboxMessage] set UserDisplayName = @tmpUserDisplayName,UserName = @tmpUserName where [{databaseOwner}].[{objectQualifier}ShoutboxMessage].ShoutBoxMessageID = @tmp
		fetch next from sbc into @tmp,@tmpUserID
		end
		close sbc
		deallocate sbc	
		*/	
		
			update d
       set    d.UserDisplayName = ISNULL((select top 1 f.UserDisplayName FROM [{databaseOwner}].[{objectQualifier}Message] m
          join [{databaseOwner}].[{objectQualifier}User] u on u.UserID = m.UserID where u.UserID = d.UserID), 
           (select top 1 f.UserName FROM [{databaseOwner}].[{objectQualifier}Message] m
          join [{databaseOwner}].[{objectQualifier}User] u on u.UserID = m.UserID where u.UserID = d.UserID ))	    
       from  [{databaseOwner}].[{objectQualifier}Message] d where d.UserDisplayName IS NULL OR d.UserDisplayName = d.UserName;	
		
	/*	declare mc cursor for
		select MessageID,UserID from [{databaseOwner}].[{objectQualifier}Message]
		where UserDisplayName IS NULL
		FOR UPDATE
				
		open mc
		
		fetch next from mc into @tmp,@tmpUserID
		while @@FETCH_STATUS = 0
		begin
		select @tmpUserDisplayName = u.DisplayName,  @tmpUserName = u.Name FROM [{databaseOwner}].[{objectQualifier}User] u WHERE u.UserID = @tmpUserID		
		update [{databaseOwner}].[{objectQualifier}Message]  set UserDisplayName = @tmpUserDisplayName, UserName = @tmpUserName where MessageID = @tmp
		fetch next from mc into @tmp,@tmpUserID
		end
		close mc
		deallocate mc
		*/		
		
			update d
       set    d.UserDisplayName = ISNULL((select top 1 f.UserDisplayName FROM [{databaseOwner}].[{objectQualifier}Topic] t
          join [{databaseOwner}].[{objectQualifier}User] u on u.UserID = t.UserID where u.UserID = d.UserID), 
           (select top 1 f.UserName FROM [{databaseOwner}].[{objectQualifier}Topic] t
          join [{databaseOwner}].[{objectQualifier}User] u on u.UserID = t.UserID where u.UserID = d.UserID ))	    
       from  [{databaseOwner}].[{objectQualifier}Message] d where d.UserDisplayName IS NULL OR d.UserDisplayName = d.UserName;	

	/*	declare tc cursor for
		select TopicID,UserID,LastUserID from [{databaseOwner}].[{objectQualifier}Topic]
		where (UserDisplayName IS NULL OR LastUserDisplayName IS NULL) and LastUserID IS NOT NULL 
		FOR UPDATE
				
		open tc
		
		fetch next from tc into @tmp,@tmpUserID,@tmpLastUserID
		while @@FETCH_STATUS = 0
		begin	
		select @tmpUserDisplayName = u.DisplayName,  @tmpUserName = u.Name FROM [{databaseOwner}].[{objectQualifier}User] u WHERE u.UserID = @tmpUserID	
		select @tmpLastUserDisplayName = u.DisplayName,  @tmpLastUserName = u.Name FROM [{databaseOwner}].[{objectQualifier}User] u WHERE u.UserID = @tmpLastUserID		
		update [{databaseOwner}].[{objectQualifier}Topic] set UserDisplayName = @tmpUserDisplayName, UserName = @tmpUserName  where TopicID = @tmp
		update [{databaseOwner}].[{objectQualifier}Topic] set LastUserDisplayName = @tmpLastUserDisplayName, LastUserName = @tmpLastUserName where TopicID = @tmp			

		fetch next from tc into @tmp,@tmpUserID,@tmpLastUserID
		end
		close tc
		deallocate tc	*/		
end
GO

abcd
  • Posts: 39
  • Joined: 03/04/2007
Thanks bbobb and All
I may be waited for new version to fix this issue
tha_watcha
  • Posts: 4132
  • Joined: 06/03/2010
Originally Posted by: abcd 

Thanks bbobb and All
I may be waited for new version to fix this issue



You need to manually drop the index. Do you have access to the sql server management studio on your server? if yes you can directly remove it from the userprofile table. If not Go in YAF to Admin -> Database -> Run SQL Query ->

if exists (select top 1 1 from  sys.indexes where object_id=object_id('[{databaseOwner}].[{objectQualifier}UserProfile]') and name='_dta_index_yaf_UserProfile_c_7_492426714__K1')
ALTER TABLE [{databaseOwner}].[{objectQualifier}UserProfile] DROP CONSTRAINT _dta_index_yaf_UserProfile_c_7_492426714__K1


UserPostedImage
Users browsing this topic
    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.

    About Us

    The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

    Powered by Resharper Donate with PayPal button

    Project Twitter Updates

    Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved