Feature #19611
closedAdd a way to hook into the publish process for a workspace
0%
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
Updated by Steffen Kamper over 15 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
Updated by Darren Clark over 14 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');
}
}
</snip>
Thanks
Darren
Updated by Darren Clark over 14 years ago
Updated patch against TYPO3_4-3-3 9793_v3.patch uploaded
Updated by Benni Mack about 14 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?
Updated by Ingo Renner about 14 years ago
adopted the title to be more in the line of a "feature" description