-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Depending from multiselect in backend is broken #30026
Comments
Hi @bjornsnoen. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
🕙 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, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@bjornsnoen, thank you for your report. I've made tests on latest Magento2.3.5p2 and 2.4.0 and was not able to reproduce the issue. I used this code for testing <field id="multiselect_id" translate="label" type="multiselect" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
<label>multiselect_id</label>
<source_model>Magento\Sales\Model\Config\Source\Order\Status</source_model>
</field>
<field id="brand_attribute" type="text" sortOrder="3" showInStore="1" showInWebsite="1" showInDefault="1" translate="label,comment">
<label>Brand attribute</label>
<depends>
<field id="multiselect_id" separator=",">processing</field>
</depends>
</field> @bjornsnoen, please make sure that you can reproduce this issue on the latest Magento version. Let me know if I missed something. |
Hm, I was reproducing it on 2.3.4-p2, and since the broken js is still there in 2.4 I was sure it would still be broken. I guess the functionality may have been amended elsewhere. I'll see if my module will reproduce it on 2.3.5-p2, if it doesn't I'll happily close :) |
@magento give me 2.3-develop instance |
Hi @koushikch7. Thank you for your request. I'm working on Magento instance for you. |
Hi @koushikch7, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later. |
I can reproduce it in 2.4. You have to save the selection first, with a value that is not the preferred value. So in your example you've declared that you depend on the value As soon as you apply my proposed patch, it starts working as expected. I made an empty module in app/code on a clean 2.4 install, and added this system.xml: <?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="general">
<group id="test" showInStore="1" showInWebsite="1" showInDefault="1" type="text" sortOrder="999">
<label>Proof of concept</label>
<field id="multiselect_id" translate="label" type="multiselect" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
<label>multiselect_id</label>
<source_model>Magento\Sales\Model\Config\Source\Order\Status</source_model>
</field>
<field id="brand_attribute" type="text" sortOrder="3" showInStore="1" showInWebsite="1" showInDefault="1" translate="label,comment">
<label>Brand attribute</label>
<depends>
<field id="multiselect_id" separator=",">processing</field>
</depends>
</field>
</group>
</section>
</system>
</config> I've updated steps to reproduce to reflect this. |
@bjornsnoen , I've made re-test and get the same result. It works for me. Maybe the issue related to the specific browser or admin panel locale. |
@ihorvansach in your recording you do not follow the steps to reproduce. After you saved you selected only processing, which indeed works. After saving you have to ctrl-click processing so it is added to your selection instead of replacing the selection. I am using the Brave browser on linux in default us english locale. |
I wonder if this is related to a problem I solved recently on the Tax Rules page. There was an issue with the jquery.multiselect.js module that is used in Admin, where it internally uses !!.attr('checked') to see which items are selected and which aren't. Seems that under certain circumstances attr works correctly, and under others it doesn't, so when you select an item, the multiselect does not reflect that it is selected, even though it looks it on screen. If you delve into the html, you will see the html list for the onscreen part with css set to selected when you select an item, but there is also a hidden set of I see under certain docs, .attr is deprecated. And I also see the jquery.multiselect module hasn't been updated in 8 years. I changed the code to use checkbox.is(':checked') instead of attr and havent had problems since. I could never reproduce it with vanilla magento for some reason, but would fail 100% of the time on my dev node. My fix is here
Let me know if you think it may be this? It sounds familiar, and being JS, is browser specific, which may explain why you cannot reproduce reliably. I posted about it on slack. https://magentocommeng.slack.com/archives/CJCB7G0KZ/p1600801179000800 Edit: I've re-read the previous posts and this doen't look like what is going on, but I'll leave it here for reference just in case. |
@magento give me 2.4-develop instance |
Hi @bjornsnoen. Thank you for your request. I'm working on Magento instance for you. |
Hi @bjornsnoen, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later. |
Hi @engcom-November. Thank you for working on this issue.
|
Hello @bjornsnoen, Thank you for the report and collaboration1 Verified this issue on 2.4-develop. Please take a look at the screencast below: Screen.Recording.2024-03-08.at.2.18.01.PM.movHere we can see selecting all the options should have revealed the field. Please find the attached module used to reproduce this issue. Thank you. |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-11547 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-November. Thank you for verifying the issue. |
Hello! Glad to see this issue is now being looked into. I have not worked on magento in a few years at this point and am not set up to do any follow-up, but again I'm glad it's being looked into. No need to tag me in any further updates. |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
The text was updated successfully, but these errors were encountered: