You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Mridul Pathak (Jira)" <ji...@apache.org> on 2026/09/15 13:25:00 UTC

[jira] [Closed] (OFBIZ-13589) copyContentAndElectronicTextandAssoc mutates a cached entity in place

     [ https://issues.apache.org/jira/browse/OFBIZ-13589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mridul Pathak closed OFBIZ-13589.
---------------------------------
    Fix Version/s: Upcoming Branch
                   24.09.08
       Resolution: Fixed

> 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
>             Fix For: Upcoming Branch, 24.09.08
>
>
> {{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)