Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ui Component File Field #38908

Open
5 tasks
thomas-kl1 opened this issue Jul 8, 2024 · 11 comments · May be fixed by #39004
Open
5 tasks

Ui Component File Field #38908

thomas-kl1 opened this issue Jul 8, 2024 · 11 comments · May be fixed by #39004
Assignees
Labels
Area: UI Framework Component: Ui Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: PR in progress Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@thomas-kl1
Copy link
Member

Preconditions and environment

  • Latest Magento version

Steps to reproduce

Add the following field in a ui component form:

<file name="file">
            <settings>
                <label translate="true">Select File to Import</label>
                <dataScope>file</dataScope>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">true</rule>
                </validation>
            </settings>
        </file>

Expected result

The form is submitted without error.

Actual result

Even if we select a file, the validation fails, like no file was selected.
h
346533395-e1667aa9-ca43-4516-8b18-53967a2fc682

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented Jul 8, 2024

Hi @thomas-kl1. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@engcom-Bravo engcom-Bravo added Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it Reported on 2.4.x Indicates original Magento version for the Issue report. labels Jul 9, 2024
@engcom-November engcom-November self-assigned this Jul 9, 2024
Copy link

m2-assistant bot commented Jul 9, 2024

Hi @engcom-November. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-November
Copy link
Contributor

Hello @thomas-kl1,

Thank you for the report and collaboration!

We did not see the error while using the fileUploader component:

<field name="file">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="required" xsi:type="boolean">true</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                    <item name="sortOrder" xsi:type="number">333</item>
                    <item name="formElement" xsi:type="string">fileUploader</item>
                    <item name="label" xsi:type="string" translate="true">add file</item>
                </item>
            </argument>
</field>

Can you please check and let us know if this is working at your end.

Thank you.

@engcom-November engcom-November added the Issue: needs update Additional information is require, waiting for response label Jul 9, 2024
@thomas-kl1
Copy link
Member Author

thomas-kl1 commented Jul 9, 2024

fileUploader and file are two different component.

The file component allows to select a file without uploading it right away.

@engcom-November
Copy link
Contributor

It is recommended to use fileUploader, but in case if you are using file component for some specific use case, can you let us know the same.

@thomas-kl1
Copy link
Member Author

Could you elaborate why it's not recommended? It's not mentioned in the documentation.

I use file component because I don't feel the need to split the form submission in two parts. The file uploader component requires to have an upload ajax route. So it adds extra work to cleanup uploaded files if the user finally didn't submitted the form.

@engcom-November
Copy link
Contributor

Yes file component can minimize the extra work needed for ajax, so confirming this issue.

@engcom-November engcom-November added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Component: Ui Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: UI Framework labels Jul 11, 2024
@m2-community-project m2-community-project bot removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Jul 11, 2024
@m2-community-project m2-community-project bot removed the Issue: needs update Additional information is require, waiting for response label Jul 11, 2024
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-12432 is successfully created for this GitHub issue.

@m2-community-project m2-community-project bot added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Jul 11, 2024
Copy link

m2-assistant bot commented Jul 11, 2024

✅ Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@engcom-November engcom-November added the Priority: P3 May be fixed according to the position in the backlog. label Jul 11, 2024
@github-jira-sync-bot
Copy link

❌ You don't have permission to export this issue.

@Mohamed-Asar
Copy link
Contributor

@magento I am working on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: UI Framework Component: Ui Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: PR in progress Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Status: Pull Request In Progress
Development

Successfully merging a pull request may close this issue.

5 participants