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

Image uploader does not work inside dynamic rows #37957

Closed
5 tasks
ilnytskyi opened this issue Sep 5, 2023 · 6 comments · Fixed by #38074
Closed
5 tasks

Image uploader does not work inside dynamic rows #37957

ilnytskyi opened this issue Sep 5, 2023 · 6 comments · Fixed by #38074
Assignees
Labels
Area: UI Framework Component: Ui Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.5 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

@ilnytskyi
Copy link
Contributor

Preconditions and environment

  • Magento 2.4.5

Steps to reproduce

  1. Create a dynamicRows component with field of type "imageUploader"
<fieldset name="top_icons_list" sortOrder="20">
        <settings>
            <label translate="true">Top Icons List</label>
            <collapsible>true</collapsible>
            <opened>false</opened>
            <dataScope>ui_config.top_icons_list</dataScope>
        </settings>
        <container name="top_icons_list_items_container">
            <dynamicRows name="items">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="template" xsi:type="string">ui/dynamic-rows/templates/default</item>
                        <item name="componentType" xsi:type="string">dynamicRows</item>
                        <item name="recordTemplate" xsi:type="string">record</item>
                        <item name="addButton" xsi:type="boolean">true</item>
                        <item name="deleteProperty" xsi:type="boolean">true</item>
                        <item name="dndConfig" xsi:type="array">
                            <item name="enabled" xsi:type="boolean">true</item>
                        </item>
                        <item name="additionalClasses" xsi:type="array">
                            <item name="action-per-product-table" xsi:type="boolean">true</item>
                        </item>
                    </item>
                </argument>
                <container name="record">
                    <argument name="data" xsi:type="array">
                        <item name="config" xsi:type="array">
                            <item name="component" xsi:type="string" translate="true">Magento_Ui/js/dynamic-rows/record</item>
                            <item name="isTemplate" xsi:type="boolean">true</item>
                            <item name="is_collection" xsi:type="boolean">true</item>
                            <item name="showFallbackReset" xsi:type="boolean">false</item>
                        </item>
                    </argument>
                    <field name="icon" sortOrder="40" formElement="imageUploader">
                        <argument name="data" xsi:type="array">
                            <item name="config" xsi:type="array">
                                <item name="source" xsi:type="string">page_ui_config</item>
                            </item>
                        </argument>
                        <settings>
                            <elementTmpl>ui/form/element/uploader/image</elementTmpl>
                            <dataType>string</dataType>
                            <label translate="true">Image</label>
                            <visible>true</visible>
                            <required>true</required>
                        </settings>
                        <formElements>
                            <imageUploader>
                                <settings>
                                    <required>false</required>
                                    <uploaderConfig>
                                        <param xsi:type="url" name="url" path="cms_page_ui_config/cmsPageUiConfig_image/homePageUpload"/>
                                    </uploaderConfig>
                                    <isMultipleFiles>false</isMultipleFiles>
                                    <previewTmpl>Magento_Catalog/image-preview</previewTmpl>
                                    <openDialogTitle>Media Gallery</openDialogTitle>
                                    <initialMediaGalleryOpenSubpath>my_path/my_path</initialMediaGalleryOpenSubpath>
                                    <allowedExtensions>jpg jpeg gif png</allowedExtensions>
                                    <maxFileSize>4194304</maxFileSize>
                                </settings>
                            </imageUploader>
                        </formElements>
                    </field>
                    <field name="label" sortOrder="50" formElement="input">
                        <argument name="data" xsi:type="array">
                            <item name="config" xsi:type="array">
                                <item name="source" xsi:type="string">page_ui_config</item>
                            </item>
                        </argument>
                        <settings>
                            <dataType>text</dataType>
                            <label translate="true">Label</label>
                            <dataScope>label</dataScope>
                        </settings>
                    </field>
                    <field name="description" sortOrder="60" formElement="textarea">
                        <argument name="data" xsi:type="array">
                            <item name="config" xsi:type="array">
                                <item name="source" xsi:type="string">page_ui_config</item>
                            </item>
                        </argument>
                        <settings>
                            <dataType>text</dataType>
                            <label translate="true">Description</label>
                            <dataScope>description</dataScope>
                        </settings>
                    </field>
                    <actionDelete>
                        <argument name="data" xsi:type="array">
                            <item name="config" xsi:type="array">
                                <item name="componentType" xsi:type="string">actionDelete</item>
                                <item name="dataType" xsi:type="string">text</item>
                                <item name="fit" xsi:type="boolean">false</item>
                                <item name="label" xsi:type="string">Actions</item>
                                <item name="additionalClasses" xsi:type="string">data-grid-actions-cell</item>
                                <item name="template" xsi:type="string">Magento_Backend/dynamic-rows/cells/action-delete
                                </item>
                            </item>
                        </argument>
                    </actionDelete>
                </container>
            </dynamicRows>
        </container>
    </fieldset>
  1. Try to upload an image
  2. See this error:
    Selection_648

Expected result

The images are uploaded correctly when sent as multinational array

Actual result

The Uploader class gets an undefined index error due to input name referring file id as multinational array and sent via $_FILES as multinational array as well. But the reader does not handle this case.

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”.
@m2-assistant
Copy link

m2-assistant bot commented Sep 5, 2023

Hi @ilnytskyi. 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 Reported on 2.4.5 Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it labels Sep 5, 2023
@engcom-Hotel engcom-Hotel self-assigned this Sep 26, 2023
@m2-assistant
Copy link

m2-assistant bot commented Sep 26, 2023

Hi @engcom-Hotel. 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-Hotel
Copy link
Contributor

Hello @ilnytskyi,

Thanks for the report and collaboration!

We have tried to reproduce the issue in the 2.4-develop branch and the issue is reproducible for us. Please have a look at the below screenshot for reference:

image

Hence confirming the issue.

Thanks

@engcom-Hotel engcom-Hotel 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 Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Area: UI Framework and removed Issue: ready for confirmation labels Sep 26, 2023
@github-jira-sync-bot
Copy link

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

@m2-assistant
Copy link

m2-assistant bot commented Sep 26, 2023

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

@rostilos
Copy link
Contributor

@magento I am working on this

This issue was closed.
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: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.5 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
Development

Successfully merging a pull request may close this issue.

5 participants