ExtensionSettings.IsScalar not working ?

Feb 22, 2010 at 10:50 AM

I've made an extension to update my Twitter feed whenever I make a new post and, with a bit of tweaking of Add_Page.aspx.cs, it's working beautifully.

However, the settings page on the Extensions tab of the admin pages shows my settings as a table of options, instead of just one set of options.  I have included the IsScalar bool in my settings configuration code, but it seems to be being ignored.  Also, there is no xml settings file saved for this extension in App_Data\datastore\extensions.

Here is the code:

static protected ExtensionSettings _settings = null;
private static Post _post;

public TwitterUpdater()
	Post.Saved += new EventHandler<SavedEventArgs>(UpdateTwitter);

	ExtensionSettings settings = new ExtensionSettings("TwitterUpdater");

	settings.Help = "Updates the given Twitter feed when a post is saved.";
	settings.AddParameter("user", "Username", 255, true);
	settings.AddParameter("pass", "Password", 255, true);

	settings.IsScalar = true;

	_settings = ExtensionManager.GetSettings("TwitterUpdater");

Feb 27, 2010 at 6:12 AM

Sorted now - turns out that BE is not 'refreshing' the database entry for the settings.  I have to manually delete the settings row from the table and then re-load it by refreshing the Extensions page for any changes to take effect.

Feb 27, 2010 at 7:18 AM

CJ: I also found that incrementing the version # of the extension (its located right about the class definition) will also refresh the settings.

Feb 27, 2010 at 12:56 PM

That is worth noting - thanks for the tip!