Bug #17377
closedMissleading comment in TCEmain::copyRecord_procBasedOnFieldType()
0%
Description
A branch in t3lib_TCEmain::copyRecord_procBasedOnFieldType never gets reached. So something seems to be wrong here.
If you use the inline type and have also set 'MM', then the function getInlineFieldType will return 'mm'. But in copyRecord_procBasedOnFieldType there is an if-else statement.
if ($this->isReferenceField($conf) || $inlineSubType 'mm') {
// if another inline subtype is used (foreign_field, mm with attributes or simply item list)
} elseif ($inlineSubType ! false) {
...
However you will always come into the first branch if you use inline and mm simultaneously. And if you do not use inline you will not come into the second branch too. So something seems to be wrong here.
function getInlineFieldType($conf) {
if ($conf['type'] == 'inline' && $conf['foreign_table']) {
if ($conf['foreign_field'])
return 'field'; // the reference to the parent is stored in a pointer field in the child record
elseif ($conf['MM'])
return 'mm'; // regular MM intermediate table is used to store data
else
return 'list'; // an item list (separated by comma) is stored (like select type is doing)
}
return false;
}
(issue imported from #M5778)
Files
Updated by Oliver Hader over 17 years ago
The first part is for MM relations only. IRRE with MM stores relations of the children in MM tables.
The second part is for the new IRRE specific thing (without MM). You can store children using comma-separated-values ("list") or the foreign_field pointer ("field").
Did you experience any problems on using Inline Relational Record Editing with non-MM relations ("the second branch")?
Updated by Franz Holzinger over 17 years ago
I am just wondering about this code.
So if this is correct, then the comment must be wrong:
if another inline subtype is used (foreign_field, mm with attributes or simply item list)
Because you wrote the second branch would be without mm.
$dbAnalysis->start($value, $conf['foreign_table'], $conf['MM'], $uid, $table, $conf);
Here should not be a $conf['MM'], when it does not exist in this case.
Updated by Oliver Hader over 17 years ago
$conf['MM'] is empty in this case and would have changed the behaviour. In fact, the comment is missleading - it remaind from the initial development on IRRE, were we didn't have a name for "MM relations with attributes" - this is now "bidirectional relations with attributes on the intermediate table". And the "intermediate table" is defined in $TCA with a proper uid, pid, tstamp, etc.
I attached a cleaning patch, that changes the $conf['MM'] to blank ('') and changes the comment.
Updated by Oliver Hader over 17 years ago
Committed to SVN - TYPO3_4-1 (rev. 2361) & Trunk (rev. 2362)