Feature #33045
closedEnable TCA type field to depend on field of foreign table by syntax relationField:foreignTypeField
100%
Description
Sometimes it would be useful to make a TCA type switch not directly based on a value of the current record, but based on a value of another table.
This is e.g. useful for IRRE when used with an intermediate table (making a relation to a third table). Sometimes it's useful to make the fields dependent on the type field of the third table.
Say you have a relation between "houses" and "building objects" and an "intermediate table" for making the relation and storing some properties on how exactly the building objects are used in that particular house. Now, depending on the "building object" that the user makes a relation to, the intermediate table should show different fields.
The patch (as pushed to gerrit) implements this.
Files
Updated by Gerrit Code Review over 12 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7706
Updated by Gerrit Code Review over 12 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7706
Updated by Gerrit Code Review over 12 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7706
Updated by Ingmar Schlecht over 12 years ago
- File T3X_foreigntabletest-0_0_0-z-201201251554.t3x T3X_foreigntabletest-0_0_0-z-201201251554.t3x added
- File T3D__2012-01-25_15-57-z.t3d T3D__2012-01-25_15-57-z.t3d added
How to test
Attached you can find an T3X extension and a T3D import/export of a page with some test records. If you change the relation field from the switch table to the other table (which has a normal type field) then you see how the order of the fields change (as defined in the type showItem definition in TCA).
Now, that one only tests the function in TCEForms. If you also want to test the t3lib_BEFunc function, modify (just for quick testing) the BE Web->List module's special field "_PATH" to contain the type field instead of a PATH for a while by changing those lines:
File: typo3/class.db_list_extra.inc
change those lines:
} elseif ($fCol == '_PATH_') {
$theData[$fCol]=$this->recPath($row['pid']);
to this:
} elseif ($fCol == '_PATH_') {
$theData[$fCol]=t3lib_BEfunc::getTCAtypeValue($table, $row);
And then go to the BE list module, go to detail view of the example table, check the special field "_PATH" to be displayed, which should now contain the type values (just for testing of course).
Updated by Gerrit Code Review over 12 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7706
Updated by Ingmar Schlecht over 12 years ago
- File T3X_foreigntabletest-0_0_0-z-201201311342.t3x T3X_foreigntabletest-0_0_0-z-201201311342.t3x added
Attached is a new test extension which also tests it with a select field.
Updated by Gerrit Code Review over 12 years ago
Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7706
Updated by Ingmar Schlecht over 12 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset d8723e32346b4d335fa6c34e7b01dfac4bee3eef.
Updated by Riccardo De Contardi almost 7 years ago
- Status changed from Resolved to Closed