Bug #53662

DatabaseConnection INSERTquery does not allow NULL values

Added by Alexander Stehlik over 1 year ago. Updated over 1 year ago.

Status:Resolved Start date:2013-11-15
Priority:Should have Due date:
Assigned To:- % Done:

100%

Category:DataHandler aka TCEmain Spent time: -
Target version:-
TYPO3 Version:6.2 Is Regression:No
PHP Version:5.4 Sprint Focus:
Complexity:no-brainer

Description

When you create a new record that has input fields with the new eval NULL setting the value is set correctly to NULL in the DataHandler but it is inserted as an empty string in the database.

The reason for this is, that the INSERTQuery() method in the DatabaseConnection class does not supply the $allowNull parameter to the fullQuoteArray() method. The UPDATEquery() method already does this so this can also be enabled for INSERTQuery().


Related issues

related to Core - Feature #41773: Add possibility to store NULL values Resolved 2012-10-09
related to Core - Bug #54917: Debug "Column 'first' cannot be null" Resolved 2014-01-12
related to Core - Bug #54849: Functional tests cannot write to backend log Resolved 2014-01-08
related to Core - Bug #55989: Debug "Column 'cookie' cannot be null" Resolved 2014-02-14
related to Core - Bug #54412: Improve default value handling for NULL value fields Resolved 2013-12-14
related to Core - Bug #63991: FAL override checkboxes are always active, when DBAL is i... Resolved 2014-12-19

Associated revisions

Revision 8207a2bb
Added by Alexander Stehlik over 1 year ago

[BUGFIX] Allow NULL values in INSERT queries

Currently only UPDATE queries pass the $allowNull parameter to the
fullQuoteStr() method in the DatabaseHandler. To make the behavior of
both methods consistent and to allow NULL values during creation of
new records by TCEmain the $allowNull parameter is also set to TRUE for
INSERT queries.

Resolves: #53662
Releases: 6.2, 6.1, 6.0
Change-Id: I066b9880a557b6c9058fc15f467631f1313300f9
Reviewed-on: https://review.typo3.org/25422
Reviewed-by: Philipp Gampe
Reviewed-by: Frans Saris
Tested-by: Frans Saris
Reviewed-by: Xavier Perseguers
Reviewed-by: Markus Klein
Tested-by: Markus Klein

Revision 81a30e8a
Added by Alexander Stehlik over 1 year ago

[BUGFIX] Allow NULL values in INSERT queries

Currently only UPDATE queries pass the $allowNull parameter to the
fullQuoteStr() method in the DatabaseHandler. To make the behavior of
both methods consistent and to allow NULL values during creation of
new records by TCEmain the $allowNull parameter is also set to TRUE for
INSERT queries.

Resolves: #53662
Releases: 6.2, 6.1, 6.0
Change-Id: I066b9880a557b6c9058fc15f467631f1313300f9
Reviewed-on: https://review.typo3.org/26638
Reviewed-by: Markus Klein
Tested-by: Markus Klein

Revision 2c40d1b1
Added by Alexander Stehlik over 1 year ago

[BUGFIX] Allow NULL values in INSERT queries

Currently only UPDATE queries pass the $allowNull parameter to the
fullQuoteStr() method in the DatabaseHandler. To make the behavior of
both methods consistent and to allow NULL values during creation of
new records by TCEmain the $allowNull parameter is also set to TRUE for
INSERT queries.

Resolves: #53662
Releases: 6.2, 6.1, 6.0
Change-Id: I066b9880a557b6c9058fc15f467631f1313300f9
Reviewed-on: https://review.typo3.org/26644
Reviewed-by: Markus Klein
Tested-by: Markus Klein

History

#1 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New 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/25422

#2 Updated by Markus Klein over 1 year ago

Indeed a forgotten thing.

#3 Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26638

#4 Updated by Steffen Ritter over 1 year ago

POST merge review done; OK

#5 Updated by Alexander Stehlik over 1 year ago

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

#6 Updated by Gerrit Code Review over 1 year ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-0 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26644

#7 Updated by Alexander Stehlik over 1 year ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF