Bug #50803

Fatal error: "enableFields on non-object" in extension manager

Added by Ernesto Baschny over 6 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2013-08-05
Due date:
% Done:

100%

TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Extbase extensions might fail with:

Fatal error: Call to a member function enableFields() on a non-object in .../typo3_src/typo3/sysext/core/Classes/Resource/StorageRepository.php on line 211

The problem was "uncovered" with the #45498 (the new EM fatals with this error since this patch), but could happen in other situations too.

Reason is that Extbase in certain situations will try to create a dummy simulated "TSFE" object to be able to use cObject stdWrap's in the backend context.

Now this is not a "complete TSFE" and doesn't for example include a proper sys_page property.

So to make sure we are in a proper FE context, we shouldn't rely on "is_object($TSFE)" but instead check if TYPO3_MODE==FE like it is done throughout other places in the core.


Related issues

Related to TYPO3 Core - Bug #50809: Failing test StorageRepositoryTest::getWhereClauseForEnabledFieldsCallsSysPageForDeletedFlagInFrontend Closed 2013-08-06

Associated revisions

Revision ba066157 (diff)
Added by Ernesto Baschny over 6 years ago

[BUGFIX] Fatal error: "enableFields on non-object" in extension manager

Don't rely on $TSFE object to detect if we are in a frontend context. Rely
on TYPO3_MODE constant instead.

Releases: 6.2, 6.1, 6.0
Resolves: #50803
Change-Id: I06ea2692dab7683c7284e5f3ff45036d72c64999
Reviewed-on: https://review.typo3.org/22830
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind

Revision b991af68 (diff)
Added by Ernesto Baschny over 6 years ago

[BUGFIX] Fatal error: "enableFields on non-object" in extension manager

Don't rely on $TSFE object to detect if we are in a frontend context. Rely
on TYPO3_MODE constant instead.

Releases: 6.2, 6.1, 6.0
Resolves: #50803
Change-Id: I06ea2692dab7683c7284e5f3ff45036d72c64999
Reviewed-on: https://review.typo3.org/22831
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

Revision 449dc72e (diff)
Added by Ernesto Baschny over 6 years ago

[BUGFIX] Fatal error: "enableFields on non-object" in extension manager

Don't rely on $TSFE object to detect if we are in a frontend context. Rely
on TYPO3_MODE constant instead.

Releases: 6.2, 6.1, 6.0
Resolves: #50803
Change-Id: I06ea2692dab7683c7284e5f3ff45036d72c64999
Reviewed-on: https://review.typo3.org/22832
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

History

#1 Updated by Gerrit Code Review over 6 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22830

#2 Updated by Gerrit Code Review over 6 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22830

#3 Updated by Gerrit Code Review over 6 years ago

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/22831

#4 Updated by Gerrit Code Review over 6 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/22832

#5 Updated by Ernesto Baschny over 6 years ago

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

#6 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF