Author: jleroux
Date: Fri Jun 4 12:34:56 2010 New Revision: 951395 URL: http://svn.apache.org/viewvc?rev=951395&view=rev Log: "Applied fix from trunk for revision: 951381 " ------------------------------------------------------------------------ r951381 | jleroux | 2010-06-04 13:43:41 +0200 (ven. 04 juin 2010) | 7 lignes A patch from Sascha Rodekamp "Duplicate Product, didn't duplicate the content" (https://issues.apache.org/jira/browse/OFBIZ-3804) - OFBIZ-3804 The Product duplicate function didn't really duplicate the product content, just set a reference to the original content. When I now change the content from the duplicated product, the content of the original product is changed to. So here is a patch that dublicate the content, dataresource and electronic text (if exists), too. The result is a true copy of the original product that can be edit without side effects to the original product. ------------------------------------------------------------------------ Modified: ofbiz/branches/release10.04/ (props changed) ofbiz/branches/release10.04/applications/product/script/org/ofbiz/product/product/ProductServices.xml Propchange: ofbiz/branches/release10.04/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Jun 4 12:34:56 2010 @@ -1,3 +1,3 @@ /ofbiz/branches/addbirt:831210-885099,885686-886087 /ofbiz/branches/multitenant20100310:921280-927264 -/ofbiz/trunk:939988,939990,939999,940025,940053,940234,940248,940309,940401,940410,940425,940779,940815,940849,941007,941047,941109,941177,941199,941261,941440,941600,941999,942084,942406,942414,942671,942883-942884,943168,943271-943272,944614,944621,944623,944647,944669,944797,944895,945010,945018,945026,945118,945573,945578,945580,945582,945610,945619,945848,945852,945857,946061,946066,946073,946075,946080,946309,946313,946320,946322,946596,947004-947005,947392,947424,947679,947988,948017,948694,949174,949710,949844,950866,950870,950893,951005,951098,951251,951367 +/ofbiz/trunk:939988,939990,939999,940025,940053,940234,940248,940309,940401,940410,940425,940779,940815,940849,941007,941047,941109,941177,941199,941261,941440,941600,941999,942084,942406,942414,942671,942883-942884,943168,943271-943272,944614,944621,944623,944647,944669,944797,944895,945010,945018,945026,945118,945573,945578,945580,945582,945610,945619,945848,945852,945857,946061,946066,946073,946075,946080,946309,946313,946320,946322,946596,947004-947005,947392,947424,947679,947988,948017,948694,949174,949710,949844,950866,950870,950893,951005,951098,951251,951367,951381 Modified: ofbiz/branches/release10.04/applications/product/script/org/ofbiz/product/product/ProductServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/product/script/org/ofbiz/product/product/ProductServices.xml?rev=951395&r1=951394&r2=951395&view=diff ============================================================================== --- ofbiz/branches/release10.04/applications/product/script/org/ofbiz/product/product/ProductServices.xml (original) +++ ofbiz/branches/release10.04/applications/product/script/org/ofbiz/product/product/ProductServices.xml Fri Jun 4 12:34:56 2010 @@ -229,6 +229,37 @@ under the License. <iterate entry="foundValue" list="foundValues"> <clone-value value-field="foundValue" new-value-field="newTempValue"/> <set from-field="parameters.productId" field="newTempValue.productId"/> + <!-- Clone Content --> + <sequenced-id sequence-name="Content" field="newContentId"/> + <entity-one entity-name="Content" value-field="oldContent" use-cache="false"> + <field-map field-name="contentId" value="${newTempValue.contentId}"/> + </entity-one> + <if-not-empty field="oldContent"> + <clone-value value-field="oldContent" new-value-field="clonedContent"/> + <set from-field="newContentId" field="clonedContent.contentId"/> + <set from-field="newContentId" field="newTempValue.contentId"/> + <!-- Clone DataResource --> + <entity-one entity-name="DataResource" value-field="oldDataResource" use-cache="false"> + <field-map field-name="dataResourceId" value="${clonedContent.dataResourceId}"/> + </entity-one> + <if-not-empty field="oldDataResource"> + <sequenced-id sequence-name="DataResource" field="newDataResourceId"/> + <clone-value new-value-field="clonedDataresource" value-field="oldDataResource"/> + <set from-field="newDataResourceId" field="clonedDataresource.dataResourceId"/> + <!-- set new data resource id in cloned content --> + <set from-field="newDataResourceId" field="clonedContent.dataResourceId"/> + <create-value value-field="clonedDataresource"/> + <!-- Clone Electronic Text if exists --> + <get-related-one value-field="oldDataResource" relation-name="ElectronicText" to-value-field="oldElectronicText"/> + <if-not-empty field="oldElectronicText"> + <clone-value value-field="oldElectronicText" new-value-field="clonedElectronicText"/> + <set from-field="newDataResourceId" field="clonedElectronicText.dataResourceId"/> + <create-value value-field="clonedElectronicText"/> + </if-not-empty> + </if-not-empty> + <create-value value-field="clonedContent"/> + </if-not-empty> + <!-- End Clone Contet --> <create-value value-field="newTempValue"/> </iterate> </if-not-empty> |
Free forum by Nabble | Edit this page |