Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

EPIServer Community, member portrait error

Vote:
 

I have installed EpiServer Community on top of an episerver 7 WebForm project. I add an user without any problems but when I add a portrait to the user I get an exception. As follows.

Line 69:                             <div class="image">
Line 70:                                 <asp:CheckBox ID="checkBoxSelected" runat="server" CssClass="imageSelector" />
Line 71:                                 <img src="<%# GetThumbnailUrl((EPiServer.Community.ImageGallery.Image)Container.DataItem) %>" border="0" title="<%# AdministrationUtils.FormatString((string)DataBinder.Eval(Container.DataItem, "Body")) %>" onclick="SCImageGalleryOpenImageInfoWindow(<%# DataBinder.Eval(Container.DataItem, "ID") %>)" /><br />
Line 72:                             </div>
Line 73:                             <asp:RadioButtonList ID="radioButtonListImagePublishState" CssClass="input" runat="server" RepeatColumns="1" RepeatDirection="Vertical" RepeatLayout="Flow">

 

This doesn't happen if I install the Relate+ site.

Is it a bug or do I have to anythingmore to get it work?
Has anyone had this problem before and how have you solved it?

#74211
Aug 22, 2013 13:54
Vote:
 

EDIT: The error is 

Object reference not set to an instance of an object.

and i thrown on 

GetThumbnailUrl((EPiServer.Community.ImageGallery.Image)Container.DataItem)

It is only thrown when Container.DataItem is not null. That will say, it has an image.
#74213
Aug 22, 2013 13:59
Vote:
 

What <imageGallery> configuration node looks like?

#74246
Aug 22, 2013 17:33
Vote:
 

Hi, it looks like this.

<imageGallery imageAbsoluteFilePath="C:\EPiServer\CommunityFolder\WebFormMediaRelateFolder\EPiServerCommunity\Modules\ImageGallery\Originals"
thumbnailVirtualFilePath="~/EPiServerCommunity/Modules/ImageGallery/Thumbnails"
imgExtension=".jpg"
imgMaxWidth="640"
imgMaxHeight="640"
saveOriginal="true"
maxUserImageQuota="0"
imgQuality="100">
<!--thumbnailBackgroundColor r="255" g="255" b="255" /-->
<!--watermark imageAbsoluteFilePath="" horizontalAlign="Right" verticalAlign="Bottom" format="Exact">
<canvas top="0" right="0" bottom="14" left="0" r="255" g="255" b="255" />
</watermark-->
</imageGallery>

#74258
Edited, Aug 23, 2013 8:28
Vote:
 

Do you see an error after you upload portrait image for the user? Is file physically created on the disk?

#74296
Aug 23, 2013 13:25
Vote:
 

The file is succesfully uploaded and is physically created on the disk.

 

EDIT: This is the error after upload of file (same error but on different page)

 

Server Error in '/' Application.


Object reference not set to an instance of an object.

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.NullReferenceException: Object reference not set to an instance of an object.

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: 

[NullReferenceException: Object reference not set to an instance of an object.]
   EPiServer.Community.Web.Administration.ImageExtensions.GetUrl(Thumbnail thumbnail) +48
   EPiServer.Community.Web.Administration.PortraitControl.InitializePortrait(MyPage mp) +151
   EPiServer.Community.Web.Administration.EditUser.SaveUser(IUser user) +953
   EPiServer.Community.Web.Administration.EditUser.buttonSave_Click(Object sender, EventArgs e) +67
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9552602
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724

 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18044

#74297
Edited, Aug 23, 2013 13:26
Vote:
 

Interesting. Can you try to enable database tracing and see what SP named "spEPiServerCommunityMyPageGetPortraitImages" returns?

#74303
Aug 23, 2013 13:40
Vote:
 

Let's see.

 

<?xml version="1.0" encoding="utf-16"?>
<events>
<event EventClass="10" CPU="0" Reads="72" Writes="0" Duration="1144" SPID="55" LoginName="dbUserEPI7WebFormTest">exec spEPiServerCommunityMyPageGetPortraitImages @intPage=1,@intPageSize=50,@intStatus=1,@strOrderBy=N'tblEPiServerCommunityImageGalleryImage.datCreated DESC '</event>
</events>

 

