Project

General

Profile

Actions

Bug #16476

closed

TCAdefaults.table.field doesn't work for MM-fields

Added by Marc Bastian Heinrichs over 17 years ago. Updated over 15 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2006-08-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

A new record can't have an mm-record, because it has no uid. So the default value for an mm-field is killed by class.t3lib_transferdata.php. There should be a check for new records to hand over the default value to t3lib_TCEforms.

(issue imported from #M4060)


Files

TCAdefaults_MMfield_trunk.diff (697 Bytes) TCAdefaults_MMfield_trunk.diff Administrator Admin, 2007-12-11 18:57
TCAdefaults_MMfield_2007-12-11_v2.diff (624 Bytes) TCAdefaults_MMfield_2007-12-11_v2.diff Administrator Admin, 2007-12-11 19:19

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #16459: Bug in t3lib_loaddbgroup.php when using defVals while creating new recordsClosedOliver Hader2006-08-11

Actions
Actions #1

Updated by Oliver Hader about 17 years ago

Please provide some more details. Which field do you want to override by TCAdefaults? MM-tables are not defined in TCA, so this might not work at all.
But, please just give an example. Thanks!

Actions #2

Updated by Marc Bastian Heinrichs about 17 years ago

For example tt_news:
You cann't set a default category by TS with
TCAdefaults.tt_news.category = 2
because the relation to tt_news_cat is an mm-relation and the proceeding in t3lib_loaddbgroup.php or class.t3lib_transferdata.php kill the default value cause there is no uid for an new tt_news-record yet .

With fix in 4022 it works correct.

Actions #3

Updated by Oliver Hader about 17 years ago

Ah thanks, now I got it. It could also be possible, that a list of UIDs will be defined (e.g. "2,5,1"). The readList in extracts these values and holds them for later writing with writeMM. It could also happen that different tables are affected, like "tt_news:2,tt_content:13,..."

I'll take a closer look at t3lib_loadDBgroup.

Actions #4

Updated by Marc Bastian Heinrichs about 17 years ago

Thanks.
I had a look on it and I think the check dropping the default value was in class.t3lib_transferdata.php, but it's some time ago.

Actions #5

Updated by Bernhard Kraft over 16 years ago

The attached patch fixes this problem ...

Has to get applied against 4.1.2 ... do not know if it works well for other versions.

greets,
Bernhard

Actions #6

Updated by Jeff Segars over 16 years ago

Thanks Bernhard!

Seems to work for me on trunk but I haven't tested extensively enough to see if there are any side effects yet. I'm attaching an updated patch that applies cleanly to trunk. No functional changes from the original though.

Actions #7

Updated by Bernhard Kraft over 16 years ago

I attached a unified diff for 4.1.2

Could you post your experiences to the core-list after checking possible side effects ?

Subject of my patch request:
RFC: TCAdefaults for MM-Fields #16459, #16459

Actions #8

Updated by Stig Nørgaard Færch about 16 years ago

Any progress on this one?

Actions

Also available in: Atom PDF