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

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


The following commit(s) were added to refs/heads/release24.09 by this push:
     new ea522c0b53 Fixed: Correct portlet sequence drag and drop boundaries 
and calculation (OFBIZ-13528)
ea522c0b53 is described below

commit ea522c0b5369623f12732567e59bb8d15128ba78
Author: Mridul Pathak <[email protected]>
AuthorDate: Wed Sep 9 23:34:16 2026 +0530

    Fixed: Correct portlet sequence drag and drop boundaries and calculation 
(OFBIZ-13528)
    
    - Correct DRAGDROPAFTER boundary conditions from sequenceNum >= origin and 
< destination to sequenceNum > origin and <= destination
    - Fix sequenceNum reassignment to use destination portlet's sequenceNum as 
base instead of each portlet's own sequenceNum
---
 .../groovy/org/apache/ofbiz/common/PortalPageServices.groovy | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/framework/common/src/main/groovy/org/apache/ofbiz/common/PortalPageServices.groovy
 
b/framework/common/src/main/groovy/org/apache/ofbiz/common/PortalPageServices.groovy
index 972aa253bd..68a17114db 100644
--- 
a/framework/common/src/main/groovy/org/apache/ofbiz/common/PortalPageServices.groovy
+++ 
b/framework/common/src/main/groovy/org/apache/ofbiz/common/PortalPageServices.groovy
@@ -258,7 +258,7 @@ Map updatePortletSeqDragDrop() {
                     portletSeqId: parameters.d_portletSeqId)
             .queryOne()
 
-    int newSequenceNo = 0
+    Long newSequenceNo = 0L
     if (parameters.mode != 'NEW') {
         EntityCondition condition = new EntityConditionBuilder().AND {
             EQUALS(portalPageId: parameters.portalPageId)
@@ -269,22 +269,22 @@ Map updatePortletSeqDragDrop() {
                     LESS_THAN(sequenceNum: originPp.sequenceNum)
                 }
             } else {
-                GREATER_THAN_EQUAL_TO(sequenceNum: originPp.sequenceNum)
+                GREATER_THAN(sequenceNum: originPp.sequenceNum)
                 if (destiPp.sequenceNum) {
-                    LESS_THAN(sequenceNum: destiPp.sequenceNum)
+                    LESS_THAN_EQUAL_TO(sequenceNum: destiPp.sequenceNum)
                 }
             }
         }
 
-        newSequenceNo = destiPp.sequenceNum
-        int increase = parameters.mode == 'DRAGDROPBEFORE' ? 1 : -1
+        newSequenceNo = destiPp.sequenceNum as Long
+        Long increase = parameters.mode == 'DRAGDROPBEFORE' ? 1L : -1L
         from('PortalPagePortlet')
                 .where(condition)
                 .orderBy((parameters.mode == 'DRAGDROPBEFORE' ? '' : '-') + 
'sequenceNum')
                 .queryList()
                 .each {
                     if (it.sequenceNum) {
-                        it.sequenceNum = it.sequenceNum + increase
+                        it.sequenceNum = newSequenceNo + increase
                         increase += increase
                     } else {
                         it.sequenceNum = newSequenceNo

Reply via email to