[TYPO3-irre] RTE in child elements overwrites field in parent element
Gregor Gold
pimpmysims at googlemail.com
Fri Apr 27 21:43:04 CEST 2007
Hi everyone,
i'm just trying to set up my first extension using IRRE and I am struggling
with a weird problem, which I do not understand.
I created a parent table called "...downloads" and a child table called
"...credits". The credit info is set up as a child element of downloads.
Both contain a RTE element.
If I create a new downloads item, fill out all fields including the RTE
field "description", create a new child element "credits" and fill out its
RTE field "credits", too, the RTE content of the parent element is replaced
by the content of the "credits" child element after saving. Meaning, both
RTE elements now contain the same data. The same happens, if I do save the
parent element before creating a "credits" child element. All other fields
remain unchanged.
If I edit the RTE field of the parent element afterwards and replace the
credits content by the original content for the parent element, everything
is saved as intended. No overwriting of foreign fields or something like
this
Both RTE fields have different names and I do not see any clue, why this
happens. Maybe someone can check the TCA and tell me, what's wrong. Maybe I
just miss something obvious and it's just something like "add a ',' to line
98".
Thanks in advance
Greg
Here comes the code:
$TCA["tx_pmsdownloads_downloads"] = array (
"ctrl" => $TCA["tx_pmsdownloads_downloads"]["ctrl"],
"interface" => array (
"showRecordFieldList" =>
"hidden,starttime,title,teaser,description,main_image,package,creator,category,required_expansion,secondary_images,credits,creator_codex,house_details,recolors"
),
"feInterface" => $TCA["tx_pmsdownloads_downloads"]["feInterface"],
"columns" => array (
'hidden' => array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => array (
'type' => 'check',
'default' => '0'
)
),
'starttime' => array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.starttime',
'config' => array (
'type' => 'input',
'size' => '8',
'max' => '20',
'eval' => 'date',
'default' => '0',
'checkbox' => '0'
)
),
<!-- deleted some fields, which work just fine -->
"description" => Array (
"exclude" => 0,
"label" =>
"LLL:EXT:pms_downloads/locallang_db.xml:tx_pmsdownloads_downloads.description",
"config" => Array (
"type" => "text",
"cols" => "30",
"rows" => "5",
)
),
<!-- deleted some more fields, which work just fine -->
"credits" => Array (
"exclude" => 0,
"label" =>
"LLL:EXT:pms_downloads/locallang_db.xml:tx_pmsdownloads_downloads.credits",
"config" => Array (
"type" => "inline",
"foreign_table" => "tx_pmsdownloads_credits",
"foreign_field" => "parentid",
"foreign_table_field" => "parenttable",
)
),
),
"types" => array (
"0" => array("showitem" => "hidden;;1;;1-1-1, title;;;;2-2-2,
teaser;;;;3-3-3,
description;;;richtext[cut|copy|paste|formatblock|textcolor|bold|italic|underline|left|center|right|orderedlist|unorderedlist|outdent|indent|link|table|image|line|chMode]:rte_transform[mode=ts_css],
main_image, package, creator, category, required_expansion,
secondary_images, credits, creator_codex, house_details, recolors")
),
"palettes" => array (
"1" => array("showitem" => "starttime")
)
);
$TCA["tx_pmsdownloads_credits"] = array (
"ctrl" => $TCA["tx_pmsdownloads_credits"]["ctrl"],
"interface" => array (
"showRecordFieldList" => "hidden,parentid,parenttable,credits"
),
"feInterface" => $TCA["tx_pmsdownloads_credits"]["feInterface"],
"columns" => array (
'hidden' => array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => array (
'type' => 'check',
'default' => '0'
)
),
"parentid" => Array (
"config" => Array (
"type" => "passthrough",
)
),
"parenttable" => Array (
"config" => Array (
"type" => "passthrough",
)
),
"credits" => Array (
"exclude" => 0,
"label" =>
"LLL:EXT:pms_downloads/locallang_db.xml:tx_pmsdownloads_credits.credits",
"config" => Array (
"type" => "text",
"cols" => "30",
"rows" => "5",
)
),
),
"types" => array (
"0" => array("showitem" => "hidden;;1;;1-1-1, parentid, parenttable,
credits;;;richtext[cut|copy|paste|formatblock|textcolor|bold|italic|underline|left|center|right|orderedlist|unorderedlist|outdent|indent|link|table|image|line|chMode]:rte_transform[mode=ts_css]")
),
"palettes" => array (
"1" => array("showitem" => "")
)
);
More information about the TYPO3-project-irre
mailing list