Feature #19611

Add a way to hook into the publish process for a workspace

Added by Erik Frister about 13 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2008-11-14
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

Description

There is currently no way that we can hook into the version swap method for a given record in the tcemain.php. This is needed for the next commerce release; so that when a record is published (switched into the LIVE Workspace) we can also publish related records that would otherwise stay connected to the old version.

Example use:
A product is to be published; the product record has related attributes which refer to the product uid. Without the hook, when the product is published, the attributes are not informed of the version swap and still refer to the (now) offline version of the record.

(issue imported from #M9793)


Files

9793.patch (1.61 KB) 9793.patch Administrator Admin, 2008-11-14 10:54
9793_v2.diff (4.35 KB) 9793_v2.diff Administrator Admin, 2009-03-01 01:42
9793_v3.patch (4.23 KB) 9793_v3.patch Administrator Admin, 2010-04-11 23:18
#1

Updated by Steffen Kamper almost 13 years ago

New hooks have to come with an interface. Indeed this makes it much easier to hook into tcemain.

Attached patch adds a hook for post-process versionSwap

#2

Updated by Darren Clark almost 12 years ago

I can confirm that the patch 9793_v2.diff works correctly with typo3 4.3.2 and it would be good to get this into the core.

Test Code:

<snip>
In ext_localconf.php

$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms_inline.php']['tcemainHook'][] = 'EXT:useextension/class.user_ux_t3lib_tceforms_inline.php:user_ux_t3lib_tcemainHook';

In class.user_ux_t3lib_tceforms_inline.php

require_once('t3lib/interfaces/interface.t3lib_tcemainhook.php');

class user_ux_t3lib_tcemainHook implements t3lib_tcemainHook {

function init(&$parentObject) {
}
function versionSwap_postProcess($table, $id, $swapWith, $swapIntoWS) {
t3lib_div::devLog("Version swap post process",'userextension');
}
}
&lt;/snip&gt;

Thanks
Darren

#3

Updated by Darren Clark almost 12 years ago

Updated patch against TYPO3_4-3-3 9793_v3.patch uploaded

#4

Updated by Benni Mack over 11 years ago

I think this patch can be closed as well, as the version code is now in a separate hook and could be replaced by your own implementation very easily. Is that ok?

#5

Updated by Ingo Renner over 11 years ago

adopted the title to be more in the line of a "feature" description

Also available in: Atom PDF