Bug #10664

Array expected but string given in removeRequiredExtFromListArr when using Introduction Package

Added by Andrew Murphy over 2 years ago. Updated over 2 years ago.

Status:Resolved Start date:2010-11-07
Priority:Should have Due date:
Assignee:- % Done:

100%

Category:-
Target version:-
Votes: 0

Description

Apache HTTP Server 2.2.16 (2010-07-25 release), "typical" setup
MySQL Community Server 5.1.51, "complete" setup, UTF-8 as default
PHP 5.3.3 (2010-07-22 release)
Change [DirectoryIndex index.html] to [DirectoryIndex index.html index.php] in [httpd.conf].
TYPO3 4.4.4 with Introduction Package (2010-10-06 release)

After first installation, via TYPO3's 1-2-3 Install Tool into the Introduction Package, the backend admin log contains 19 repetitions of this remark: "Core: Error handler (BE): PHP Warning: in_array() expects parameter 2 to be array, string given in typo3/mod/tools/em/class.em_index.php line 5162." The sys_log table in the database contains over 200 rows of this same error remark. This error remark does not appear, if the user goes through the classic TYPO3 Install Tool and then to the backend extension manager.

Line 5162 of class.em_index.php is in an extension manager function, removeRequiredExtFromListArr(), that "removes any required extensions from the $listArr - they should NOT be added to the common extension list, because they are found already in 'requiredExt' list". In line 5162, in_array() expects $this->requiredExt to be an array, though $this->requiredExt originates from the comma-delimited string in $TYPO3_CONF_VARS['EXT']['requiredExt'], first declared in t3lib/config_default.php line 184. The book, "TYPO3 Enterprise Content Management", says on page 43 for $TYPO3_CONF_VARS['EXT']['requiredExt']: "String. Comma-separated list: here you can specify extensions that cannot be disabled by the Extension Manager. Normally these are at least cms and lang, which form the core of the system. Example: [requiredExt] = cms,lang".

Solution

The TYPO3 extension manager's init() function sets $this->requiredExt as an array built from the delimited string in $TYPO3_CONF_VARS['EXT']['requiredExt']. (See line 414 in class.em_index.php.)

We can use this as a guide to place a similar instruction into a similar functional position in the Introduction Package. Our instruction will go into typo3conf/ext/introduction/Classes/Import/Extension.php, in the section that initializes the extension manager. Our instruction is:
// Make an array needed by removeRequiredExtFromListArr().
$this->extensionManager->requiredExt = t3lib_div::trimExplode(',',$GLOBALS['TYPO3_CONF_VARS']['EXT']['requiredExt'],1);

intro-10664.diff (880 Bytes) Andrew Murphy, 2010-11-07 03:39

Extension.php (5.1 kB) Andrew Murphy, 2010-11-19 16:44

History

Updated by Andrew Murphy over 2 years ago

Patch file attached.

Updated by Andrew Murphy over 2 years ago

"TYPO3 4.4.4 with Introduction Package" version of typo3conf/ext/introduction/Classes/Import/Extension.php with only this patch added.

Updated by Peter Beernink over 2 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset r41412.

Also available in: Atom PDF