Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug]: TabSettings not Updated when Tab Versioning is enabled

Open
#7,010 7 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
backend

Research direction

Start by reading PageControllerImpl.UpdateTab and TabController.UpdateTabSettingInternal, the two methods named in the report. Trace how page settings, workflow updates, and tab-setting cache clearing interact, then check for existing tests covering versioned tabs and tab-setting updates. Done means Allow Indexing and Caching changes persist after refresh when tab versioning is enabled, and setting updates compare the stored value rather than the setting name.

Written by the indexing model from the issue text.

Description

Status: New
Is there an existing issue for this?
  • I have searched the existing issues
What happened?

If the Versioning is enabled for a Tab then the TabSettngs for the AllowIndex and Caching are not updated as expected.

Steps to reproduce?
  1. Got to a Page and check that the versioning is enabled
  2. Update the Allow Indexing in the Pages Settings
  3. Save the changes
  4. Refresh the page
  5. The Allow Indexing reverts to the previous value
Current Behavior

As mentioned above the TabSettings are not updating as expected. I have rebuilt the 10.2.2 source and deployed locally. When debugging I saw that the tab with the updated TabSettings was reset when executing UpdateTabWorkflowFromPageSettings in this code (from PageControllerImpl):

        public int UpdateTab(TabInfo tab, PageSettings pageSettings)
        {
            this.UpdateTabInfoFromPageSettings(tab, pageSettings);

            this.UpdateTabWorkflowFromPageSettings(tab, pageSettings);

            this.SavePagePermissions(tab, pageSettings.Permissions);

            this.tabController.UpdateTab(tab);

            this.CreateOrUpdateContentItem(tab);

            this.SaveTabUrl(tab, pageSettings);

            this.MovePageIfNeeded(pageSettings, tab);

            return tab.TabID;
        }

Looking deeper in the code the cached Tab is cleared when calling TabController.Instance.UpdateTabSetting.
This in effect reverses the changes back to the original settings when calling this.tabController.UpdateTab.

Expected Behavior

I believe that the ordering of the calls should be changed in UpdateTab. Ie:

    this.UpdateTabWorkflowFromPageSettings(tab, pageSettings);
    this.UpdateTabInfoFromPageSettings(tab, pageSettings);

This will allow the the workfow to be set as expected and then the tab and settings set from the PageSettings. On testing this on my source build this expected outcome was reached.
Furthermore there is another bug in the method TabController.UpdateTabSettingInternal :

 private void UpdateTabSettingInternal(int tabId, string settingName, string settingValue, bool clearCache)
 {
     using (var dr = this.dataProvider.GetTabSetting(tabId, settingName))
     {
         if (dr.Read())
         {
             if (dr.GetString(0) != settingValue)
             {
                 this.dataProvider.UpdateTabSetting(
                     tabId,
                     settingName,
                     settingValue,
                     UserController.Instance.GetCurrentUserInfo().UserID);
                 this.eventLogger.AddSettingLog(
                     EventLogType.TAB_SETTING_UPDATED,
                     "TabId",
                     tabId,
                     settingName,
                     settingValue,
                     UserController.Instance.GetCurrentUserInfo().UserID);
             }
         }
         else
         {
             this.dataProvider.UpdateTabSetting(
                 tabId,
                 settingName,
                 settingValue,
                 UserController.Instance.GetCurrentUserInfo().UserID);
             this.eventLogger.AddSettingLog(
                 EventLogType.TAB_SETTING_CREATED,
                 "TabId",
                 tabId,
                 settingName,
                 settingValue,
                 UserController.Instance.GetCurrentUserInfo().UserID);
         }

         dr.Close();
     }

     UpdateTabVersion(tabId);
     if (clearCache)
     {
         this.ClearTabSettingsCache(tabId);
     }
 }

This check dr.GetString(0) != settingValue is incorrect as the zeroth item is the SettingName and not value. It should use dr.GetString(1) != settingValue.

Relevant log output

Anything else?

No response

Affected Versions

10.2.2 (latest v10 release)

What browsers are you seeing the problem on?

No response

Code of Conduct
  • I agree to follow this project's Code of Conduct
Dominant language
C#
Stars
1.1k
Forks
791
Avg merge
2d 2h
Merged PRs (30d)
24

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dnnsoftware/Dnn.Platform

All issues in dnnsoftware/Dnn.Platform

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.