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 896b4e6fb8 Fixed: Two regressions in the minilang-to-Groovy conversion
of ContentServicesScript.groovy (OFBIZ-13589)
896b4e6fb8 is described below
commit 896b4e6fb81743e3543148cd8dd392983fe7d802
Author: Mridul Pathak <[email protected]>
AuthorDate: Tue Sep 15 17:51:57 2026 +0530
Fixed: Two regressions in the minilang-to-Groovy conversion of
ContentServicesScript.groovy (OFBIZ-13589)
- copyContentAndElectronicTextandAssoc assigned content directly from a
cached view (ContentWorker.getContentCache()) and then mutated it in place to
build the copy, silently corrupting the shared, cached ContentDataResourceView
entry for the original contentId; the original minilang cloned the value before
mutating, and this restores that clone
- createMissingContentAltUrls's WebSiteContent lookup was missing a
filterByDate() the original minilang had, so expired associations were also
processed (over-processing only, no data loss)
Both fixes were verified against the original minilang and covered by a
temporary RED/GREEN test before removal, and the content component's test suite
passes unchanged.
---
.../org/apache/ofbiz/content/content/ContentServicesScript.groovy | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/applications/content/src/main/groovy/org/apache/ofbiz/content/content/ContentServicesScript.groovy
b/applications/content/src/main/groovy/org/apache/ofbiz/content/content/ContentServicesScript.groovy
index a98ec6c1ee..ac622fcfa2 100644
---
a/applications/content/src/main/groovy/org/apache/ofbiz/content/content/ContentServicesScript.groovy
+++
b/applications/content/src/main/groovy/org/apache/ofbiz/content/content/ContentServicesScript.groovy
@@ -591,6 +591,7 @@ Map createMissingContentAltUrls() {
if (parameters.webSiteId) {
from('WebSiteContent')
.where(webSiteId: parameters.webSiteId)
+ .filterByDate()
.getFieldList('contentId')
.each { String contentId ->
contentCreatedList.addAll(createMissingContentAltUrlInline(contentId))
@@ -699,7 +700,7 @@ Map removeContentAndRelated() {
*/
Map copyContentAndElectronicTextandAssoc() {
Map getContentResult = run service: 'getContent', with: parameters
- GenericValue content = getContentResult.view
+ GenericValue content = (GenericValue) getContentResult.view.clone()
if (content.dataResourceId) {
Map getElectronicTextResult = run service: 'getElectronicText', with:
content.getAllFields()
Map dataResourceResult = run service: 'createDataResource', with:
[dataResourceTypeId: 'ELECTRONIC_TEXT']