I just copied all info my express profiler got me :) 

 

EDIT:

This is the info from when I uploaded this image above.

 

<event EventClass="10" CPU="0" Reads="23" Writes="9" Duration="349" SPID="57" LoginName="dbUserEPI7WebFormTest">exec spEPiServerCommunityImageGalleryAddImage @strHeader=N'kalle.jpeg',@strBody=N'',@intHeight=128,@intWidth=99,@intImageGalleryID=1026,@intOrder=0,@intAuthorID=2,@strLanguageID=NULL,@intStatus=1</event>

#74306
Edited, Aug 23, 2013 13:51
Vote:
 

Does get protrait images stored proc gives you back any records?

#74329
Aug 23, 2013 15:37
Vote:
 

If I single step in the code I see that the absolute path has the correct path to an image when it crashes. Was it what you asked for?

#74331
Aug 23, 2013 15:44
Vote:
 

Can you post node content (with childrens) for "/episerver.common/sites/site[@siteId={your id or *}]/uri" from web.config?

#74370
Aug 26, 2013 17:18
Vote:
 

This part?

<episerver.common>
<sites>
<site siteId="*">
<cache defaultProvider="EPiServerCacheExpirationProvider">
<providers>
<add name="EPiServerCacheExpirationProvider" type="EPiServer.Common.Cache.CacheExpirationProvider, EPiServer.Common.Cache"/>
</providers>
</cache>
<security defaultProvider="HMACSHA256PasswordProvider" anonymousGroupId="2">
<providers>
<add name="CleartextPasswordProvider" type="EPiServer.Common.Security.CleartextPasswordProvider, EPiServer.Common.Security"/>
<add name="HMACMD5PasswordProvider" type="EPiServer.Common.Security.HMACMD5PasswordProvider, EPiServer.Common.Security"/>
<add name="HMACPasswordProvider" type="EPiServer.Common.Security.HMACPasswordProvider, EPiServer.Common.Security"/>
<add name="HMACSHA256PasswordProvider" type="EPiServer.Common.Security.HMACSHA256PasswordProvider, EPiServer.Common.Security"/>
</providers>
</security>
<uri defaultProvider="null">
<providers>
<add name="null" type="EPiServer.Common.Uri.UriProviderHandler+NullUriProvider, EPiServer.Common.Framework.Impl"/>
<add name="resources" type="EPiServer.Community.Web.Administration.ResourceUriProvider, EPiServer.Community.Web.Administration"/>
</providers>
</uri>
<syndication viewModeUriProviderName="" resourceUriProviderName="resources" feedUriProviderName=""/>
<integration>
<rolesToSynchronize>
<add name="*"/>
</rolesToSynchronize>
<rolesToTransfer>
<add name="Administrators"/>
<add name="CommunityAdmins"/>
<add name="CommunityModerators"/>
</rolesToTransfer>
</integration>
<entity>
<providers/>
<supportedTypes/>
</entity>
<framework>
<rating maxRating="10"/>
<tag>
<archiving interval="23:59:59" maxRelatedTags="5"/>
<tagCloud noiseLevel="100" cacheExpiration="23:59:59" minItemWeight="1" maxItemWeight="10" defaultItemCount="150"/>
</tag>
<activityLog logLevel="Custom">
<loggedTypes>
<add type="EPiServer.Common.Security.IUser, EPiServer.Common.Framework"/>
<add type="EPiServer.Common.Comments.Comment, EPiServer.Common.Framework.Impl"/>
<add type="EPiServer.Community.Blog.EntryComment, EPiServer.Community.Blog"/>
<add type="EPiServer.Community.Blog.Entry, EPiServer.Community.Blog"/>
<add type="EPiServer.Community.Blog.Blog, EPiServer.Community.Blog"/>
<add type="EPiServer.Community.Calendar.Calendar, EPiServer.Community.Calendar"/>
<add type="EPiServer.Community.Calendar.Event, EPiServer.Community.Calendar"/>
<add type="EPiServer.Community.Calendar.Invite, EPiServer.Community.Calendar"/>
<add type="EPiServer.Community.Calendar.Registration, EPiServer.Community.Calendar"/>
<add type="EPiServer.Community.Club.Club, EPiServer.Community.Club"/>
<add type="EPiServer.Community.Contest.Contest, EPiServer.Community.Contest"/>
<add type="EPiServer.Community.Contest.Question, EPiServer.Community.Contest"/>
<add type="EPiServer.Community.Contest.TextAnswer, EPiServer.Community.Contest"/>
<add type="EPiServer.Community.DirectMessage.Message, EPiServer.Community.DirectMessage"/>
<add type="EPiServer.Community.DocumentArchive.Content, EPiServer.Community.DocumentArchive"/>
<add type="EPiServer.Community.Expert.Question, EPiServer.Community.Expert"/>
<add type="EPiServer.Community.Expert.Answer, EPiServer.Community.Expert"/>
<add type="EPiServer.Community.Forum.Room, EPiServer.Community.Forum"/>
<add type="EPiServer.Community.Forum.RoomBase, EPiServer.Community.Forum"/>
<add type="EPiServer.Community.Forum.Message, EPiServer.Community.Forum"/>
<add type="EPiServer.Community.Forum.Topic, EPiServer.Community.Forum"/>
<add type="EPiServer.Community.Forum.Reply, EPiServer.Community.Forum"/>
<add type="EPiServer.Community.ImageGallery.Image, EPiServer.Community.ImageGallery"/>
<add type="EPiServer.Community.MyPage.MyPage, EPiServer.Community.MyPage"/>
<add type="EPiServer.Community.Poll.Poll, EPiServer.Community.Poll"/>
<add type="EPiServer.Community.Poll.Choice, EPiServer.Community.Poll"/>
<add type="EPiServer.Community.StarViral.Campaign, EPiServer.Community.StarViral"/>
<add type="EPiServer.Community.StarViral.Referral, EPiServer.Community.StarViral"/>
<add type="EPiServer.Community.VideoGallery.Video, EPiServer.Community.VideoGallery"/>
<add type="EPiServer.Community.VideoGallery.VideoComment, EPiServer.Community.VideoGallery"/>
<add type="EPiServer.Community.ImageGallery.ImageComment, EPiServer.Community.ImageGallery"/>
</loggedTypes>
</activityLog>
</framework>
<eventCounter active="true">
<events>
<add action="Add" name="UserAdded" groupName="User" type="EPiServer.Common.Security.SecurityHandler, EPiServer.Common.Security" event="CreatedUser" instanceMethod="get_Instance"/>
<add action="Remove" name="UserRemoved" groupName="User" type="EPiServer.Common.Security.SecurityHandler, EPiServer.Common.Security" event="RemovedUser" instanceMethod="get_Instance"/>
<add name="RegisteredMembers" type="EPiServer.Community.MyPage.MyPageHandler, EPiServer.Community.MyPage" instanceMethod="get_Instance" groupName="activity.members.registeredMembers" event="Register" action="Add"/>
<add name="UnregisteredMembers" type="EPiServer.Community.MyPage.MyPageHandler, EPiServer.Community.MyPage" instanceMethod="get_Instance" groupName="activity.members.unregisteredMembers" event="UserRemoved" action="Remove"/>
<add name="Image" type="EPiServer.Community.ImageGallery.ImageGalleryHandler, EPiServer.Community.ImageGallery" instanceMethod="get_Instance" groupName="activity.imageContent.image" event="ImageAdded" action="Add"/>
<add name="ImageComment" type="EPiServer.Community.ImageGallery.ImageGalleryHandler, EPiServer.Community.ImageGallery" instanceMethod="get_Instance" groupName="activity.imageContent.imageComment" event="ImageCommentAdded" action="Add"/>
<add name="Video" type="EPiServer.Community.VideoGallery.VideoGalleryHandler, EPiServer.Community.VideoGallery" instanceMethod="get_Instance" groupName="activity.videoContent.video" event="VideoAdded" action="Add"/>
<add name="VideoComment" type="EPiServer.Community.VideoGallery.VideoGalleryHandler, EPiServer.Community.VideoGallery" instanceMethod="get_Instance" groupName="activity.videoContent.videoComment" event="VideoCommentAdded" action="Add"/>
<add name="Blog" type="EPiServer.Community.Blog.BlogHandler, EPiServer.Community.Blog" instanceMethod="get_Instance" groupName="activity.blogContent.blog" event="BlogAdding" action="Add"/>
<add name="BlogComment" type="EPiServer.Community.Blog.BlogHandler, EPiServer.Community.Blog" instanceMethod="get_Instance" groupName="activity.blogContent.blogComment" event="EntryCommentAdded" action="Add"/>
<add name="ForumTopic" type="EPiServer.Community.Forum.ForumHandler, EPiServer.Community.Forum" instanceMethod="get_Instance" groupName="activity.forumContent.forumTopic" event="TopicAdded" action="Add"/>
<add name="ForumReply" type="EPiServer.Community.Forum.ForumHandler, EPiServer.Community.Forum" instanceMethod="get_Instance" groupName="activity.forumContent.forumReply" event="ReplyAdded" action="Add"/>
<add name="Clubs" type="EPiServer.Community.Club.ClubHandler, EPiServer.Community.Club" instanceMethod="get_Instance" groupName="activity.clubs" event="ClubAdded" action="Add"/>
</events>
</eventCounter>
</site>
</sites>
</episerver.common>

