Bug #38703

Publishing records with IRRE records -> lost relation

Added by Dimitri Koenig about 3 years ago. Updated about 1 year ago.

Status:Rejected Start date:2012-07-06
Priority:Must have Due date:
Assigned To:- % Done:

0%

Category:Workspaces Spent time: -
Target version:-
TYPO3 Version:4.5 Is Regression:No
PHP Version: Sprint Focus:
Complexity:

Description

Within my own extension i have a record with an inline record (IRRE) which is versioning too.

Wether this relation is an MM or 1:n (comma separated) doesn't matter:
As soon as i publish my main record or even both records, the relation gets lost.

If i use MM relation, the uids within the MM table won't be updated.
If i use an 1:n relation the field containing the related uid is empty after publishing.

I tried to publish only the main record, i tried to publish both records, nothing works.

patch_20121129_1.diff Magnifier (632 Bytes) Stephan Ude, 2012-11-29 17:47


Related issues

related to Core - Task #45676: Workspace references are not considered Rejected 2013-02-20
related to Grid Elements - Bug #46747: Translating Childelements in Grid-Container saves into or... Rejected 2013-03-28
related to Grid Elements - Bug #46749: Drag'n'drop child elements inside Gridelements + Workspaces Rejected 2013-03-28

History

#1 Updated by Tizian Schmidlin about 3 years ago

An ugly but working workaround for this issue is the following:

t3lib/class.t3lib_tcemain.php, line 919:


$query = 'UPDATE _NAME OF YOUR IRRE FIELD_ SET pid=_ORIGINAL PID_ WHERE pid=-1 AND deleted = 0';
$GLOBALS['TYPO3_DB']->sql_query($query);

It could be packed into a separate class as a tcemain hook with the method "hook_processDatamap_afterDatabaseOperations", this would of course improve the readability masively.

#2 Updated by Stephan Ude over 2 years ago

The function t3lib_TCEmain::isReferenceField is causing this issue. It doesn't take care of inline types so they are not recognized as reference fields.

function isReferenceField($conf) {
    return ($conf['type'] == 'group' && $conf['internal_type'] == 'db' || $conf['type'] == 'select' && $conf['foreign_table']);
}

The class t3lib_refindex has got the same function with nearly the same content, but it takes care of inline types.

function isReferenceField($conf) {
    return ($conf['type'] == 'group' && $conf['internal_type'] == 'db') || (($conf['type'] == 'select' || $conf['type'] == 'inline') && $conf['foreign_table']);
}

Attached is a patch for the t3lib_TCEmain with whom the bug can be fixed. Though I'm not quite sure, if every usage of the function isReferenceField in t3lib_TCEmain is taking care of inline types as reference fields.

#3 Updated by Michael Stucki over 1 year ago

  • Category changed from Bugs to Workspaces

#4 Updated by Michael Stucki over 1 year ago

  • Project changed from Workspaces & Versioning to Core
  • Category changed from Workspaces to Workspaces

#5 Updated by Oliver Hader about 1 year ago

  • Status changed from New to Rejected
  • Is Regression set to No

Please upgrade to TYPO3 CMS 6.2 which got a lot of fixes in that regard.
No backports from 6.2 to 4.5 since the chances are high that some other component breaks.

Please see #54851 and #58282

Also available in: Atom PDF