You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2026/09/16 12:01:07 UTC

(ofbiz-framework) branch trunk updated: Fixed: updatePartyInvitation silently no-ops on a nonexistent record (OFBIZ-13594)

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

mridulpathak 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 745ceb44fc Fixed: updatePartyInvitation silently no-ops on a nonexistent record (OFBIZ-13594)
745ceb44fc is described below

commit 745ceb44fcf0774d073e33207a35eac248d5f4c5
Author: Mridul Pathak <mr...@gmail.com>
AuthorDate: Wed Sep 16 17:13:23 2026 +0530

    Fixed: updatePartyInvitation silently no-ops on a nonexistent record (OFBIZ-13594)
    
    updatePartyInvitation built its updated value with makeValue instead of fetching the existing PartyInvitation first, so updating a nonexistent partyInvitationId matched zero rows on the underlying UPDATE instead of failing cleanly, and the incoming parameters were never merged onto the existing record before it was stored. It now looks up the existing PartyInvitation first, returns an error if it is not found, and applies the incoming fields onto that looked-up value before saving.
---
 .../org/apache/ofbiz/party/party/PartyInvitationServices.groovy   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyInvitationServices.groovy b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyInvitationServices.groovy
index 8a4804bf52..ba9ca1e667 100644
--- a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyInvitationServices.groovy
+++ b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyInvitationServices.groovy
@@ -36,10 +36,14 @@ Map createPartyInvitation() {
 }
 
 Map updatePartyInvitation() {
-    GenericValue lookedUpValue = makeValue('PartyInvitation', parameters)
+    GenericValue lookedUpValue = from('PartyInvitation').where(parameters).queryOne()
+    if (!lookedUpValue) {
+        return error('PartyUiLabels', 'PartyInvitationNotValidError')
+    }
     if (! parameters.toName && parameters.partyId) {
-        lookedUpValue.toName = PartyHelper.getPartyName(delegator, parameters.partyId, false)
+        parameters.toName = PartyHelper.getPartyName(delegator, parameters.partyId, false)
     }
+    lookedUpValue.setNonPKFields(parameters)
     lookedUpValue.store()
     return success()
 }