You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by GitBox <gi...@apache.org> on 2026/09/03 17:42:02 UTC

[GH] (ofbiz-framework/update-layout-image-fix): Workflow run "Java CI with Gradle" failed!

The GitHub Actions job "Java CI with Gradle" on ofbiz-framework.git/update-layout-image-fix has failed.
Run started by GitHub user Krishnauprit18 (triggered by ashishvijaywargiya).

Head commit for run:
65957b976bc7b55d006c732b48ed690a1c01f1bc / Krishna Uprit <kr...@gmail.com>
Improved: Route the layout-image events through the permission-checked content services and tighten data resource template rendering

updateLayoutImage and cloneLayout maintained DataResource, ImageDataResource
and Content records by storing the entities directly, so their writes did not
pass the permission checks that updateContent / updateDataResource /
createDataResource apply everywhere else in the content component. In
particular updateLayoutImage copied caller-supplied multipart fields onto an
existing DataResource with setNonPKFields(), which could change a resource's
dataResourceTypeId / dataTemplateTypeId. updateLayoutImageOnly was mapped in
the controller but has no implementing method. createDataTemplateType and
its update / delete siblings had no permission declaration.

DataResourceWorker.renderDataResourceAsText also had no restriction on the
data resource source type it would hand to a template engine for
SCREEN_COMBINED / FORM_COMBINED / XSLT, and only a three-type deny list for
FTL. For an *_OBJECT data resource getDataResourceText() returns the data
resource's primary key rather than template text, and the SCREEN_COMBINED
branch built a ModelScreen from screen XML stored in the data resource text.

Changes:
 * updateLayoutImage writes the editable image metadata through the
   updateDataResource service and the image bytes through
   create/updateImageDataResource - all permission-checked, no direct entity
   writes. A target that is template-bearing, or that is not an IMAGE_OBJECT,
   is rejected rather than converted, so the event can no longer reclassify a
   resource. This aligns it with the change updateLayout received in OFBIZ #1745.
 * cloneLayout still copies Content / DataResource / ContentAssoc directly for
   the clone-master step; that write is now gated by an explicit CONTENTMGR
   create check, plus CONTENTMGR_SUPER when the source data resource is
   template-bearing. Routing it through services is left as follow-up.
 * The unused updateLayoutImageOnly request-map is removed.
 * createDataTemplateType / updateDataTemplateType / deleteDataTemplateType
   require CONTENTMGR_SUPER, consistent with the other template-related
   content services.
 * DataResourceWorker no longer renders an *_OBJECT data resource as any
   template type. FTL rendering is limited to an allow-list of file- and
   URL-backed source types (each already path- or protocol-restricted)
   instead of a deny list, so a source type added later is not renderable by
   default. SCREEN_COMBINED is rendered only from a deployed component://
   screen location referenced via objectInfo.

Added UpdateLayoutPermissionTests coverage for the updateLayoutImage /
cloneLayout write paths for a user whose only grants are OFBTOOLS_VIEW and
CONTENTMGR_VIEW.

Report URL: https://github.com/apache/ofbiz-framework/actions/runs/33762885866

With regards,
GitHub Actions via GitBox