Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

UserName dropped in v3?
Baseless
#1 Posted : Sunday, March 20, 2011 11:51:47 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 6/10/2010(UTC)
Posts: 141
Location: Sweden
Hi!
Seems like the default columns for kooboo 3 content are:

Published
SchemaName
FolderName
Repository
UUID
UtcCreationDate
Id
UserKey
UtcLastModificationDate

Has username been dropped? As far as i remember this could be fetched easily with UserName in v2.
I saw in the documentation for v3 that author was an example for content types. But since you do not want
the user to have to / be able to type in their usernames or id:s for every object they add, any preferred method for this?
jifeng
#2 Posted : Monday, March 21, 2011 1:36:28 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
HI

The UserName was changed to UserId, it still exists in 3.0.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Baseless
#3 Posted : Sunday, July 17, 2011 2:10:48 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 6/10/2010(UTC)
Posts: 141
Location: Sweden
I revive this thread for a moment, Since this became an open issue for me ;)
I actually tried UserId wich gives nothing back at all. If ToString() is appended on it then it will give a nullreference exception as well. For Example:


Code:
@foreach (var item in ViewBag.NewsLatest){
	<div>
	<h2>@item.Title</h2>
        <h3>@("Created".Label()) @item.UtcCreationDate.ToString("yyyy-MM-dd") @("by".Label()) @item.UserId.ToSTring()</h3>
	<p>@item.Text</p>
          <span>@("Categories".Label()):
          @foreach(var category in ((Kooboo.CMS.Content.Models.TextContent)item).Categories(ContentHelper.NewTextFolderObject("News~Categories"))) {
            @category["Name"] 
	  }</span>
	</div>
	}


Baseless
#4 Posted : Sunday, July 17, 2011 2:34:50 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 6/10/2010(UTC)
Posts: 141
Location: Sweden
Ought to mention that the UserId is actually correct in the table rows, but just calling @item.UserId seems to return nothing in the list rules.
Baseless
#5 Posted : Tuesday, July 19, 2011 6:36:05 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 6/10/2010(UTC)
Posts: 141
Location: Sweden
I tried creating another user and adding content as that user but still seems to return nothing when UserId is called.
jifeng
#6 Posted : Tuesday, July 19, 2011 7:24:13 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
Sorry for forgot this post


It is a bug, the user id have set at the text content service. But does not saved to database, the definition is:


public string UserId { get; set; }

But the correct must be:

public string UserId {
get
{
if (this.ContainsKey("UserId") && base["UserId"] != null)
{
return base["UserId"] == null ? "" : base["UserId"].ToString();
}
return null;
}
set
{
base["UserId"] = value;
}
}
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
jifeng
#7 Posted : Tuesday, July 19, 2011 7:31:01 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
It fixed at: http://kooboo.codeplex.c...set/changes/d87ff37a9b1f
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Baseless
#8 Posted : Tuesday, July 19, 2011 7:32:07 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 6/10/2010(UTC)
Posts: 141
Location: Sweden
Great, thx alot.
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.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.128 seconds.