This is an automated email from the ASF dual-hosted git repository.
dixitdeepak 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 ce8ca2b601 Fix queryPagedIndex usage in paged queries
ce8ca2b601 is described below
commit ce8ca2b601025561149ee7f314eaf58faf44046d
Author: Deepak Dixit <[email protected]>
AuthorDate: Thu May 21 18:20:43 2026 +0530
Fix queryPagedIndex usage in paged queries
Updated queryPagedList usage to pass viewIndex and viewSize directly
instead of calculated low/high index values.(OFBIZ-13399)
---
.../groovy/org/apache/ofbiz/content/survey/EditSurveyQuestions.groovy | 2 +-
.../src/main/groovy/org/apache/ofbiz/party/visit/ShowVisits.groovy | 2 +-
.../ofbiz/product/catalog/feature/EditFeatureCategoryFeatures.groovy | 2 +-
.../ofbiz/product/catalog/product/ApplyFeaturesFromCategory.groovy | 2 +-
.../ofbiz/product/facility/facility/FindInventoryItemsByLabels.groovy | 2 +-
.../product/facility/facility/ViewFacilityInventoryByProduct.groovy | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git
a/applications/content/src/main/groovy/org/apache/ofbiz/content/survey/EditSurveyQuestions.groovy
b/applications/content/src/main/groovy/org/apache/ofbiz/content/survey/EditSurveyQuestions.groovy
index fe40f07318..c168df42f0 100644
---
a/applications/content/src/main/groovy/org/apache/ofbiz/content/survey/EditSurveyQuestions.groovy
+++
b/applications/content/src/main/groovy/org/apache/ofbiz/content/survey/EditSurveyQuestions.groovy
@@ -45,7 +45,7 @@ try {
.orderBy('sequenceNum')
.cursorScrollInsensitive()
.cache(true)
- .queryPagedList(lowIndex, highIndex - lowIndex + 1)
+ .queryPagedList(viewIndex, viewSize)
surveyQuestionAndApplList = pagedList.getData()
listSize = pagedList.getSize()
if (listSize < highIndex) {
diff --git
a/applications/party/src/main/groovy/org/apache/ofbiz/party/visit/ShowVisits.groovy
b/applications/party/src/main/groovy/org/apache/ofbiz/party/visit/ShowVisits.groovy
index b1215d3a8c..c60f9b9cbb 100644
---
a/applications/party/src/main/groovy/org/apache/ofbiz/party/visit/ShowVisits.groovy
+++
b/applications/party/src/main/groovy/org/apache/ofbiz/party/visit/ShowVisits.groovy
@@ -54,7 +54,7 @@ try {
// show active visits
visitQuery.where('thruDate', null)
}
- pagedList = visitQuery.queryPagedList(lowIndex, viewSize)
+ pagedList = visitQuery.queryPagedList(viewIndex, viewSize)
visitList = pagedList.getData() ?: []
visitListSize = pagedList.getSize()
if (highIndex > visitListSize) {
diff --git
a/applications/product/src/main/groovy/org/apache/ofbiz/product/catalog/feature/EditFeatureCategoryFeatures.groovy
b/applications/product/src/main/groovy/org/apache/ofbiz/product/catalog/feature/EditFeatureCategoryFeatures.groovy
index cd7a60306b..b9f9c024d9 100644
---
a/applications/product/src/main/groovy/org/apache/ofbiz/product/catalog/feature/EditFeatureCategoryFeatures.groovy
+++
b/applications/product/src/main/groovy/org/apache/ofbiz/product/catalog/feature/EditFeatureCategoryFeatures.groovy
@@ -73,7 +73,7 @@ try {
.distinct()
.cursorScrollInsensitive()
.maxRows(highIndex)
- .queryPagedList(lowIndex + 1, highIndex - lowIndex)
+ .queryPagedList(viewIndex, viewSize)
productFeatures = productFeaturesPagedList.getData()
} catch (GenericEntityException e) {
String errMsg = 'Failure in operation, rolling back transaction'
diff --git
a/applications/product/src/main/groovy/org/apache/ofbiz/product/catalog/product/ApplyFeaturesFromCategory.groovy
b/applications/product/src/main/groovy/org/apache/ofbiz/product/catalog/product/ApplyFeaturesFromCategory.groovy
index 896858acaf..753187a949 100644
---
a/applications/product/src/main/groovy/org/apache/ofbiz/product/catalog/product/ApplyFeaturesFromCategory.groovy
+++
b/applications/product/src/main/groovy/org/apache/ofbiz/product/catalog/product/ApplyFeaturesFromCategory.groovy
@@ -71,7 +71,7 @@ try {
.distinct()
.cursorScrollInsensitive()
.maxRows(highIndex)
- .queryPagedList(lowIndex + 1, highIndex - lowIndex)
+ .queryPagedList(viewIndex, viewSize)
productFeatures = productFeaturesPagedList.getData()
} catch (GenericEntityException e) {
String errMsg = 'Failure in operation, rolling back transaction'
diff --git
a/applications/product/src/main/groovy/org/apache/ofbiz/product/facility/facility/FindInventoryItemsByLabels.groovy
b/applications/product/src/main/groovy/org/apache/ofbiz/product/facility/facility/FindInventoryItemsByLabels.groovy
index ee3286ab75..19e65e57ae 100644
---
a/applications/product/src/main/groovy/org/apache/ofbiz/product/facility/facility/FindInventoryItemsByLabels.groovy
+++
b/applications/product/src/main/groovy/org/apache/ofbiz/product/facility/facility/FindInventoryItemsByLabels.groovy
@@ -63,7 +63,7 @@ if (andCondition.size() > 1) {
beganTransaction = TransactionUtil.begin()
inventoryItemsPagedList = from(inventoryItemAndLabelsView)
-
.where(andCondition).cursorScrollInsensitive().distinct().maxRows(highIndex).queryPagedList(lowIndex,
viewSize)
+
.where(andCondition).cursorScrollInsensitive().distinct().maxRows(highIndex).queryPagedList(viewIndex,
viewSize)
inventoryItemsSize = inventoryItemsPagedList.getSize()
context.inventoryItemsSize = inventoryItemsSize
diff --git
a/applications/product/src/main/groovy/org/apache/ofbiz/product/facility/facility/ViewFacilityInventoryByProduct.groovy
b/applications/product/src/main/groovy/org/apache/ofbiz/product/facility/facility/ViewFacilityInventoryByProduct.groovy
index 22222ae2b3..127c687fdc 100644
---
a/applications/product/src/main/groovy/org/apache/ofbiz/product/facility/facility/ViewFacilityInventoryByProduct.groovy
+++
b/applications/product/src/main/groovy/org/apache/ofbiz/product/facility/facility/ViewFacilityInventoryByProduct.groovy
@@ -143,7 +143,7 @@ if (action) {
try {
beganTransaction = TransactionUtil.begin()
prodsPagedList =
from(prodView).where(whereCondition).orderBy('productId').cursorScrollInsensitive()
- .distinct().queryPagedList(lowIndex, highIndex)
+ .distinct().queryPagedList(viewIndex, viewSize)
prods = prodsPagedList.getData()
listSize = prodsPagedList.getSize()
} catch (GenericEntityException e) {