Cloning the Forums Feature

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
9/14/2011 11:04:22 AM
Gravatar
Total Posts 42

Cloning the Forums Feature

Hi All,

Please I tried cloning the mojoPortal forums, and followed the steps in the documentation.

Cloning the blog feature was successful, and worked.

But for the forum, it was also successful, the script ran, and DB tables were created.

But when I add it to a page, nothing shows.

Please has anybody had this challenge before. What could be wrong?

9/14/2011 11:11:38 AM
Gravatar
Total Posts 18439

Re: Cloning the Forums Feature

If it fails to load the control it should log something in the log to give you a clue of the error.

Note that you must use a new featureGuid, new tables and stored procedures with different prefix, different .resx files, etc, nothing at all from the original feature should be used in the clone.

You will need to do a lot of find and replace in the feature code to change the namespaces and resource file references both in the .ascx, .aspx files and in the code behind files.

Hope that helps,

Joe

9/14/2011 11:22:44 AM
Gravatar
Total Posts 42

Re: Cloning the Forums Feature

Hi Joe,

Have done all that.

Followed the documentation to the letter.

Please see below log ( problem seems to be with ForumDisplaySettings)


2011-09-14 17:10:28,600 ERROR 10.101.5.202 - en-US - /home.aspx - mojoPortal.Web.UI.CmsPage - failed to load control CampusForums/ForumModule.ascx
System.Web.HttpParseException (0x80004005): Unknown server tag 'forum:ForumDisplaySettings'. ---> System.Web.HttpParseException (0x80004005): Unknown server tag 'forum:ForumDisplaySettings'. ---> System.Web.HttpException (0x80004005): Unknown server tag 'forum:ForumDisplaySettings'.
   at System.Web.UI.TagPrefixTagNameToTypeMapper.System.Web.UI.ITagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs)
   at System.Web.UI.MainTagNameToTypeMapper.GetControlType2(String tagName, IDictionary attribs, Boolean fAllowHtmlTags)
   at System.Web.UI.MainTagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs, Boolean fAllowHtmlTags)
   at System.Web.UI.RootBuilder.GetChildControlType(String tagName, IDictionary attribs)
   at System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty)
   at System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText)
   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ProcessException(Exception ex)
   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ProcessException(Exception ex)
   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)
   at System.Web.UI.TemplateParser.ParseInternal()
   at System.Web.UI.TemplateParser.Parse()
   at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
   at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
   at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
   at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
   at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath)
   at System.Web.UI.TemplateControl.LoadControl(String virtualPath)
   at mojoPortal.Web.UI.CmsPage.LoadPage() in C:\Code\Campus\Web\Default.aspx.cs:line 251

 

9/14/2011 11:32:12 AM
Gravatar
Total Posts 42

Re: Cloning the Forums Feature

Please what could be the problem with the ForumDisplaySettings control.

I'm quite clueless about it.

Hav spent several hours trying to clone.

9/14/2011 11:39:25 AM
Gravatar
Total Posts 18439

Re: Cloning the Forums Feature

Its a control implemented in the Forums at Forums/Controls/ForumDisplaySettings.cs

you would need to change the namespace in your version and also change the control declaration to your own namespace everywhere it is referenced. You'll need to look in all the .ascx and .aspx files for it. The one in the ForumModule.ascx has the tag prefix declared at the top like this:

<%@ Register Namespace="mojoPortal.Web.ForumUI" Assembly="mojoPortal.Features.UI" TagPrefix="forum" %>

then the control is declared like this:

<forum:ForumDisplaySettings ID="displaySettings" runat="server" />

the main purpose of this control is to provide a set of properties that can be configured from the theme.skin file to control various aspects of the rendering, ie it was implemented as part of mobile support so that the forums could render differently in mobile devices as specified in the theme.skin file of a mobile skin. The ForumDisplaySettings control itlelf does not render anything but other controls check its properties for configurations that control their rendering.

You'll need to look around and everywhere it is used you need to declare the tag prefix with your namespace and assembly name. You should also use a different tag prefix otherwise it may clash with existing declarations for the forums.

Hope that helps,

Joe

 

 

9/14/2011 11:44:36 AM
Gravatar
Total Posts 42

Re: Cloning the Forums Feature

Thanks Joe.

I appreciate the extremely swift response.

But, I have changed everything before even posting in this forum at all.

I have already done this for the blog feature, and followed the same steps successfully.

Your comments helped. Thanks.

Will continue to look.

9/14/2011 11:52:49 AM
Gravatar
Total Posts 42

Re: Cloning the Forums Feature

Oops!

Found the issue.

This line below still had mojoPortal.Features.UI.

<%@ Register Namespace="mojoPortal.Web.ForumUI" Assembly="mojoPortal.Features.UI" TagPrefix="forum" %>

I did a ReplaceAll to my own assembly, and it just works perfectly.

Sorry for the trouble.

Thanks all the same.

Maybe when I'm done, I'd consider contributing the extension, If it's standard enough.

9/14/2011 12:05:35 PM
Gravatar
Total Posts 42

Re: Cloning the Forums Feature

Got this error After creating a Forum, upon attempt to access it.

Sorry, you are not allowed to view this content. If you have questions about your permissions, please contact a site administrator.

Either you are not currently logged in, or you do not have access to this page within the site. Please contact the site administrator to obtain access.

 

I was logged in as administrator.

Even created a new user without admin rights, but still got the same error.

Please any ideas?

Thanks in advance.

9/14/2011 12:11:58 PM
Gravatar
Total Posts 18439

Re: Cloning the Forums Feature

Look in your cloned copy of Forum.cs in the business layer, change the featureGuid string constant there to match your new featureGuid

Hope that helps,

Joe

9/14/2011 12:39:51 PM
Gravatar
Total Posts 42

Re: Cloning the Forums Feature

Perfect.

Thank you Joe.

I truly appreciate this. It works fine now.

Would have loved to pop some champaigne over this, but I'm in Nigeria, and paypal does not have options for Nigeria, and Google checkout is disabled.

But please accept my appreciation.

 

 

9/15/2011 6:20:58 AM
Gravatar
Total Posts 42

Re: Cloning the Forums Feature

Hi Joe,

Saw this in the roadmap for the Forums feature.

    Sticky threads - completed
    option for pre-moderation of posts before they are visible
    ability to mark posts as questions and vote posts as answers

1. Please what are "Sticky threads", and what are they used for?

2. I actually intend to try and extend the forum such that one will be able to add comments to Questions/Responses, and also vote on questions. recall that I've asked about this before... in this post

Any advice on the best way to implement this will be appreciated.

3. In the code, I discovered that "mp_" is hard-coded, so the custom forum I cloned is creating entries in the original mp_ tables, even though I changed this in the install script. Do I have to replace all these in the code also? If yes, I'd suggest that the documentation be updated a little to include this, cos it just said to do the replace in the install scripts.

Thanks.

You must sign in to post in the forums. This thread is closed to new posts.