|
Author: jleroux
Date: Sat Feb 16 12:06:49 2013 New Revision: 1446877 URL: http://svn.apache.org/r1446877 Log: "Applied fix from trunk for revision: 1446876" ------------------------------------------------------------------------ r1446876 | jleroux | 2013-02-16 12:54:50 +0100 (sam., 16 févr. 2013) | 4 lines A patch from Chatree Srichart for "The createDataResourceRole service does not check if partyId exists" https://issues.apache.org/jira/browse/OFBIZ-5133 The createDataResourceRole service has a partyId attribute as optional but its implementation method does not check if the partyId exists before creating a DataResourceRole value. The ensurePartyRole service also has a partyId attribute as optional but its implementation method does not check if the partyId exists before creating a PartyRole value. ------------------------------------------------------------------------ Modified: ofbiz/branches/release12.04/ (props changed) ofbiz/branches/release12.04/applications/content/script/org/ofbiz/content/data/DataServices.xml ofbiz/branches/release12.04/applications/party/script/org/ofbiz/party/party/PartySimpleMethods.xml Propchange: ofbiz/branches/release12.04/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1446876 Modified: ofbiz/branches/release12.04/applications/content/script/org/ofbiz/content/data/DataServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/content/script/org/ofbiz/content/data/DataServices.xml?rev=1446877&r1=1446876&r2=1446877&view=diff ============================================================================== --- ofbiz/branches/release12.04/applications/content/script/org/ofbiz/content/data/DataServices.xml (original) +++ ofbiz/branches/release12.04/applications/content/script/org/ofbiz/content/data/DataServices.xml Sat Feb 16 12:06:49 2013 @@ -202,16 +202,16 @@ under the License. <!-- Methods for DataResourceRole --> <simple-method method-name="createDataResourceRole" short-description="Create Data Resource Role"> - <make-value entity-name="DataResourceRole" value-field="newEntity"/> - <set-nonpk-fields map="parameters" value-field="newEntity"/> - <set-pk-fields map="parameters" value-field="newEntity"/> - - <if-empty field="newEntity.fromDate"> - <now-timestamp field="nowTimestamp"/> - <set field="newEntity.fromDate" from-field="nowTimestamp"/> - </if-empty> - - <create-value value-field="newEntity"/> + <if-not-empty field="parameters.partyId"> + <make-value entity-name="DataResourceRole" value-field="newEntity"/> + <set-nonpk-fields map="parameters" value-field="newEntity"/> + <set-pk-fields map="parameters" value-field="newEntity"/> + <if-empty field="newEntity.fromDate"> + <now-timestamp field="nowTimestamp"/> + <set field="newEntity.fromDate" from-field="nowTimestamp"/> + </if-empty> + <create-value value-field="newEntity"/> + </if-not-empty> </simple-method> <simple-method method-name="updateDataResourceRole" short-description="Update Data Resource Role"> <make-value entity-name="DataResourceRole" value-field="lookupKeyValue"/> Modified: ofbiz/branches/release12.04/applications/party/script/org/ofbiz/party/party/PartySimpleMethods.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/party/script/org/ofbiz/party/party/PartySimpleMethods.xml?rev=1446877&r1=1446876&r2=1446877&view=diff ============================================================================== --- ofbiz/branches/release12.04/applications/party/script/org/ofbiz/party/party/PartySimpleMethods.xml (original) +++ ofbiz/branches/release12.04/applications/party/script/org/ofbiz/party/party/PartySimpleMethods.xml Sat Feb 16 12:06:49 2013 @@ -65,11 +65,14 @@ under the License. <set from-field="parameters.roleTypeId" field="lookupPKMap.roleTypeId"/> </else> </if-empty> - <find-by-primary-key entity-name="PartyRole" map="lookupPKMap" value-field="lookedUpValue"/> - <if-empty field="lookedUpValue"> - <make-value value-field="newValue" entity-name="PartyRole" map="lookupPKMap"/> - <create-value value-field="newValue"/> - </if-empty> + <if-not-empty field="lookupPKMap.partyId"> + <find-by-primary-key entity-name="PartyRole" map="lookupPKMap" value-field="lookedUpValue"/> + <if-empty field="lookedUpValue"> + <make-value value-field="newValue" entity-name="PartyRole" map="lookupPKMap"/> + <create-value value-field="newValue"/> + </if-empty> + </if-not-empty> + </simple-method> <simple-method method-name="createPersonAndUserLogin" short-description="Creates a person and userlogin" login-required="false"> |
| Free forum by Nabble | Edit this page |
