MAGETWO-81311: Check the length of the array before attempting to sli… - #11637
Merged
Merged
Conversation
…ce it. Slicing an array of one will create an empty result. Issue: 9944
Contributor
|
|
||
| scope = this.dataScope; | ||
| name = scope.split('.').slice(1); | ||
| name = scope.split('.').length > 1 ? scope.split('.').slice(1) : scope.split('.'); |
Contributor
There was a problem hiding this comment.
I think would be great to extract scope.split('.') to variable in order not to calculate it 3 times
…. scope variable is not used anywhere else except on the next line. Issue: 9944
magento-team
pushed a commit
that referenced
this pull request
Oct 26, 2017
magento-team
pushed a commit
that referenced
this pull request
Oct 26, 2017
[EngCom] Public Pull Requests - 2.2-develop - MAGETWO-82724 Allow coupon code with special charater to be applied to order in checkout #11710 - MAGETWO-82675 Add a health check to the NGINX configuration sample #11690 - MAGETWO-82562 Coupon codes not showing in invoice #11635 - MAGETWO-82535 Fixed ability to set field config from layout xml #11302 [backport 2.2] #11643 - MAGETWO-81146 Fixing #10275 keyboard submit of adminhtml suggest form. #11250 - MAGETWO-82761 [Backport 2.2-develop] Dashboard Fix Y Axis for range #11751 - MAGETWO-82748 Fix Notice: freePackageValue is undefined #11720 - MAGETWO-82747 [TASK] Updated user.ini according to Magento DevDocs #11734 - MAGETWO-82537 MAGETWO-81311: Check the length of the array before attempting to sli… #11637 - MAGETWO-81970 Add missing translations in Magento_UI #11440 - MAGETWO-81904 FIX #11022 in 2.2-develop: Filter Groups of search criteria parameter have not been included for further processing #11421 - MAGETWO-82179 Fix Filter Customer Report Review 2.2-develop [Backport] #11522
altdovydas
pushed a commit
to altdovydas/magento2
that referenced
this pull request
Aug 6, 2026
Applied pull request patch https://github.com/magento/magento2/pull/11637.patch (created by @briscoda) based on commit(s): 1. 1623a22 2. 1951f07 3. 08c61ac Fixed GitHub Issues in 2.3-develop branch: - magento#9944: Name attribute shows empty when creating custom fields on product creation form (reported by @PatrickSH)
altdovydas
pushed a commit
to altdovydas/magento2
that referenced
this pull request
Aug 6, 2026
Applied pull request patch https://github.com/magento/magento2/pull/11637.patch (created by @briscoda) based on commit(s): 1. 1623a22 2. 1951f07 3. 08c61ac Fixed GitHub Issues in 2.3-develop branch: - magento#9944: Name attribute shows empty when creating custom fields on product creation form (reported by @PatrickSH)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ce it. Slicing an array of one will create an empty result. Issue: 9944
Description
#9944
In the UI form element abstract.js, there is a case where the dataScope passed to the initConfig function may not have the string "data" appended to the name. In this case, performing a 'slice' on an array of 1 will create an empty result. In these cases, I have added a check to ensure that the array is at least greater than 1 before slicing, otherwise, use the result of splitting the scope variable.
In these cases you will always end of with something like:
["data_value"] or ["data_value", "data_value_two"]
Instead of a potential: [], which when used as the inputName would result in an empty input name attribute on the form element.
Fixed Issues (if relevant)
Manual testing scenarios
Contribution checklist