Commit 609e0a36 authored by Thomas Hohn's avatar Thomas Hohn Committed by Frans Saris
Browse files

[FEATURE] Option to disable validation of stored records

Adds two new configuration options to Install Tool which are used when
saving records using the DataHandler:

* disable the validation of records after saving them
* if validating, make a strict value comparison ('' !== 0) instead of
  the default loose comparison ('' == 0)

Fixes: #79438
Releases: master
Change-Id: I01dfae57b046db00a531dfdfc386e43fe32329e4
Reviewed-on: https://review.typo3.org/51405


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Claus Due's avatarClaus Due <claus@phpmind.net>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Frans Saris's avatarFrans Saris <franssaris@gmail.com>
Tested-by: Frans Saris's avatarFrans Saris <franssaris@gmail.com>
parent 30085820
......@@ -707,6 +707,8 @@ class DataHandler
*/
public function __construct()
{
$this->checkStoredRecords = (bool)$GLOBALS['TYPO3_CONF_VARS']['BE']['checkStoredRecords'];
$this->checkStoredRecords_loose = (bool)$GLOBALS['TYPO3_CONF_VARS']['BE']['checkStoredRecordsLoose'];
$this->runtimeCache = $this->getRuntimeCache();
}
......
......@@ -784,6 +784,8 @@ return [
'disable_exec_function' => false, // Boolean: Don't use exec() function (except for ImageMagick which is disabled by <a href="#GFX-im">[GFX][im]</a>=0). If set, all fileoperations are done by the default PHP-functions. This is necessary under Windows! On Unix the system commands by exec() can be used, unless this is disabled.
'compressionLevel' => 0, // Determines output compression of BE output. Makes output smaller but slows down the page generation depending on the compression level. Requires a) zlib in your PHP installation and b) special rewrite rules for .css.gzip and .js.gzip (please see _.htacces for an example). Range 1-9, where 1 is least compression and 9 is greatest compression. 'true' as value will set the compression based on the PHP default settings (usually 5). Suggested and most optimal value is 5.
'installToolPassword' => '', // String: This is the md5-hashed, salted password for the Install Tool. Set this to '' and access will be totally denied. You may consider to externally protect the typo3/sysext/install/ folder, eg. with a .htaccess file.
'checkStoredRecords' => true, // Boolean: If set, values of the record are validated after saving in DataHandler. Disable only if using a database in strict mode.
'checkStoredRecordsLoose' => true, // Boolean: If set, make a loose comparison ('' equals 0) when validating record values after saving in DataHandler.
'pageTree' => [
'preloadLimit' => 50
],
......
.. include:: ../../Includes.txt
==================================================================================
Feature: #79438 - Add configuration option to disable validation of stored records
==================================================================================
See :issue:`79438`
Description
===========
Two configuration options have been added to the Install Tool, which are used when saving records
using the DataHandler.
The first option allows to disable the check if the contents of a record match the data that should
have been written after saving it to the database for the whole TYPO3 installation. This allows a
speed-up especially when inserting/copying large amounts of data at the cost of possible differences,
if values could not be written as requested. This may happen, if e.g. data types do not match or
columns are too small to store the data.
Disable checking the stored records:
.. code-block:: php
$GLOBALS['TYPO3_CONF_VARS']['BE']['checkStoredRecords'] = false;
If checking the stored records is enabled, the second option allows to make the comparison of the
record contents strict. If a loose comparison is made (which is the default), comparing an empty
string '' with the number 0 is not considered as an error ('' == 0), while using strict comparison
it is ('' !== 0).
Make the comparison of record contents strict:
.. code-block:: php
$GLOBALS['TYPO3_CONF_VARS']['BE']['checkStoredRecordsLoose'] = false;
Impact
======
In TYPO3 installations where the administrator has configured the database to run in strict-mode
disabling the validation of stored records can speed-up inserts and updates by a factor 2. With
strict-mode enabled the record will not be saved at all, if there are errors.
If the validation of stored records is disabled, the entry in the protocol (sys_log) does not
contain the record title (it is displayed as "[No title]" instead) - however table and uid are still
provided and can be used for finding the record.
Affected Installations
======================
None as default.
.. index:: Database, Backend
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment