[Bug]: TabSettings not Updated when Tab Versioning is enabled
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
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
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?
- Got to a Page and check that the versioning is enabled
- Update the Allow Indexing in the Pages Settings
- Save the changes
- Refresh the page
- 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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dnnsoftware/Dnn.Platform
-
[Bug]: Edit Bar buttons are not localizedPossibly taken @idumlupinar claimed this 1 day ago. OpenStatus: New
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dnnsoftware/Dnn.Platform#7565 ·
Maintainers usually reply within 1 day
-
Status: New
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dnnsoftware/Dnn.Platform#7543 · 3 comments ·
Maintainers usually reply within 1 day
-
Status: New
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
dnnsoftware/Dnn.Platform#6681 ·
Maintainers usually reply within 1 day
-
Status: New
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dnnsoftware/Dnn.Platform#6051 · 4 comments ·
Maintainers usually reply within 1 day
-
Status: New
Difficulty 3/5 1-2 days Newbie friendliness 45/100
dnnsoftware/Dnn.Platform#7555 ·
Maintainers usually reply within 1 day
All issues in dnnsoftware/Dnn.Platform
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Sector-Vestige/Sector-Vestige#476 ·
Maintainers usually reply within 1 day
-
S: Untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Trauma-Station/Trauma-Station#5058 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
HoffmanEngineering/3d-print-log-api#243 ·
Maintainers usually reply within 1 day
-
:books: documentation untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day