Bug #44938

LocalConfiguration extListArray adds keys if extension is uninstalled

Added by Jan-Erik Revsbech over 8 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Category:
Extension Manager
Target version:
-
Start date:
2013-01-29
Due date:
% Done:

100%

Estimated time:
1.00 h
TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

There is a minor 'glitch' when unloading some extension: The loaded extension list is an array since 6.0 (which is great). When writing out the array to LocalConfiguration, keys are numbered and array keys are always written, if the keys are not numbered without "leap". See ArrayUtility::arrayExport() for details (and the unit tests, the method has high code-coverage). Failure case: if unloading some extension that is in the middle of the array, obviously, some 'leap' is created in the numbered array key list of 'extList', because, well the extension is removed from the array. Therefor, the keys are after that written to LocalConfiguration, because there is a leap. It would be way better, if the array keys are left out, so you get:

»···»···'extListArray' => array(
»···»···»···'backend',
»···»···»···'core',
»···»···»···.......
»···»···),

instead of

»···»···'extListArray' => array(
»···»···»···0 -> 'backend',
»···»···»···1 -> 'core',
»···»···»···...

This was actually intended to be the case, but exportArray() is a bit too safe for that (which is intentional). Imho, the most easy solution would be to add some additional method to ArrayUtility to "clean up" array keys if they are numbered and have leaps. This method should again be covered by tests. The method should then be (probably) called in Core\Configuration\ConfigurationManager, just before exportArray for the ext.extListArray sub array. This way, we could get rid of the ugly numbers in LocalConfiguration for this numbered sub-array and have arrayExport as save as before.


Related issues

Related to TYPO3 Core - Bug #82304: ConfigurationManager::writeLocalConfiguration breaks log writer configurationClosed2017-09-05

Actions
#1

Updated by Gerrit Code Review over 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17811

#2

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17811

#3

Updated by Gerrit Code Review over 8 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17811

#4

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/17872

#5

Updated by Christian Kuhn over 8 years ago

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

Updated by Oliver Hader about 8 years ago

  • Target version set to 2222
#7

Updated by Oliver Hader about 8 years ago

  • Project changed from 2269 to TYPO3 Core
#8

Updated by Oliver Hader about 8 years ago

  • Category set to Extension Manager
#9

Updated by Oliver Hader about 8 years ago

  • Target version deleted (2222)
#10

Updated by Thorsten Kahler almost 4 years ago

  • Related to Bug #82304: ConfigurationManager::writeLocalConfiguration breaks log writer configuration added
#11

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF