Bug #17278
closedOverride values for preview in admpanel TSconfig not always respected
0%
Description
Take a look here:
admPanel = 1
admPanel {
enable.edit = 1
override.edit.displayFieldIcons = 1
enable.preview = 1
preview = 1
override {
preview = 1
preview {
showHiddenPages = 1
showHiddenRecords = 1
simulateUserGroup = 0
}
}
hide = 1
}
The specific issue that was occurring with this TSconfig setup was that I didn't want to simulate a usergroup when logged into the backend, because this makes TYPO3 behave like a user is logged in. Setting simulateUserGroup to 0 didn't help. Looking at class.t3lib_tsfebeuserauth.php I found out why:
801: // override all settings with user TSconfig
802: if ($this->extAdminConfig['override.'][$pre.'.'][$val] && $val) {
803: return $this->extAdminConfig['override.'][$pre.'.'][$val];
804: }
The first half of this if is checking if the value a given property (such as simulateUserGroup) is set to evaluates to TRUE. Since I've set the value to 0, the if evaluates to false, and a couple lines down, the function returns TRUE because "preview" is set to 1. Any override properties within "preview" will always evaluate to TRUE if preview is set to 1 as far as I can tell. This may happen in other override properties as well, I haven't looked into it to fully.
The change I made looks like this:
802: if (isset($this->extAdminConfig['override.'][$pre.'.'][$val]) && $val) {
Yay! Now a 0 value can be returned if that's what the property value is set to.
Diff attached. Hope this helps!
(issue imported from #M5566)
Files