Bug #75805
closedCall to a member function writelog() on a non-object
0%
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.
Updated by Benni Mack over 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?
Updated by Benni Mack over 8 years ago
- Status changed from New to Needs Feedback
Updated by Franz Holzinger over 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.
Updated by Wouter Wolters over 8 years ago
If I'm correct DataHandler is not meant for frontend.
See also this ticket: https://forge.typo3.org/issues/52015
Updated by Wouter Wolters over 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.