Bug #17278

Override values for preview in admpanel TSconfig not always respected

Added by Lucas Thurston about 6 years ago. Updated about 1 month ago.

Status:Needs Feedback Start date:2007-05-04
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
TYPO3 Version:4.1 Complexity:
PHP Version:4.3
Votes: 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)

t3lib_tsfebeuserauth_patch.diff (391 Bytes) Administrator Admin, 2007-05-04 20:56


Related issues

related to Core - Bug #16825: AdminPanel Preview does not work correctly: selecting one... Needs Feedback 2007-01-02

History

Updated by Lucas Thurston about 6 years ago

Related to bug #16825.

Updated by Alexander Opitz about 1 month ago

  • Status changed from New to Needs Feedback
  • Target version deleted (0)

The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?

Also available in: Atom PDF