Sometimes the feature setting value is duplicated

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.
4/3/2011 12:37:01 PM
Gravatar
Total Posts 251

Sometimes the feature setting value is duplicated

I have something very strange happening in my custom feature.

I have this in my module config for the setup:

<featureSetting
     resourceFile="rediResources"
  resourceKey="Voce1"
  defaultValue=""
  controlType="TextBox"
        controlSrc=""
        helpKey=""
        sortOrder="100"
     regexValidationExpression=""
    />
<featureSetting
  resourceFile="rediResources"
  resourceKey="Voce2"
  defaultValue=""
  controlType="TextBox"
        controlSrc=""
        helpKey=""
        sortOrder="1000"
  regexValidationExpression=""
/>
<featureSetting
  resourceFile="rediResources"
  resourceKey="Voce3"
  defaultValue=""
  controlType="TextBox"
        controlSrc=""
        helpKey=""
        sortOrder="1000"
  regexValidationExpression=""
/>

Now, if i go to the module setting page, (http://localhost:60941/Admin/ModuleSettings.aspx?mid=8&pageid=7) , i get two "Voce1" items

But, if i go to the module definition setting page, (http://localhost:60941/Admin/ModuleDefinitionSettings.aspx?defid=37), i can only see one "Voce1" item.

If i rename it to "Voce1b", then on the module setting page it won't duplicate. But, renaming it again to Voce1, will make it duplicate it again.

What I'm doing wrong?

4/4/2011 9:51:14 AM
Gravatar
Total Posts 18439

Re: Sometimes the feature setting value is duplicated

The thing to understand is if you rename a setting (resourceKey) it does not update the existing setting it is the same as creating a new setting. Once you rename it in the config file there is nothing there to tie it to the previously created setting. So if you rename a setting (or remove one) in your custom feature you should implement an upgrade script to delete the old one from mp_ModuleSettings and mp_ModuleDefinitionSettings making sure to use your featureGuid in the where clause so that no settings with the same name from other features get deleted.

Hope it helps,

Joe

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