Feature Settings are not getting inserted

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
3/1/2011 2:12:30 AM
Gravatar
Total Posts 6

Feature Settings are not getting inserted

Hello,

I don't know if this is a bug or a misunderstanding of my side but when I create a new feature, the settings are never getting inserted in the DB.

Here are the steps I'm following :

Creation of the new feature

  • I add a new folder at the root of the web site, let's call this folder "DnhEventArchive"
  • Add a new user control in this folder : EventArchive.ascx. This control contains no code, inherits from SiteModuleControl and have a basic ASCX definition:

<mp:CornerRounderTop id="ctop1" runat="server" />
<asp:Panel ID="pnlWrapper" runat="server" CssClass="panelwrapper linksmodule">
   <dnh:Title runat="server" id="Title1" />
   <asp:Panel ID="pnlMyClass" runat="server" EnableViewState="false" CssClass="modulecontent">

   </asp:Panel>
   <div class="modulefooter"></div>
</asp:Panel>
<mp:CornerRounderBottom id="cbottom1" runat="server" />

Creation of the resource file

  • In the App_GlobalResources folder, I add a new resource file, called DnhEventArchive.resx
  • In this resource, I add an entry with the feature name, and I define the text for my different settings

Creation of the setup folder

  • In the setup/applications folder, I add a new folder : "dnh-event-archive"
  • I add the "FeatureDefinitions" folder and the config file "EventArchiveModule.config"
  • In this file, I include my feature definition and one setting :

<?xml version="1.0" encoding="utf-8" ?>
<featureDefinitions>
<featureDefinition
       featureGuid="3a7bbe78-1f1e-490c-a4e1-369683de4076"
       supportedDatabases="MSSQL"
       resourceFile="DnhEventArchive"
       featureNameReasourceKey="DnhEventArchiveFeatureName"
       controlSource="DnhEventArchive/EventArchive.ascx"
       sortOrder="1000"
       isCacheable="true"
       defaultCacheTime="0"
       excludeFromFeatureList="false"
      icon="blank.gif"
  >
</featureDefinition>

   <featureSetting
       resourceFile="DnhEventArchive"
       resourceKey="EventModuleID"
       defaultValue="0"
       controlType="ISettingControl"
       regexValidationExpression=""
       controlSrc="~/DnhEventManager/Settings/ModuleSelection.ascx"
       helpKey=""
       sortOrder="100"
   />

</featureDefinitions>

Note that I have the same problem if I use a classic TextBox instead of my custom control.

Installation of the feature

  • I launch my website on the Setup/Default.aspx page
  • The installation is correct and my feature seem to be correctly configured.

Here are the problems I encouter :

  • If I check in the mp_ModuleDefinitionSettings table, no setting definition has been registered for my feature.
  • And of course if I add a new module on a page, I can access its settings but I cannot find my custom setting.

My Workaround

  • For now, I insert my settings definition manually in the DB and my feature works like a charm.
  • But of course If I include this script in the install / update script of the settings, it will work for a feature update, but not for a feature installation. Indeed the scripts are launched before the feature registration, and so as my script tries to use the moduledefinitionId, it will work only after the second execution. (at first execution no moduleDefId would be found).

Configuration info:

I'm running MojoPortal v2.3.4.5, localized in French, with SQL server Express behind.

What is also interesting is that I didn't got any error when I installed my instance of Mojoportal (all the settings where correctly inserted). Could be a problem due to localization ?

 

 

Do you have any idea of what is happening ? Do I miss any step ?

I double checked this morning with the videos, and it seem to be exactly what I do.

Many thanks,

Pierre-Emmanuel

3/3/2011 1:11:57 PM
Gravatar
Total Posts 6

Re: Feature Settings are not getting inserted

Ok... I just understood my problem.

I have defined my feature settings outside of my "featuredefinition" tag.

It must be a child node of "feature definition".

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