Issue Bug Closed

#17278Override values for preview in admpanel TSconfig not always respected

Lucas Thurston 05/04/07, 20:56 updated 09/06/13, 09:11

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)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.