[MGNLUI-7011] Since 6.2.15 allowedMimeTypePattern is required for the uploadField else a NPE is thrown Created: 13/Jan/22  Updated: 13/Jan/22  Resolved: 13/Jan/22

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

Type: Bug Priority: Minor
Reporter: Antonio Tuor Assignee: Unassigned
Resolution: Not an issue Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2022-01-13-11-14-43-262.png    
Issue Links:
Problem/Incident
is caused by MGNLUI-6894 MimeType restriction for upload field... 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:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:

 Description   

Steps to reproduce

  1. Create a uploadField dialog without adding an allowedMimeTypePattern (According to https://docs.magnolia-cms.com/product-docs/6.2/Templating/Dialog-definition/Field-definition/List-of-fields/Upload-field.html#_common_upload_field_properties it is optional!)
  2. Upload any file
  3. A NPE is thrown:
  4. The file is uploaded and can be used anyway

Expected results

It's still possible to use the uploadField without defining an allowedMimeTypePattern and no error is thrown!

Actual results

The uploadField can be used without defining an allowedMimeTypePattern and a NPE error is thrown.

Workaround

Define an allowedMimeTypePattern on all uploadFields that don't have one yet!

Development notes

This Bug was introduced with https://jira.magnolia-cms.com/browse/MGNLUI-6894



 Comments   
Comment by Antonio Tuor [ 13/Jan/22 ]

Okay, the problem was that the allowedMimeTypePattern was wrong, as soon as I corrected/removed the wrong pattern, it worked!

Comment by Mercedes Iruela [ 13/Jan/22 ]

Hello Antonio,

I tested it and it is working as expected. I am glad that were also able to figure out the issue and make it work.

I am closing the ticket then.

Best regards.

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