[MGNLUI-5886] 2 or more UploadFields cannot be used in the same App or Dialog Created: 21/May/20  Updated: 18/Jan/22  Resolved: 18/Sep/20

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.1
Fix Version/s: 6.2.4

Type: Bug Priority: Neutral
Reporter: Mercedes Iruela Assignee: Šimon Demočko
Resolution: Not an issue Votes: 1
Labels: M6-UI-2
Remaining Estimate: Not Specified
Time Spent: 1.5h
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2020-05-21 at 13.31.58.png     Zip Archive lm.zip    
Issue Links:
Cloners
is cloned by MGNLDAM-880 CLONE - 2 or more DamUploadFields can... Closed
Problem/Incident
causes MGNLUI-7017 Model content with file/binary proper... Accepted
Relates
relates to MGNLUI-6221 Default to jcrChildNodeProvider in Jc... Closed
causality
caused by MGNLUI-5656 Improve Upload Field implementation Closed
documentation
to be documented by MGNLUI-6215 DOC: Restructure uploadField document... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: UI framework: forms, dialogs, content editing
Sprint: UI FW 10, UI FW 11
Story Points: 5

 Description   

When more than to upload fields are defined in a Content app or in a dialog, when the dialog is saved just one of the uploaded files is saved. Upload fields save many properties, this properties are saved in JCR as separately properties instead as node with this properties. To do it the docu was follow: https://documentation.magnolia-cms.com/display/DOCS62/Upload+field

Steps to reproduce
1. Create a content app with two upload fields (see attached example).
2. Open the app and create a new item uploading two diferent files.
3. Save the new item.
4. Open the item to edit it. Both upload fields are displaying the same file.

Expected results
Both uploaded files are stored separately and when opening the item to edit, both uploaded files are displayed.

Actual results
Only one of the uploaded files are stored in JCR, the last one.

Workaround
Not using two or more upload fields in the same dialog.
Using info provided in MGNLUI-5656 it is working (maybe it was not documented??):

upload:
 class: info.magnolia.ui.editor.UploadViewDefinition
 required: true
 itemProvider:
 $type: jcrChildNodeProvider
 nodeName: image1

Development notes
In JCR everything is stored at item level, the upload field name is not taken into account. It means that when storing the second uploaded file, the first values are overriden.

damUploadField is also affected - MGNLDAM-880



 Comments   
Comment by Šimon Demočko [ 08/Sep/20 ]

Notes:

  • UploadField uploading directly to app's workspace has drawbacks. (see below) Shouldn't we deprecate $type uploadField in favour of damUploadField?
    • does not centralize "assets" to a single "asset" workspace, which can be problematic, if you want to migrate data to an external DAM.
    • exports with binaries throw an exception unless configured to XML exports
    • binaries enlarge workspace's spatial needs (might not be an issue)
  • Docs will require update:
Comment by Šimon Demočko [ 16/Sep/20 ]

I had summarized the necessary changes into a split ticket MGNLUI-6215. It started being bulky.

Generated at Mon Feb 12 09:31:01 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.