#74377
Aug 27, 2013 8:29
Vote:
 

Not quite sure, but try upper case in name of this uri provider:

<add name="Resources" type="EPiServer.Community.Web.Administration.ResourceUriProvider, EPiServer.Community.Web.Administration"/>

    

#74386
Aug 27, 2013 11:05
Vote:
 

Unfortunately this didn't solve it.

#74390
Aug 27, 2013 11:09
Vote:
 

Ok, sorry for wrong solution.

Seems like actually that you are missing baseUri attribute. Try this:

<add name="resources" type="EPiServer.Community.Web.Administration.ResourceUriProvider, EPiServer.Community.Web.Administration" baseUri="http://{my-server-name}" />

    

#74393
Aug 27, 2013 11:22
Vote:
 

Did it! Thanks for the help!

How come this wasn't configured in the web config from when I isntalled community?

#74394
Aug 27, 2013 11:35
Vote:
 

Probably incorrectly applied transformations.

#74418
Aug 27, 2013 15:22
Vote:
 

Hi all,

I need to show the original image from Image gallery;

Maybe somebody knows - is there a way to get URL to the original image (or thumbnail image with original image width and height :))?

Thanx in advance

#88196
Edited, Jul 04, 2014 13:52
Vote:
 

I don't if I have same issue, but in our implemetation, the image uploaded by user is show randomly. On the page that display the images, some image display all the time, some images are not found. When I refresh the page, the images those are not found before now display correctly. Then if I refresh the page, those images are not found again.

Strange thing is same page, but on CMS server, images always display correctly. The issue only happen on web fronts which the configuration is the same in term of image gallery, VPP and so on.

- Will the baseUri help in this case? I ask this because it's make no different in development environment and stage because the images always shown

- How could you configure baseUri when you have multiple site install?

#120588
Edited, Apr 21, 2015 10:16
Vote:
 

It should fail without baseUri or at least behave unexpectedly. But you can give a try and see if that helps.

#120589
Apr 21, 2015 10:24
Vote:
 

Thanks Valdis,

What baseUri should I used if we have multiple site setup (3 sites with different url)? Should it the same as the default one?

I still dont know why it's works as expected all the time on all environment, but not the web fronts server :). How strange is it!

#120593
Apr 21, 2015 10:27
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.