Project

General

Profile

Actions

Bug #75805

closed

Call to a member function writelog() on a non-object

Added by Franz Holzinger about 8 years ago. Updated almost 8 years ago.

Status:
Rejected
Priority:
Could have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2016-04-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The TYPO3 frontend causes an error message:

Fatal error: Call to a member function writelog() on a non-object in /server-path/typo3_src-6.2.17/typo3/sysext/core/Classes/DataHandling/DataHandler.php on line 7520

The object $this->BE_USER is not set.

public function log($table, $recuid, $action, $recpid, $error, $details, $details_nr = -1, $data = array(), $event_pid = -1, $NEWid = '') {
...

return $this->BE_USER->writelog($type, $action, $error, $details_nr, $details, $data, $table, $recuid, $recpid, $event_pid, $NEWid);

This happens occasionally. I will try to figure out the reason from where this is called.

Actions #1

Updated by Benni Mack about 8 years ago

Hey Franz,

interesting. I wonder when DataHandler is called in your installation, could you check your frontend plugins please if they use DataHandler?

Actions #2

Updated by Benni Mack about 8 years ago

  • Status changed from New to Needs Feedback
Actions #3

Updated by Franz Holzinger about 8 years ago

The log function is called from the function process_datamap of class DataHandler. This is called if you want to log an error with the TCE instance in the Frontend.

/** @var \TYPO3\CMS\Core\DataHandling\DataHandler $tce */
$tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\DataHandling\DataHandler'); // create TCE instance
$tce->start($data, array());
$tce->process_datamap();

if ($tce->errorLog) {
    $content = 'TCE->errorLog:' . t3lib_utility_Debug::viewArray($tce->errorLog);
    debug ($content, 'createMM $content Pos 1');
}

There is not BE_USER object in the Frontend.

Actions #4

Updated by Wouter Wolters about 8 years ago

If I'm correct DataHandler is not meant for frontend.
See also this ticket: https://forge.typo3.org/issues/52015

Actions #5

Updated by Wouter Wolters almost 8 years ago

  • Status changed from Needs Feedback to Rejected

DataHandler is not meant to be used in the frontend. This code is tightly coupled to a backend user.
I'm therefor rejecting this ticket.

Actions

Also available in: Atom PDF