From c975f96adbac9563154bc24b6d75481208a92985 Mon Sep 17 00:00:00 2001 From: Arthur James <11641990+ArtiDjeims@users.noreply.github.com> Date: Thu, 3 May 2018 13:58:55 +0300 Subject: [PATCH 01/11] Fixed Overlay Problems --- .../Magento/luma/Magento_Theme/web/css/source/_module.less | 1 + 1 file changed, 1 insertion(+) diff --git a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less index fd004ef2c14d9..b5742b86cf9f1 100644 --- a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less @@ -528,6 +528,7 @@ .header.links { min-width: 175px; + z-index: 1000; } &.active { From 2d75f2522110d4bdf356b73145c2615596bca970 Mon Sep 17 00:00:00 2001 From: Neill Robson Date: Sun, 18 Mar 2018 16:35:39 -0400 Subject: [PATCH 02/11] clarify XSD for formElements allowed settings In an attempt to resolve #14140, new complex types have been defined for every UI component specified in `ui_settings.xsd` line 49 (valid attribute codes for "formElement"). These complex types only include the `` child node, along with any grandchildren that pertain specifically to that form element (no `abstractSettings`). Finally, `ui_configuration.xsd` has been updated with a new group holding these complex types, and the corresponding validation for the `` tag references this new group rather than the existing, more general group. --- app/code/Magento/Ui/etc/ui_configuration.xsd | 22 ++++++++++++++++++- .../ui_component/etc/definition/boolean.xsd | 14 +++++++++++- .../ui_component/etc/definition/checkbox.xsd | 14 +++++++++++- .../etc/definition/checkboxset.xsd | 14 +++++++++++- .../base/ui_component/etc/definition/date.xsd | 14 +++++++++++- .../ui_component/etc/definition/email.xsd | 14 +++++++++++- .../base/ui_component/etc/definition/file.xsd | 14 +++++++++++- .../ui_component/etc/definition/hidden.xsd | 14 +++++++++++- .../ui_component/etc/definition/input.xsd | 13 ++++++++++- .../etc/definition/multiselect.xsd | 13 +++++++++++ .../ui_component/etc/definition/radioset.xsd | 14 +++++++++++- .../ui_component/etc/definition/select.xsd | 14 +++++++++++- .../base/ui_component/etc/definition/text.xsd | 14 +++++++++++- .../ui_component/etc/definition/textarea.xsd | 14 +++++++++++- .../ui_component/etc/definition/wysiwyg.xsd | 14 +++++++++++- 15 files changed, 202 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/Ui/etc/ui_configuration.xsd b/app/code/Magento/Ui/etc/ui_configuration.xsd index 6847f226dd609..7ec765043e67b 100644 --- a/app/code/Magento/Ui/etc/ui_configuration.xsd +++ b/app/code/Magento/Ui/etc/ui_configuration.xsd @@ -209,6 +209,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -287,7 +307,7 @@ - + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/boolean.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/boolean.xsd index 7cc33cf4351df..e321174875ff5 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/boolean.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/boolean.xsd @@ -15,6 +15,7 @@ + @@ -23,9 +24,20 @@ + + + + + + + + + + + + - diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkbox.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkbox.xsd index 13bc629606470..22afa050402cb 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkbox.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkbox.xsd @@ -15,6 +15,7 @@ + @@ -23,9 +24,20 @@ + + + + + + + + + + + + - diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkboxset.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkboxset.xsd index b0dea52cb4bd9..03fdb2c783858 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkboxset.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkboxset.xsd @@ -15,6 +15,7 @@ + @@ -23,9 +24,20 @@ + + + + + + + + + + + + - diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/date.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/date.xsd index b24ba626a9ea1..962c66dedd948 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/date.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/date.xsd @@ -15,6 +15,7 @@ + @@ -23,9 +24,20 @@ + + + + + + + + + + + + - diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/email.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/email.xsd index cd1147b560034..d70bf3d793d5f 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/email.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/email.xsd @@ -15,6 +15,7 @@ + @@ -23,9 +24,20 @@ + + + + + + + + + + + + - diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/file.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/file.xsd index eac284ddc92d8..99581ea0da51a 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/file.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/file.xsd @@ -15,6 +15,7 @@ + @@ -23,9 +24,20 @@ + + + + + + + + + + + + - diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/hidden.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/hidden.xsd index 82282dd61673f..c077d75e17326 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/hidden.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/hidden.xsd @@ -15,6 +15,7 @@ + @@ -23,9 +24,20 @@ + + + + + + + + + + + + - diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/input.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/input.xsd index fc3ea2d92576a..b72ec30fda78b 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/input.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/input.xsd @@ -15,6 +15,7 @@ + @@ -23,6 +24,17 @@ + + + + + + + + + + + @@ -73,7 +85,6 @@ - diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/multiselect.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/multiselect.xsd index 28d9d24868820..d11830a3e5885 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/multiselect.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/multiselect.xsd @@ -15,6 +15,7 @@ + @@ -23,6 +24,18 @@ + + + + + + + + + + + + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/radioset.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/radioset.xsd index c53ad0333d6d7..bf7f34f7a8324 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/radioset.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/radioset.xsd @@ -15,6 +15,7 @@ + @@ -23,9 +24,20 @@ + + + + + + + + + + + + - diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/select.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/select.xsd index 7e0d2dfbfeb18..3b379c926f7ac 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/select.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/select.xsd @@ -15,6 +15,7 @@ + @@ -29,9 +30,20 @@ + + + + + + + + + + + + - diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/text.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/text.xsd index e382af84111c7..72c122a47ce7b 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/text.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/text.xsd @@ -15,6 +15,7 @@ + @@ -23,9 +24,20 @@ + + + + + + + + + + + + - diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/textarea.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/textarea.xsd index ad7fda6200a79..a37dbdb71a05b 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/textarea.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/textarea.xsd @@ -15,6 +15,7 @@ + @@ -23,9 +24,20 @@ + + + + + + + + + + + + - diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/wysiwyg.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/wysiwyg.xsd index 62c81234aba33..cdda4267dc582 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/wysiwyg.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/wysiwyg.xsd @@ -15,6 +15,7 @@ + @@ -23,9 +24,20 @@ + + + + + + + + + + + + - From b32a33a804db93caf2d61a2b4bc69f9ca9a1d8b4 Mon Sep 17 00:00:00 2001 From: Neill Robson Date: Mon, 19 Mar 2018 19:14:52 -0400 Subject: [PATCH 03/11] Add empty price settings group in XSD I did a bit of code digging but couldn't figure out why the price component definition did not have any valid/configured child nodes for whatsoever. I decided that the best route would be to add blank groups with the proper labels, so that the actual validation results remain unchanged, but the skeleton now exists for future developers to add valid configuration. --- .../ui_component/etc/definition/price.xsd | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/price.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/price.xsd index 5a3053e59be95..4c7c7d1488547 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/price.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/price.xsd @@ -12,7 +12,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + From 56c760950d7b83bb7e4f52cf5624add0e6e3a659 Mon Sep 17 00:00:00 2001 From: Neill Robson Date: Mon, 26 Mar 2018 19:29:47 -0400 Subject: [PATCH 04/11] Add FileUploader form element XSD definition I'm not sure if the solution proposed in this commit is correct, but I couldn't figure out any more logical way to deal with the validation errors on the Travis CI build. The error follows: 1) Magento\Test\Integrity\Xml\SchemaTest::testXmlFiles Passed: 1881, Failed: 6, Incomplete: 0, Skipped: 0. Data set: /app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml Error validating /home/travis/build/magento/magento2/app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml against urn:magento:module:Magento_Ui:etc/ui_configuration.xsd Array ( [0] => Element 'fileUploader': This element is not expected. Expected is one of ( hidden, file, input, date, boolean, checkbox, checkboxset, email, select, multiselect ). Line: 168 [1] => Element 'wysiwyg', attribute 'class': The attribute 'class' is not allowed. Line: 206 ) Failed asserting that an array is empty. Element zero in that array is what I am attempting to fix here. --- app/code/Magento/Ui/etc/ui_configuration.xsd | 1 + .../ui_component/etc/definition/fileUploader.xsd | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/app/code/Magento/Ui/etc/ui_configuration.xsd b/app/code/Magento/Ui/etc/ui_configuration.xsd index 7ec765043e67b..05b83b4630648 100644 --- a/app/code/Magento/Ui/etc/ui_configuration.xsd +++ b/app/code/Magento/Ui/etc/ui_configuration.xsd @@ -226,6 +226,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/fileUploader.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/fileUploader.xsd index 3181a7ab673cd..664a2d0e8d904 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/fileUploader.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/fileUploader.xsd @@ -23,6 +23,19 @@ + + + + + + + + + + + + + From 64adba9cc85aafe0050fb2aa7559d520111f759b Mon Sep 17 00:00:00 2001 From: Neill Robson Date: Mon, 26 Mar 2018 19:33:12 -0400 Subject: [PATCH 05/11] Add attributes to form element XSD definitions Without this part of the configuration, children of nodes can not have their attributes (such as "class") configured. --- .../Magento/Ui/view/base/ui_component/etc/definition/boolean.xsd | 1 + .../Ui/view/base/ui_component/etc/definition/checkbox.xsd | 1 + .../Ui/view/base/ui_component/etc/definition/checkboxset.xsd | 1 + .../Magento/Ui/view/base/ui_component/etc/definition/date.xsd | 1 + .../Magento/Ui/view/base/ui_component/etc/definition/email.xsd | 1 + .../Magento/Ui/view/base/ui_component/etc/definition/file.xsd | 1 + .../Magento/Ui/view/base/ui_component/etc/definition/hidden.xsd | 1 + .../Magento/Ui/view/base/ui_component/etc/definition/input.xsd | 1 + .../Ui/view/base/ui_component/etc/definition/multiselect.xsd | 1 + .../Magento/Ui/view/base/ui_component/etc/definition/price.xsd | 1 + .../Ui/view/base/ui_component/etc/definition/radioset.xsd | 1 + .../Magento/Ui/view/base/ui_component/etc/definition/select.xsd | 1 + .../Magento/Ui/view/base/ui_component/etc/definition/text.xsd | 1 + .../Ui/view/base/ui_component/etc/definition/textarea.xsd | 1 + .../Magento/Ui/view/base/ui_component/etc/definition/wysiwyg.xsd | 1 + 15 files changed, 15 insertions(+) diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/boolean.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/boolean.xsd index e321174875ff5..21ca445a4177b 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/boolean.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/boolean.xsd @@ -34,6 +34,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkbox.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkbox.xsd index 22afa050402cb..4dfb074498e5b 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkbox.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkbox.xsd @@ -34,6 +34,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkboxset.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkboxset.xsd index 03fdb2c783858..8fa509fa594d6 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkboxset.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/checkboxset.xsd @@ -34,6 +34,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/date.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/date.xsd index 962c66dedd948..a2a8fbbe103c1 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/date.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/date.xsd @@ -34,6 +34,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/email.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/email.xsd index d70bf3d793d5f..648eaf9db5b18 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/email.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/email.xsd @@ -34,6 +34,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/file.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/file.xsd index 99581ea0da51a..1536f752a0aaf 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/file.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/file.xsd @@ -34,6 +34,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/hidden.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/hidden.xsd index c077d75e17326..0e7a6f4ed5fe0 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/hidden.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/hidden.xsd @@ -34,6 +34,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/input.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/input.xsd index b72ec30fda78b..047212f3973e4 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/input.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/input.xsd @@ -34,6 +34,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/multiselect.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/multiselect.xsd index d11830a3e5885..aefb0328c8800 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/multiselect.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/multiselect.xsd @@ -34,6 +34,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/price.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/price.xsd index 4c7c7d1488547..69b936c3e5f8a 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/price.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/price.xsd @@ -33,6 +33,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/radioset.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/radioset.xsd index bf7f34f7a8324..f2db9a57c5a1c 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/radioset.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/radioset.xsd @@ -34,6 +34,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/select.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/select.xsd index 3b379c926f7ac..76d37de771a4c 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/select.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/select.xsd @@ -40,6 +40,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/text.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/text.xsd index 72c122a47ce7b..813ad7870bfe9 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/text.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/text.xsd @@ -34,6 +34,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/textarea.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/textarea.xsd index a37dbdb71a05b..67ee63a3f889f 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/textarea.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/textarea.xsd @@ -34,6 +34,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/wysiwyg.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/wysiwyg.xsd index cdda4267dc582..3e7bbb3a59f8c 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/wysiwyg.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/wysiwyg.xsd @@ -34,6 +34,7 @@ + From 0750a167163e99d65facf8a6acfefd7c059561de Mon Sep 17 00:00:00 2001 From: Neill Robson Date: Tue, 27 Mar 2018 19:46:30 -0400 Subject: [PATCH 06/11] Add button formElement XSD config Again, this error was discovered during the Travis CI build, specifically during validation of /app/code/Magento/Theme/view/adminhtml/ui_component/design_config_form.xml, line 275. --- app/code/Magento/Ui/etc/ui_configuration.xsd | 1 + .../base/ui_component/etc/definition/button.xsd | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/app/code/Magento/Ui/etc/ui_configuration.xsd b/app/code/Magento/Ui/etc/ui_configuration.xsd index 05b83b4630648..73f2ff6cbbc57 100644 --- a/app/code/Magento/Ui/etc/ui_configuration.xsd +++ b/app/code/Magento/Ui/etc/ui_configuration.xsd @@ -227,6 +227,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/button.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/button.xsd index f4b4dd403509f..3c9866e6845e7 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/button.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/button.xsd @@ -23,6 +23,19 @@ + + + + + + + + + + + + + From a6649f83bbe95eee8c55f5b01500365671458cba Mon Sep 17 00:00:00 2001 From: Jeroen Date: Tue, 10 Apr 2018 11:48:49 +0200 Subject: [PATCH 07/11] Add parent item to order item --- .../Sales/Model/Order/ItemRepository.php | 15 ++++++ .../Sales/Model/Order/ItemRepositoryTest.php | 54 +++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Model/Order/ItemRepositoryTest.php diff --git a/app/code/Magento/Sales/Model/Order/ItemRepository.php b/app/code/Magento/Sales/Model/Order/ItemRepository.php index f1bbb7d39469b..7916eb9db2b80 100644 --- a/app/code/Magento/Sales/Model/Order/ItemRepository.php +++ b/app/code/Magento/Sales/Model/Order/ItemRepository.php @@ -117,6 +117,7 @@ public function get($id) } $this->addProductOption($orderItem); + $this->addParentItem($orderItem); $this->registry[$id] = $orderItem; } return $this->registry[$id]; @@ -216,6 +217,20 @@ protected function addProductOption(OrderItemInterface $orderItem) return $this; } + /** + * Set parent item. + * + * @param OrderItemInterface $orderItem + * @throws InputException + * @throws NoSuchEntityException + */ + private function addParentItem(OrderItemInterface $orderItem) + { + if ($parentId = $orderItem->getParentItemId()) { + $orderItem->setParentItem($this->get($parentId)); + } + } + /** * Set product options data * diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ItemRepositoryTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ItemRepositoryTest.php new file mode 100644 index 0000000000000..8f0c255a903b9 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ItemRepositoryTest.php @@ -0,0 +1,54 @@ +order = $objectManager->create(\Magento\Sales\Model\Order::class); + $this->orderItemRepository = $objectManager->create(\Magento\Sales\Api\OrderItemRepositoryInterface::class); + $this->searchCriteriaBuilder = $objectManager->create(\Magento\Framework\Api\SearchCriteriaBuilder::class); + } + + /** + * @magentoDataFixture Magento/Sales/_files/order_configurable_product.php + */ + public function testAddOrderItemParent() + { + $this->order->load('100000001', 'increment_id'); + + foreach ($this->order->getItems() as $item) { + if ($item->getProductType() === \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) { + $orderItem = $this->orderItemRepository->get($item->getItemId()); + $this->assertInstanceOf(\Magento\Sales\Api\Data\OrderItemInterface::class, $orderItem->getParentItem()); + } + } + + $itemList = $this->orderItemRepository->getList( + $this->searchCriteriaBuilder->addFilter('order_id', $this->order->getId())->create() + ); + + foreach ($itemList->getItems() as $item) { + if ($item->getProductType() === \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) { + $this->assertInstanceOf(\Magento\Sales\Api\Data\OrderItemInterface::class, $item->getParentItem()); + } + } + } +} From e3e873816c8928d5876c8879f1867b90263caf4b Mon Sep 17 00:00:00 2001 From: Dmytro Cheshun Date: Sun, 13 May 2018 20:03:47 +0300 Subject: [PATCH 08/11] [Forwardport] Removed unused class declaration and code --- app/code/Magento/Review/view/frontend/templates/redirect.phtml | 3 --- app/code/Magento/Version/Controller/Index/Index.php | 1 - 2 files changed, 4 deletions(-) diff --git a/app/code/Magento/Review/view/frontend/templates/redirect.phtml b/app/code/Magento/Review/view/frontend/templates/redirect.phtml index fc74cadacb319..2fdb5e90a9c18 100644 --- a/app/code/Magento/Review/view/frontend/templates/redirect.phtml +++ b/app/code/Magento/Review/view/frontend/templates/redirect.phtml @@ -8,9 +8,6 @@ ?> getProduct()->getProductUrl()}#info-product_reviews"); exit; ?> diff --git a/app/code/Magento/Version/Controller/Index/Index.php b/app/code/Magento/Version/Controller/Index/Index.php index 5c7c9b619facc..c5d02cd9a1fd2 100644 --- a/app/code/Magento/Version/Controller/Index/Index.php +++ b/app/code/Magento/Version/Controller/Index/Index.php @@ -9,7 +9,6 @@ use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Magento\Framework\App\ProductMetadataInterface; -use Magento\Framework\Exception\StateException; /** * Magento Version controller From 244baef770353323bd61037accd46f0c8093558e Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk Date: Fri, 11 May 2018 21:59:01 +0300 Subject: [PATCH 09/11] Fixed js error when product has double quote in its name --- .../Catalog/view/frontend/templates/product/breadcrumbs.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/breadcrumbs.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/breadcrumbs.phtml index a5d193afd2af4..528b2b5c59f23 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/breadcrumbs.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/breadcrumbs.phtml @@ -11,7 +11,7 @@ $viewModel = $block->getData('viewModel'); "breadcrumbs": { "categoryUrlSuffix": "escapeHtml($viewModel->getCategoryUrlSuffix()); ?>", "useCategoryPathInUrl": isCategoryUsedInProductUrl(); ?>, - "product": "escapeHtml($viewModel->getProductName()); ?>" + "product": "escapeHtml($block->escapeJsQuote($viewModel->getProductName(), '"')); ?>" } }'> From 8ccd5bceff75e1ea148b766aa9e10d902f154bb6 Mon Sep 17 00:00:00 2001 From: Sergey Date: Mon, 14 May 2018 16:22:26 +0300 Subject: [PATCH 10/11] remove MultiDimensionalIndexer from framework --- app/etc/di.xml | 7 -- .../MultiDimensionalIndexer/Alias.php | 56 --------- .../MultiDimensionalIndexer/AliasFactory.php | 40 ------- .../MultiDimensionalIndexer/Dimension.php | 19 --- .../DimensionFactory.php | 40 ------- .../IndexHandlerInterface.php | 36 ------ .../MultiDimensionalIndexer/IndexName.php | 80 ------------- .../IndexNameBuilder.php | 112 ------------------ .../IndexNameResolver.php | 59 --------- .../IndexNameResolverInterface.php | 22 ---- .../IndexStructureInterface.php | 44 ------- .../IndexTableSwitcher.php | 100 ---------------- .../IndexTableSwitcherInterface.php | 23 ---- .../MultiDimensionalIndexer/README.md | 11 -- .../IndexTableSwitcherTest.php | 98 --------------- 15 files changed, 747 deletions(-) delete mode 100644 lib/internal/Magento/Framework/MultiDimensionalIndexer/Alias.php delete mode 100644 lib/internal/Magento/Framework/MultiDimensionalIndexer/AliasFactory.php delete mode 100644 lib/internal/Magento/Framework/MultiDimensionalIndexer/Dimension.php delete mode 100644 lib/internal/Magento/Framework/MultiDimensionalIndexer/DimensionFactory.php delete mode 100644 lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexHandlerInterface.php delete mode 100644 lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexName.php delete mode 100644 lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexNameBuilder.php delete mode 100644 lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexNameResolver.php delete mode 100644 lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexNameResolverInterface.php delete mode 100644 lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexStructureInterface.php delete mode 100644 lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexTableSwitcher.php delete mode 100644 lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexTableSwitcherInterface.php delete mode 100644 lib/internal/Magento/Framework/MultiDimensionalIndexer/README.md delete mode 100644 lib/internal/Magento/Framework/Test/Unit/MultiDimensionalIndexer/IndexTableSwitcherTest.php diff --git a/app/etc/di.xml b/app/etc/di.xml index 6f9b26af943b1..6e3dabaa0751f 100755 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -178,8 +178,6 @@ - - @@ -1396,11 +1394,6 @@ - - - Magento\Framework\Indexer\ScopeResolver\IndexScopeResolver - - diff --git a/lib/internal/Magento/Framework/MultiDimensionalIndexer/Alias.php b/lib/internal/Magento/Framework/MultiDimensionalIndexer/Alias.php deleted file mode 100644 index 9b7e2f3dde9b7..0000000000000 --- a/lib/internal/Magento/Framework/MultiDimensionalIndexer/Alias.php +++ /dev/null @@ -1,56 +0,0 @@ - $value])); - } - $this->value = $value; - } - - /** - * @return string One of self::ALIAS_* - */ - public function getValue(): string - { - return $this->value; - } -} diff --git a/lib/internal/Magento/Framework/MultiDimensionalIndexer/AliasFactory.php b/lib/internal/Magento/Framework/MultiDimensionalIndexer/AliasFactory.php deleted file mode 100644 index aa65736bca817..0000000000000 --- a/lib/internal/Magento/Framework/MultiDimensionalIndexer/AliasFactory.php +++ /dev/null @@ -1,40 +0,0 @@ -objectManager = $objectManager; - } - - /** - * @param array $arguments - * @return Alias - */ - public function create(array $arguments = []): Alias - { - return $this->objectManager->create(Alias::class, $arguments); - } -} diff --git a/lib/internal/Magento/Framework/MultiDimensionalIndexer/Dimension.php b/lib/internal/Magento/Framework/MultiDimensionalIndexer/Dimension.php deleted file mode 100644 index 7cfafcf8c704b..0000000000000 --- a/lib/internal/Magento/Framework/MultiDimensionalIndexer/Dimension.php +++ /dev/null @@ -1,19 +0,0 @@ -objectManager = $objectManager; - } - - /** - * @param array $arguments - * @return Dimension - */ - public function create(array $arguments = []): Dimension - { - return $this->objectManager->create(Dimension::class, $arguments); - } -} diff --git a/lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexHandlerInterface.php b/lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexHandlerInterface.php deleted file mode 100644 index 8a0eb364d2003..0000000000000 --- a/lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexHandlerInterface.php +++ /dev/null @@ -1,36 +0,0 @@ -indexId = $indexId; - $this->dimensions = $dimensions; - $this->alias = $alias; - } - - /** - * @return string - */ - public function getIndexId(): string - { - return $this->indexId; - } - - /** - * @return Dimension[] - */ - public function getDimensions(): array - { - return $this->dimensions; - } - - /** - * @return Alias - */ - public function getAlias(): Alias - { - return $this->alias; - } -} diff --git a/lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexNameBuilder.php b/lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexNameBuilder.php deleted file mode 100644 index 901b3d51d3737..0000000000000 --- a/lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexNameBuilder.php +++ /dev/null @@ -1,112 +0,0 @@ -objectManager = $objectManager; - $this->dimensionFactory = $dimensionFactory; - $this->aliasFactory = $aliasFactory; - } - - /** - * @param string $indexId - * @return self - */ - public function setIndexId(string $indexId): self - { - $this->data[self::$indexId] = $indexId; - return $this; - } - - /** - * @param string $name - * @param string $value - * @return self - */ - public function addDimension(string $name, string $value): self - { - $this->data[self::$dimensions][] = $this->dimensionFactory->create([ - 'name' => $name, - 'value' => $value, - ]); - return $this; - } - - /** - * @param string $alias - * @return self - */ - public function setAlias(string $alias): self - { - $this->data[self::$alias] = $this->aliasFactory->create(['value' => $alias]); - return $this; - } - - /** - * @return IndexName - */ - public function build(): IndexName - { - $indexName = $this->objectManager->create(IndexName::class, $this->data); - $this->data = []; - return $indexName; - } -} diff --git a/lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexNameResolver.php b/lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexNameResolver.php deleted file mode 100644 index c96c78b976517..0000000000000 --- a/lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexNameResolver.php +++ /dev/null @@ -1,59 +0,0 @@ -indexScopeResolver = $indexScopeResolver; - } - - /** - * @inheritdoc - */ - public function resolveName(IndexName $indexName): string - { - $tableName = $this->indexScopeResolver->resolve($indexName->getIndexId(), $indexName->getDimensions()); - - if ($indexName->getAlias()->getValue() === Alias::ALIAS_REPLICA) { - $tableName = $this->getAdditionalTableName($tableName); - } - return $tableName; - } - - /** - * @param string $tableName - * @return string - */ - public function getAdditionalTableName(string $tableName): string - { - return $tableName . $this->additionalTableSuffix; - } -} diff --git a/lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexNameResolverInterface.php b/lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexNameResolverInterface.php deleted file mode 100644 index 9068acd3373f6..0000000000000 --- a/lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexNameResolverInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -resourceConnection = $resourceConnection; - $this->indexNameResolver = $indexNameResolver; - } - - /** - * @inheritdoc - */ - public function switch(IndexName $indexName, string $connectionName) - { - $connection = $this->resourceConnection->getConnection($connectionName); - $tableName = $this->indexNameResolver->resolveName($indexName); - - $this->switchTable($connection, [$tableName]); - } - - /** - * Switch index tables from replica to active - * - * @param AdapterInterface $connection - * @param array $tableNames - * @return void - */ - private function switchTable(AdapterInterface $connection, array $tableNames) - { - $toRename = []; - foreach ($tableNames as $tableName) { - $outdatedTableName = $tableName . $this->outdatedTableSuffix; - $replicaTableName = $tableName . $this->replicaTableSuffix; - - $renameBatch = [ - [ - 'oldName' => $tableName, - 'newName' => $outdatedTableName, - ], - [ - 'oldName' => $replicaTableName, - 'newName' => $tableName, - ], - [ - 'oldName' => $outdatedTableName, - 'newName' => $replicaTableName, - ] - ]; - $toRename = array_merge($toRename, $renameBatch); - } - - if (!empty($toRename)) { - $connection->renameTablesBatch($toRename); - } - } -} diff --git a/lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexTableSwitcherInterface.php b/lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexTableSwitcherInterface.php deleted file mode 100644 index 6f067dbf6a44b..0000000000000 --- a/lib/internal/Magento/Framework/MultiDimensionalIndexer/IndexTableSwitcherInterface.php +++ /dev/null @@ -1,23 +0,0 @@ -indexName = $this->createMock(IndexName::class); - $this->resourceConnection = $this->createMock(ResourceConnection::class); - $this->indexNameResolver = $this->createMock(IndexNameResolverInterface::class); - $this->adapter = $this->createMock(AdapterInterface::class); - - $this->indexTableSwitcher = $objectManager->getObject( - IndexTableSwitcher::class, - [ - 'resourceConnection' => $this->resourceConnection, - 'indexNameResolver' => $this->indexNameResolver, - ] - ); - } - - public function testSwitch() - { - $connectionName = 'testConnection'; - $tableName = 'some_table_name'; - $toRename = - [ - [ - 'oldName' => $tableName, - 'newName' => $tableName . '_outdated', - ], - [ - 'oldName' => $tableName . '_replica', - 'newName' => $tableName, - ], - [ - 'oldName' => $tableName . '_outdated', - 'newName' => $tableName . '_replica', - ], - ]; - - $this->resourceConnection->expects($this->once())->method('getConnection') - ->with($connectionName)->willReturn($this->adapter); - $this->indexNameResolver->expects($this->once())->method('resolveName') - ->with($this->indexName)->willReturn($tableName); - $this->adapter->expects($this->once())->method('renameTablesBatch') - ->with($toRename); - - $this->indexTableSwitcher->switch($this->indexName, $connectionName); - } -} From 5a323af50295948925e3bce0c286c085d471ddb0 Mon Sep 17 00:00:00 2001 From: Neill Robson Date: Mon, 14 May 2018 10:39:06 -0400 Subject: [PATCH 11/11] Add imageUploader to formElement type --- app/code/Magento/Ui/etc/ui_configuration.xsd | 1 + .../ui_component/etc/definition/imageUploader.xsd | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/app/code/Magento/Ui/etc/ui_configuration.xsd b/app/code/Magento/Ui/etc/ui_configuration.xsd index 73f2ff6cbbc57..c43e45eb8e111 100644 --- a/app/code/Magento/Ui/etc/ui_configuration.xsd +++ b/app/code/Magento/Ui/etc/ui_configuration.xsd @@ -227,6 +227,7 @@ + diff --git a/app/code/Magento/Ui/view/base/ui_component/etc/definition/imageUploader.xsd b/app/code/Magento/Ui/view/base/ui_component/etc/definition/imageUploader.xsd index 6bb29ba2e9069..f32d5c2c0fe8f 100644 --- a/app/code/Magento/Ui/view/base/ui_component/etc/definition/imageUploader.xsd +++ b/app/code/Magento/Ui/view/base/ui_component/etc/definition/imageUploader.xsd @@ -23,6 +23,19 @@ + + + + + + + + + + + + +