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/15 13:23:29 UTC

(ofbiz-framework) branch release24.09 updated: Fixed: Two regressions in the minilang-to-Groovy conversion of ContentServicesScript.groovy (OFBIZ-13589)

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 c4d19d6146 Fixed: Two regressions in the minilang-to-Groovy conversion of ContentServicesScript.groovy (OFBIZ-13589)
c4d19d6146 is described below

commit c4d19d614649a53fa080de46c17e281d9cee2348
Author: Mridul Pathak <mr...@gmail.com>
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 5ab0132e9e..08cdee9878 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
@@ -594,6 +594,7 @@ Map createMissingContentAltUrls() {
     if (parameters.webSiteId) {
         from('WebSiteContent')
                 .where(webSiteId: parameters.webSiteId)
+                .filterByDate()
                 .getFieldList('contentId')
                 .each { String contentId ->
                     contentCreatedList.addAll(createMissingContentAltUrlInline(contentId))
@@ -703,7 +704,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']