Bug #82460

Exception in FE if admPanel is enabled and values are overridden

Added by Markus Klein 2 months ago. Updated about 1 month ago.

Status:
Under Review
Priority:
Should have
Assignee:
Category:
Frontend
Target version:
Start date:
2017-09-12
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

situation

Using this user TSconfig

admPanel {
  enable {
    preview = 1
  }
  override {
    preview = 1
    preview.showHiddenRecords = 1
  }
}

result

yields this error in FE

#1462820645: accessTimeStamp needs to be set to an integer value, but is empty! Maybe $GLOBALS[‘SIM_ACCESS_TIME’] has been overridden somewhere? 

expected

The expected behaviour would be to see hidden records and the red "preview" symbol at the top right.

solution

The frontend request handling initializes the admin panel, which evaluates the configuration.
Part of this evaluation is to set $GLOBALS[‘SIM_ACCESS_TIME’] to the value given as "simulate time" in the admin panel (or via configuration). This fails and hence the value gets zero, which leads to the seen exception.

The evaluation fails as it calls $simTime = $backendUser->adminPanel->extGetFeAdminValue('preview', 'simulateDate');.
As seen in the configuration above the value for "simluateDate" is not configured and the logic inside extGetFeAdminValue returns the value of 'preview' in this case, which hasn't been requested.

The fix is to make sure that this lookup on the first key ('preview') is never done if a subkey ('simulateDate') is requested.

Associated revisions

Revision 2a6690b9 (diff)
Added by Markus Klein 2 months ago

[BUGFIX] Fix exception in FE when using predefined admPanel config

Enforcing the admPanel for users via user TSconfig is working again
without crashing the FE.

We make sure that when the admPanel configuration is fetched, we
do not fall back to the toplevel value if the requested sub-value
does not exist.

Resolves: #82460
Releases: master, 8.7, 7.6
Change-Id: Ibd288805aa6c91d74eee8a9c80ebcce62d1f860f
Reviewed-on: https://review.typo3.org/54123
Tested-by: TYPO3com <>
Reviewed-by: Joerg Boesche <>
Reviewed-by: Stefan Neufeind <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>

Revision 10075697 (diff)
Added by Markus Klein about 2 months ago

[BUGFIX] Fix exception in FE when using predefined admPanel config

Enforcing the admPanel for users via user TSconfig is working again
without crashing the FE.

We make sure that when the admPanel configuration is fetched, we
do not fall back to the toplevel value if the requested sub-value
does not exist.

Resolves: #82460
Releases: master, 8.7, 7.6
Change-Id: Ibd288805aa6c91d74eee8a9c80ebcce62d1f860f
Reviewed-on: https://review.typo3.org/54112
Tested-by: TYPO3com <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

History

#1 Updated by Gerrit Code Review 2 months ago

  • Status changed from Accepted to Under Review

Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54112

#2 Updated by Gerrit Code Review 2 months ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54123

#3 Updated by Markus Klein 2 months ago

  • Description updated (diff)

#4 Updated by Alex Kellner 2 months ago

The same here in TYPO3 8.7.6

Quick workarround - add a simulateDate:

admPanel.override.preview.simulateDate = 123456798

Or dynamically via ext_localconf.php:

$setSimulateDateString = 'admPanel.override.preview.simulateDate = ' . time();
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig($setSimulateDateString);

#5 Updated by Markus Klein 2 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#6 Updated by Gerrit Code Review about 2 months ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54198

#7 Updated by Markus Klein about 2 months ago

  • Status changed from Under Review to Resolved

#8 Updated by Gerrit Code Review about 1 month ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54198

Also available in: Atom PDF