You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2026/09/15 13:22:00 UTC
[jira] [Commented] (OFBIZ-13589) copyContentAndElectronicTextandAssoc mutates a cached entity in place
[ https://issues.apache.org/jira/browse/OFBIZ-13589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18115595#comment-18115595 ]
ASF subversion and git services commented on OFBIZ-13589:
---------------------------------------------------------
Commit 896b4e6fb81743e3543148cd8dd392983fe7d802 in ofbiz-framework's branch refs/heads/trunk from Mridul Pathak
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=896b4e6fb8 ]
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.
> copyContentAndElectronicTextandAssoc mutates a cached entity in place
> ---------------------------------------------------------------------
>
> Key: OFBIZ-13589
> URL: https://issues.apache.org/jira/browse/OFBIZ-13589
> Project: OFBiz
> Issue Type: Bug
> Components: content
> Affects Versions: Upcoming Branch, 24.09.07
> Reporter: Mridul Pathak
> Assignee: Mridul Pathak
> Priority: Major
>
> {{copyContentAndElectronicTextandAssoc}} assigns {{content}} directly from a cached view ({{ContentWorker.getContentCache()}}) and then mutates it in place ({{content.dataResourceId = ...}}) to build the copy. The original minilang did an explicit {{<clone-value>}} immediately after fetching, specifically to detach from that cached instance before mutating. As written, copying any {{Content}} record silently corrupts the shared, cached {{ContentDataResourceView}} entry for the original {{contentId}} in-memory, pointing it at the new copy's {{DataResource}} until the cache entry is evicted.
> Separately, in the same file, {{createMissingContentAltUrls}}'s {{WebSiteContent}} lookup is missing a {{.filterByDate()}} the original minilang had, so expired associations are now also processed (over-processing only, no data loss — lower priority, bundled here since it's the same file).
> Needs fixing: clone the fetched {{content}} value before mutating it in {{copyContentAndElectronicTextandAssoc}}; add back {{.filterByDate()}} on the {{WebSiteContent}} lookup in {{createMissingContentAltUrls}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)