Bug #82304

ConfigurationManager::writeLocalConfiguration breaks log writer configuration

Added by Thorsten Kahler over 1 year ago. Updated 6 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
System/Bootstrap/Configuration
Start date:
2017-09-05
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Method \TYPO3\CMS\Core\Configuration\ConfigurationManager::writeLocalConfiguration() cleans up $TYPO3_CONF_VARS before writing to typo3conf/LocalConfiguration.php. It uses the cleanup method ArrayUtility::renumberKeysToAvoidLeapsIfKeysAreAllNumeric() which rewrites the indices of numerically indexed arrays.

This cleanup breaks $TYPO3_CONF_VARS['LOG']['writerConfiguration'] because the configuration uses log level constants which represent integers (see class \TYPO3\CMS\Core\Log\LogLevel) as indices.

Either exceptions for those cleanups must be configurable or (better) this optimization attempt should be dropped at all.


Related issues

Related to TYPO3 Core - Bug #44938: LocalConfiguration extListArray adds keys if extension is uninstalled Closed 2013-01-29

Associated revisions

Revision fd28147d (diff)
Added by Helmut Hummel about 1 year ago

[BUGFIX] Avoid renumbering array keys on writing configuration

Renumbering array keys, even if all keys are integer
is a destructive operation.
Doing so at least breaks our logging configuration,
which uses LogLevel constants as array keys and these constants
are defined as integer.

Therefore this pure visual optimization is removed
when writing LocalConfiguration.php

At a later point we might consider deprecating this
method, which at least has a wrong method name
(mentions "numeric", while it meanwhile uses "int" checks).
As this method performs a destructive operation,
its usefulness is limited.

Resolves: #82304
Releases: master, 8.7, 7.6
Change-Id: I8d252428f3e27379e4377d30af0fdfd5e5d8719d
Reviewed-on: https://review.typo3.org/55936
Tested-by: TYPO3com <>
Reviewed-by: Mathias Schreiber <>
Tested-by: Mathias Schreiber <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

Revision b6fde00a (diff)
Added by Helmut Hummel about 1 year ago

[BUGFIX] Avoid renumbering array keys on writing configuration

Renumbering array keys, even if all keys are integer
is a destructive operation.
Doing so at least breaks our logging configuration,
which uses LogLevel constants as array keys and these constants
are defined as integer.

Therefore this pure visual optimization is removed
when writing LocalConfiguration.php

At a later point we might consider deprecating this
method, which at least has a wrong method name
(mentions "numeric", while it meanwhile uses "int" checks).
As this method performs a destructive operation,
its usefulness is limited.

Resolves: #82304
Releases: master, 8.7, 7.6
Change-Id: I8d252428f3e27379e4377d30af0fdfd5e5d8719d
Reviewed-on: https://review.typo3.org/55943
Tested-by: TYPO3com <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

Revision 0ffc91c4 (diff)
Added by Helmut Hummel about 1 year ago

[BUGFIX] Avoid renumbering array keys on writing configuration

Renumbering array keys, even if all keys are integer
is a destructive operation.
Doing so at least breaks our logging configuration,
which uses LogLevel constants as array keys and these constants
are defined as integer.

Therefore this pure visual optimization is removed
when writing LocalConfiguration.php

At a later point we might consider deprecating this
method, which at least has a wrong method name
(mentions "numeric", while it meanwhile uses "int" checks).
As this method performs a destructive operation,
its usefulness is limited.

Resolves: #82304
Releases: master, 8.7, 7.6
Change-Id: I8d252428f3e27379e4377d30af0fdfd5e5d8719d
Reviewed-on: https://review.typo3.org/55944
Tested-by: TYPO3com <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

History

#1 Updated by Oliver Hader over 1 year ago

Does this only occur in master or in stable releases as well?

#2 Updated by Thorsten Kahler over 1 year ago

The optimization attempt was already introduced in version 6.1 and backported to 6.0, see change c1d929d5.

#3 Updated by Thorsten Kahler over 1 year ago

  • Related to Bug #44938: LocalConfiguration extListArray adds keys if extension is uninstalled added

#4 Updated by Gerrit Code Review about 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/55936

#5 Updated by Gerrit Code Review about 1 year ago

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

#6 Updated by Gerrit Code Review about 1 year ago

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

#7 Updated by Helmut Hummel about 1 year ago

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

#8 Updated by Benni Mack 6 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF