[ofbiz-framework] branch trunk updated: Fixed: RuntimeException in getPartyNameForDate service for partyNameHistory.gender field(OFBIZ-11736)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Fixed: RuntimeException in getPartyNameForDate service for partyNameHistory.gender field(OFBIZ-11736)

Pawan Verma-2
This is an automated email from the ASF dual-hosted git repository.

pawan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 3f9e377  Fixed: RuntimeException in getPartyNameForDate service for partyNameHistory.gender field(OFBIZ-11736)
3f9e377 is described below

commit 3f9e37797ac19932ab1c5fa836e6d9819096c868
Author: Pawan Verma <[hidden email]>
AuthorDate: Sat May 23 23:35:39 2020 +0530

    Fixed: RuntimeException in getPartyNameForDate service for partyNameHistory.gender field(OFBIZ-11736)
   
    The reason for this issue is code is trying to get the gender of person from partyNameHistory record and gender is not a field in partyNameHistory entity. During conversion we minimized duplicate code which caused that issue.
   
    I've added a check to avoid checking gender in partyNameHistory record.
---
 applications/party/groovyScripts/party/PartyServices.groovy | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/applications/party/groovyScripts/party/PartyServices.groovy b/applications/party/groovyScripts/party/PartyServices.groovy
index 872ed75..60c438f 100644
--- a/applications/party/groovyScripts/party/PartyServices.groovy
+++ b/applications/party/groovyScripts/party/PartyServices.groovy
@@ -104,7 +104,7 @@ def getPartyNameForDate() {
         if (person.middleName) resultMap.middleName = person.middleName
         if (person.personalTitle) resultMap.personalTitle = person.personalTitle
         if (person.suffix) resultMap.suffix = person.suffix
-        if (person.gender) resultMap.gender = person.gender
+        if (!partyNameHistoryCurrent && person.gender) resultMap.gender = person.gender
 
         resultMap.fullName = PartyHelper.getPartyName(person, parameters.lastNameFirst == "Y")
     } else if (partyGroup) {