Commit 0d2e4be9 authored by Oliver Hader's avatar Oliver Hader Committed by Christian Kuhn
Browse files

[BUGFIX] Warning on fetching undefined category definitions

Calling t3lib_category_Registry::getDatabaseTableDefinition()
for an extension that does not register any categories, will
cause a PHP Warning.

Change-Id: Id44022bcdca4484a2798777bcb9139fe070935e0
Fixes: #39155
Releases: 6.0
Reviewed-on: http://review.typo3.org/12968
Reviewed-by: Oliver Klee
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
parent 82a756af
......@@ -145,8 +145,11 @@ class t3lib_category_Registry implements t3lib_Singleton {
* @return string
*/
public function getDatabaseTableDefinition($extensionKey) {
$sql = '';
if (!isset($this->registry[$extensionKey]) || !is_array($this->registry[$extensionKey])) {
return '';
}
$sql = '';
foreach ($this->registry[$extensionKey] as $tableName => $fieldName) {
$sql .= sprintf($this->template, $tableName, $fieldName);
}
......
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