Bug #104494
closed"Delete similar errors" for BeLog fails when detail_nr is 11/12 and serialized data with placeholders is used
100%
Description
Given a sys_log entry like this:
INSERT INTO `sys_log` (`uid`, `tstamp`, `userid`, `action`, `recuid`, `tablename`, `recpid`, `error`, `details`, `type`, `details_nr`, `IP`, `log_data`, `event_pid`, `workspace`, `NEWid`, `request_id`, `time_micro`, `component`, `level`, `message`, `data`, `channel`) VALUES (16666, 1722152496, 1, 2, 3, 'pages', 0, 2, 'SQL error: \"{reason}\" ({table}:{uid})', 1, 12, '172.18.0.5', '{\"reason\":\"Out of range value for column \'starttime\' at row 1\",\"table\":\"pages\",\"uid\":1030}', -1, 0, '', '', 0, '', 'info', NULL, NULL, 'content');
we have these special keys:
details_nr: 12 details: SQL error: "{reason}" ({table}:{uid}) log_data: {"reason":"Out of range value for column 'starttime' at row 1","table":"pages","uid":1030}
When using the button "delete similar errors" from BeLog an error is thrown with information about an "array to string" cast.
This is because the where
constraint is filled like this:
if (in_array($logEntry->getDetailsNumber(), [11, 12], true)) { $constraints[] = $queryBuilder->expr()->eq('log_data', $queryBuilder->createNamedParameter($logEntry->getLogData())); }
and then getLogData
unserializes the data of log_data
and fills that into the SQL query. Since it is an array bound to the named parameter for "log_data" this will fail.
As far as I can see, this special case for details 11,12 has always failed when "log_data" was filled with serialized data.
The bugfix for this is to not do all the unserializing magic, because the querybuilder should just use a query condition with the raw data.
Updated by Gerrit Code Review 4 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85402
Updated by Gerrit Code Review 4 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/85414
Updated by Garvin Hicking 4 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset debdcc7c66af7c9d8b0e6aa9e2ffe0faa3698bdb.