Author: jleroux
Date: Sat Sep 24 09:24:39 2011
New Revision: 1175135
URL:
http://svn.apache.org/viewvc?rev=1175135&view=revLog:
Fix a bug reported by Kiran Gawde at
https://issues.apache.org/jira/browse/OFBIZ-4440 "OnePageCheckout breaks when you are logged in with userid that belongs to PartyGroup"
OnePageCheckout breaks when you are logged in with userid that belongs to PartyGroup. But the quickcheckout doesn't break. This is due to the fact that EditShippingAddress has following line which returns null.
person = delegator.findByPrimaryKey("Person", [partyId : party.partyId]);
Modified:
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy
Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy?rev=1175135&r1=1175134&r2=1175135&view=diff==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy Sat Sep 24 09:24:39 2011
@@ -22,10 +22,16 @@ import org.ofbiz.party.contact.ContactHe
if (userLogin) {
party = userLogin.getRelatedOne("Party");
- person = delegator.findByPrimaryKey("Person", [partyId : party.partyId]);
- context.partyId = person.partyId;
- context.firstName = person.firstName;
- context.lastName = person.lastName;
+ context.partyId = party.partyId
+ if ("Person".equals(party.partyTypeId)) {
+ person = delegator.findByPrimaryKey("Person", [partyId : party.partyId]);
+ context.firstName = person.firstName;
+ context.lastName = person.lastName;
+ } else {
+ group = delegator.findByPrimaryKey("PartyGroup", [partyId : party.partyId]);
+ context.firstName = group.groupName;
+ context.lastName = "";
+ }
contactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false));
if (contactMech) {