[TYPO3-german] Hook für tt_address leert TCA

Johannes C. Schulz info at enzephalon.de
Fri Apr 24 10:09:21 CEST 2015


Hallo Liste

Ich hatte schonmal einen Hook für tt_address geschrieben der einfach zwei
Felder hinzufügt.
Diesen Hook habe ich neu geschrieben. Der alte Hook funktioniert in typo3
6.2.x, der neue Hook leert das TCA von tt_address. Ich weiß nicht wieso.

ALT (funktioniert) tables.php:
<?php
if (!defined ('TYPO3_MODE')) 	die ('Access denied.');

$tempColumns = Array (
	"longitude" => Array (		
		"exclude" => 1,		
		"label" =>
"LLL:EXT:OLD___tt_address_hook/locallang_db.xml:tt_address_hook._lng",

		"config" => Array (
			"type" => "input",
			"internal_type" => "db",	
			"size" => "20",
		)
	),
	"latitude" => Array (		
		"exclude" => 1,		
		"label" =>
"LLL:EXT:OLD___tt_address_hook/locallang_db.xml:tt_address_hook._lat",

		"config" => Array (
			"type" => "input",	
			"internal_type" => "db",
			"size" => "20",
		)
	),

);
$value = 'tt_address';
t3lib_div::loadTCA($value);
t3lib_extMgm::addTCAcolumns($value,$tempColumns,1);
t3lib_extMgm::addToAllTCAtypes($value,"latitude;;;;1-1-1, longitude");
?>

NEU (funktioniert nich) Configuration/TCA/Override/tt_address.php
<?php
if (!defined ('TYPO3_MODE')) 	die ('Access denied.');
$temporaryColumns = array (
	"latitude" => array (		
		"exclude" => 0,		
		"label" =>
"LLL:EXT:tt_address_hook/Resources/Private/Loanguage/locallang_db.xml:latitu
de",		
		"config" => array (
			"type" => "input",
			"internal_type" => "db",	
			"size" => "20",
		),
	),
	"longitude" => array (		
		"exclude" => 0,		
		"label" =>
"LLL:EXT:tt_address_hook/Resources/Private/Loanguage/locallang_db.xml:longit
ude",		
		"config" => array (
			"type" => "input",	
			"internal_type" => "db",
			"size" => "20",
		),
	),
);
\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_address');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_addres
s',$temporaryColumns,0);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tt_add
ress',"latitude;;;;1-1-1, longitude");
?>

Mir kommt es so vor als könne man nur "neue" Extensions mit einer "neuen"
Extension erweitern und piBase-Extensions müssen mit piBase-Extensions
erweitert werden? Aber das kann auch nicht wirklich sein, weil ich habe da
noch eine dritte eigene Extension die in der ext_tables.php die tt_address
ebenfalls erweitert. Auch diese funktioniert unter 6.2.x und ist aber eine
Extbase-Extension welche auch Namespaces und den ganzen modernen Kram
benutzt.

Kann mir jemand das mal erklären???

Danke
Johannes



More information about the TYPO3-german mailing list