Bug #55989

Debug "Column 'cookie' cannot be null"

Added by Thomas Skierlo over 1 year ago. Updated over 1 year ago.

Status:Resolved Start date:2014-02-14
Priority:Should have Due date:
Assigned To:- % Done:

100%

Category:Indexed Search Spent time: -
Target version:-
TYPO3 Version:6.2 Is Regression:Yes
PHP Version:5.3 Sprint Focus:
Complexity:easy

Description

Function writeSearchStat of SearchFormController.php triggers a debug message in FE, because $this->fe_user->id resolves to NULL and cookie is a non-null column.
(possibly the same will happen in SearchController.php)

$insertFields = array(
                        'searchstring' => $this->piVars['sword'],
                        'searchoptions' => serialize(array($this->piVars, $sWArr, $pt)),
                        'feuser_id' => (int)$this->fe_user->user['uid'],
                        // fe_user id, integer
                        'cookie' => $this->fe_user->id,
                        // cookie as set or retrieve. If people has cookies disabled this will vary all the time...
                        'IP' => GeneralUtility::getIndpEnv('REMOTE_ADDR'),
                        // Remote IP address
                        'hits' => (int)$count,
                        // Number of hits on the search.
                        'tstamp' => $GLOBALS['EXEC_TIME']
                );

This seems to have started after 6.2.0beta3


Related issues

related to Core - Bug #53662: DatabaseConnection INSERTquery does not allow NULL values Resolved 2013-11-15

Associated revisions

Revision 34fcdead
Added by Georg Ringer over 1 year ago

[BUGFIX] Typecast cookie value to string

The cookie might be null, therefore the INSERTquery fails in
indexed_search.

As a solution, use a type cast to string.

Change-Id: If9e650ee713c75420859813546d138000b3023ff
Resolves: #55989
Releases: 6.2
Reviewed-on: https://review.typo3.org/28281
Reviewed-by: Christian Kuhn
Reviewed-by: Tymoteusz Motylewski
Tested-by: Tymoteusz Motylewski
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer

History

#1 Updated by Markus Klein over 1 year ago

  • Status changed from New to Accepted

This is due to the patch that allowed to insert NULL values into DB.

From time to time some place popup where the insert was not constructed properly, like here.

Can you push a patch?

#2 Updated by Markus Klein over 1 year ago

  • Complexity set to easy
  • Is Regression changed from No to Yes

Target versions are all 6.x

#3 Updated by Gerrit Code Review over 1 year ago

  • Status changed from Accepted to Under Review

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/28281

#4 Updated by Georg Ringer over 1 year ago

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

Also available in: Atom PDF