Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

2.0.0.0-dev82

* Added support for MTF Reporting Tool
* Framework improvements:
  * Covered the following Magento application components with unit tests:
      * `ConfigurableProduct/Helper/Data.php`
      * `ConfigurableProduct/Model/Export/RowCustomizer.php`
      * `ConfigurableProduct/Model/Product/Type/Configurable.php`
      * `ConfigurableProduct/Model/Product/Type/Plugin.php`
      * `ConfigurableProduct/Model/Quote/Item/QuantityValidator/Initializer/Option/Plugin/ConfigurableProduct.php`
      * `CatalogSearch/Helper/Data.php`
  * Covered Magento lib with unit tests:
      * `lib/internal/Magento/Framework/DB/Helper/AbstractHelper.php`
      * `lib/internal/Magento/Framework/DB/Tree/Node.php`
* Created Service API for Magento_Catalog Module:
  * Implemented the Product API
  * Implemented the ProductAttributeRead API
* Fixed bugs:
  * Fixed issues with form elements visibility on the backend
  * Fixed an issue where backend forms contained an excessive container
  * Fixed an issue where a wrong category structure was displayed on the Category page
  * Fixed an issue where the pub/index.php entry point was broken because of the obsolete constants
  * Fixed an issue where it was impossible to pass an empty array as an argument in DI configuration and layout updates
  * Fixed an issue with status and visibility settings of a related product on the backend
  * Fixed an issue with unused DB indexes, which used resources, but did not contribute to higher performance
  * Fixed an issue where it was possible to create a downloadable product without specifying a link or a file
  * Fixed an issue where a fatal error occured when opening a fixed bundle product with custom options page on the frontend
  * Fixed an issue where the was a wrong config key for backend cataloginventory
* Processed GitHub requests:
  * [#548] (#548) -- Console installer doesn't checks filesystem permissions
  * [#552] (#552) -- backend notifications sitebuild bug
  * [#562] (#562) -- Bugfix Magento\Framework\DB\Adapter\Pdo\Mysql::getCreateTable()
  * [#565] (#565) -- Magento\CatalogSearch\Model\Query::getResultCollection() not working
  * [#557] (#557) -- translation anomalies backend login page
* Added the following functional tests:
  * Advanced Search
  * Existing Customer Creation
  * Product Attribute Creation
  * Product Rating Creation
  * Sales Rule Creation
  * System Product Attribute Deletion
  * Tax Rate Creation
  * Tax Rule Deletion
  * Update Category
  * Update Category Url Rewrite
  * Update Product Url Rewrite
  • Loading branch information...
commit 658b76f306463fb75b9ac5f288b52387bbe1568f 1 parent d895f13
@mage2-team mage2-team authored
Showing with 13,100 additions and 6,172 deletions.
  1. +47 −0 CHANGELOG.md
  2. +6 −1 app/code/Magento/AdminNotification/Block/ToolbarEntry.php
  3. +32 −37 app/code/Magento/Backend/Block/Widget/Grid/Extended.php
  4. +1 −1  app/code/Magento/Backend/view/adminhtml/layout/default.xml
  5. +2 −2 app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml
  6. +51 −0 app/code/Magento/Bundle/Model/Plugin/PriceBackend.php
  7. +3 −0  app/code/Magento/Bundle/etc/adminhtml/di.xml
  8. +1 −0  app/code/Magento/Bundle/etc/di.xml
  9. +8 −6 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php
  10. +14 −7 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php
  11. +20 −28 app/code/Magento/Catalog/Block/Product/AbstractProduct.php
  12. +20 −1 app/code/Magento/Catalog/Block/Product/Context.php
  13. +6 −6 app/code/Magento/Catalog/Block/Product/View.php
  14. +15 −35 app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php
  15. +2 −2 app/code/Magento/Catalog/Model/Product/Attribute/Backend/Sku.php
  16. +3 −6 app/code/Magento/Catalog/Model/Product/Attribute/Backend/Stock.php
  17. +32 −52 app/code/Magento/Catalog/Model/Product/Type/AbstractType.php
  18. +1 −4 app/code/Magento/Catalog/Model/Product/Type/Simple.php
  19. +1 −0  app/code/Magento/Catalog/Model/Resource/Product/Link/Product/Collection.php
  20. +85 −0 app/code/Magento/Catalog/Service/V1/Data/Converter.php
  21. +393 −0 app/code/Magento/Catalog/Service/V1/Data/Eav/AttributeMetadata.php
  22. +441 −0 app/code/Magento/Catalog/Service/V1/Data/Eav/AttributeMetadataBuilder.php
  23. +59 −0 app/code/Magento/Catalog/Service/V1/Data/Eav/Option.php
  24. +52 −0 app/code/Magento/Catalog/Service/V1/Data/Eav/OptionBuilder.php
  25. +54 −0 app/code/Magento/Catalog/Service/V1/Data/Eav/ValidationRule.php
  26. +49 −0 app/code/Magento/Catalog/Service/V1/Data/Eav/ValidationRuleBuilder.php
  27. +155 −0 app/code/Magento/Catalog/Service/V1/Data/Product.php
  28. +58 −0 app/code/Magento/Catalog/Service/V1/Data/ProductAttributeType.php
  29. +53 −0 app/code/Magento/Catalog/Service/V1/Data/ProductAttributeTypeBuilder.php
  30. +207 −0 app/code/Magento/Catalog/Service/V1/Data/ProductBuilder.php
  31. +71 −0 app/code/Magento/Catalog/Service/V1/Data/ProductMapper.php
  32. +61 −0 app/code/Magento/Catalog/Service/V1/Data/SearchResults.php
  33. +68 −0 app/code/Magento/Catalog/Service/V1/Data/SearchResultsBuilder.php
  34. +1 −0  app/code/Magento/Catalog/Service/V1/Product/Link/ReadService.php
  35. +1 −0  app/code/Magento/Catalog/Service/V1/Product/Link/WriteService.php
  36. +4 −5 app/code/Magento/Catalog/Service/V1/Product/{Link → }/ProductLoader.php
  37. +88 −0 app/code/Magento/Catalog/Service/V1/ProductAttributeReadService.php
  38. +50 −0 app/code/Magento/Catalog/Service/V1/ProductAttributeReadServiceInterface.php
  39. +201 −0 app/code/Magento/Catalog/Service/V1/ProductMetadataService.php
  40. +73 −0 app/code/Magento/Catalog/Service/V1/ProductMetadataServiceInterface.php
  41. +269 −0 app/code/Magento/Catalog/Service/V1/ProductService.php
  42. +81 −0 app/code/Magento/Catalog/Service/V1/ProductServiceInterface.php
  43. +3 −0  app/code/Magento/Catalog/etc/di.xml
  44. +42 −0 app/code/Magento/Catalog/etc/webapi.xml
  45. +0 −66 app/code/Magento/Catalog/sql/catalog_setup/install-1.6.0.0.0.php
  46. +0 −3,993 app/code/Magento/Catalog/sql/catalog_setup/install-1.6.0.0.php
  47. +0 −6 app/code/Magento/Catalog/sql/catalog_setup/upgrade-1.6.0.0.7-1.6.0.0.8.php
  48. +0 −3  app/code/Magento/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php
  49. +2 −2 app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/options/type/file.phtml
  50. +13 −8 app/code/Magento/CatalogInventory/Block/Qtyincrements.php
  51. +31 −10 app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php
  52. +3 −17 app/code/Magento/CatalogInventory/Block/Stockqty/Composite.php
  53. +1 −4 app/code/Magento/CatalogInventory/Block/Stockqty/DefaultStockqty.php
  54. +3 −6 app/code/Magento/CatalogInventory/Block/Stockqty/Type/Grouped.php
  55. +26 −64 app/code/Magento/CatalogInventory/Helper/Data.php
  56. +16 −28 app/code/Magento/CatalogInventory/Helper/Minsaleqty.php
  57. +1 −6 app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php
  58. +9 −12 app/code/Magento/CatalogInventory/Model/Indexer/Stock.php
  59. +53 −79 app/code/Magento/CatalogInventory/Model/Observer.php
  60. +2 −1  app/code/Magento/CatalogInventory/Model/Product/CopyConstructor/CatalogInventory.php
  61. +15 −50 app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock.php
  62. +6 −16 app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php
  63. +23 −61 app/code/Magento/CatalogInventory/Model/Resource/Stock.php
  64. +3 −13 app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php
  65. +8 −38 app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php
  66. +3 −0  app/code/Magento/CatalogInventory/Model/Source/Backorders.php
  67. +1 −4 app/code/Magento/CatalogInventory/Model/Source/Stock.php
  68. +26 −26 app/code/Magento/CatalogInventory/Model/Stock.php
  69. +158 −178 app/code/Magento/CatalogInventory/Model/Stock/Item.php
  70. +74 −0 app/code/Magento/CatalogInventory/Model/Stock/ItemRegistry.php
  71. +62 −91 app/code/Magento/CatalogInventory/Model/Stock/Status.php
  72. +4 −6 app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minqty.php
  73. +1 −3 app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php
  74. +3 −5 app/code/Magento/CatalogInventory/Model/System/Config/Backend/Qtyincrements.php
  75. +286 −0 app/code/Magento/CatalogInventory/Service/V1/Data/StockItem.php
  76. +33 −0 app/code/Magento/CatalogInventory/Service/V1/Data/StockItemBuilder.php
  77. +340 −0 app/code/Magento/CatalogInventory/Service/V1/StockItem.php
  78. +184 −0 app/code/Magento/CatalogInventory/Service/V1/StockItemInterface.php
  79. +54 −0 app/code/Magento/CatalogInventory/Service/V1/StockStatusService.php
  80. +42 −0 app/code/Magento/CatalogInventory/Service/V1/StockStatusServiceInterface.php
  81. +1 −0  app/code/Magento/CatalogInventory/etc/di.xml
  82. +0 −1  app/code/Magento/CatalogInventory/etc/module.xml
  83. +0 −3  app/code/Magento/CatalogInventory/sql/cataloginventory_setup/install-1.6.0.0.php
  84. +0 −6 app/code/Magento/CatalogRule/sql/catalogrule_setup/install-1.6.0.0.php
  85. +0 −6 app/code/Magento/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.1-1.6.0.2.php
  86. +1 −1  app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php
  87. +1 −1  app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php
  88. +0 −3  app/code/Magento/CatalogSearch/sql/catalogsearch_setup/install-1.6.0.0.php
  89. +1 −1  app/code/Magento/Checkout/Block/Success.php
  90. +48 −51 app/code/Magento/Checkout/Model/Cart.php
  91. +3 −2 app/code/Magento/ConfigurableProduct/Block/Stockqty/Type/Configurable.php
  92. +8 −6 app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php
  93. +0 −12 app/code/Magento/ConfigurableProduct/sql/configurable_setup/install-1.0.0.0.php
  94. +1 −1  app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/config.phtml
  95. +6 −0 app/code/Magento/ConfigurableProduct/view/adminhtml/web/product/product.css
  96. +0 −3  app/code/Magento/Core/sql/core_setup/install-1.6.0.0.php
  97. +0 −30 app/code/Magento/Customer/sql/customer_setup/install-1.6.0.0.php
  98. +0 −9 app/code/Magento/Downloadable/sql/downloadable_setup/install-1.6.0.0.php
  99. +2 −2 app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/links.phtml
  100. +5 −17 app/code/Magento/Downloadable/view/adminhtml/web/product/validation-rules.js
  101. +10 −9 app/code/Magento/Eav/Model/Entity/Attribute/Backend/AbstractBackend.php
  102. +0 −57 app/code/Magento/Eav/sql/eav_setup/install-1.6.0.0.php
  103. +0 −3  app/code/Magento/GoogleOptimizer/sql/googleoptimizer_setup/install-2.0.0.0.php
  104. +6 −4 app/code/Magento/GroupedProduct/Block/Stockqty/Type/Grouped.php
  105. +8 −10 app/code/Magento/ImportExport/Model/Import/Entity/Product.php
  106. +30 −1 app/code/Magento/Install/Model/Installer/Console.php
  107. +0 −3  app/code/Magento/Newsletter/sql/newsletter_setup/install-1.6.0.0.php
  108. +17 −0 app/code/Magento/Payment/Model/Method/AbstractMethod.php
  109. +1 −0  app/code/Magento/Paypal/Controller/Express/AbstractExpress.php
  110. +23 −40 app/code/Magento/Reports/Model/Resource/Event.php
  111. +7 −9 app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php
  112. +0 −1  app/code/Magento/Sales/Block/Adminhtml/Order/Create/Items/Grid.php
  113. +0 −3  app/code/Magento/Sales/sql/sales_setup/install-1.6.0.0.php
  114. +0 −6 app/code/Magento/SalesRule/sql/salesrule_setup/install-1.6.0.0.php
  115. +0 −6 app/code/Magento/SalesRule/sql/salesrule_setup/upgrade-1.6.0.2-1.6.0.3.php
  116. +2 −8 app/code/Magento/Tax/sql/tax_setup/install-1.6.0.0.php
  117. +0 −3  app/code/Magento/Tax/sql/tax_setup/upgrade-1.6.0.1-1.6.0.2.php
  118. +1 −1  app/code/Magento/Theme/view/frontend/layout/page_calendar.xml
  119. +0 −3  app/code/Magento/Translation/sql/translation_setup/install-1.0.0.0.php
  120. +0 −3  app/code/Magento/UrlRewrite/sql/urlrewrite_setup/install-1.0.0.0.php
  121. +5 −1 app/code/Magento/Webapi/Controller/Rest/Router.php
  122. +1 −1  app/code/Magento/Webapi/Controller/ServiceArgsSerializer.php
  123. +3 −1 app/code/Magento/Webapi/Model/Rest/Config.php
  124. +0 −3  app/code/Magento/Widget/sql/widget_setup/install-1.6.0.0.php
  125. +19 −13 app/code/Magento/Wishlist/Model/Resource/Item/Collection.php
  126. +5 −3 app/design/adminhtml/Magento/backend/web/css/admin.less
  127. +2 −1  app/design/adminhtml/Magento/backend/web/css/source/table.less
  128. +4 −2 app/design/adminhtml/Magento/backend/web/mui/form.css
  129. +4 −0 dev/shell/install.php
  130. +27 −0 dev/tests/functional/etc/global/events.xml
  131. +96 −0 dev/tests/functional/etc/global/events.xsd
  132. +393 −0 dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/ConditionsElement.php
  133. +312 −0 dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/MultiselectgrouplistElement.php
  134. +31 −0 dev/tests/functional/lib/Mtf/Util/Generate/Fixture/FieldsProvider.php
  135. +35 −105 dev/tests/functional/lib/Mtf/Util/Generate/testcase.xml
  136. +3 −0  dev/tests/functional/phpunit.xml.dist
  137. +10 −0 dev/tests/functional/tests/app/Magento/Backend/Test/Block/FormPageActions.php
  138. +14 −1 dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php
  139. +11 −4 dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php
  140. +281 −0 dev/tests/functional/tests/app/Magento/Backend/Test/Handler/Conditions.php
  141. +0 −85 dev/tests/functional/tests/app/Magento/Backend/Test/Handler/Pagination.php
  142. 0  dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Product/{Form.xml → ProductForm.xml}
  143. +5 −0 dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/CatalogProductBundle.php
  144. +2 −3 .../functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Edit/{Form.php → CategoryForm.php}
  145. +16 −0 .../functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Edit/{Form.xml → CategoryForm.xml}
  146. +6 −9 ...Test/Page/Advanced/Result.php → Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php}
  147. +127 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.xml
  148. +65 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php
  149. +61 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/Tab/Options.php
  150. +46 −0 ...sts/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/Tab/Options/Option.php
  151. +39 −0 ...sts/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/Tab/Options/Option.xml
  152. +57 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Grid.php
  153. +26 −20 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/{Form.php → ProductForm.php}
  154. +1 −0  dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/{Form.xml → ProductForm.xml}
  155. +51 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category/View.php
  156. +13 −18 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ListProduct.php
  157. +11 −6 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Crosssell.php
  158. +28 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/ProductList/Toolbar.php
  159. +19 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php
  160. +23 −3 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Search.php
  161. +66 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAbsenceDeleteAttributeButton.php
  162. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeOnAttributeForm.php
  163. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeOptionsOnProductForm.php
  164. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSearchableByLabel.php
  165. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForm.php
  166. +150 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php
  167. +75 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySaveMessage.php
  168. +87 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php
  169. +87 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php
  170. +82 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoRelatedProductsSection.php
  171. +82 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoUpSellsProductsSection.php
  172. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnFrontend.php
  173. +56 −0 ...tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnSearchForm.php
  174. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeInGrid.php
  175. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsComparable.php
  176. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php
  177. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterableInSearch.php
  178. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsGlobal.php
  179. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsHtmlAllowed.php
  180. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsRequired.php
  181. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php
  182. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedPromoRules.php
  183. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeOnProductForm.php
  184. +70 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSaveMessage.php
  185. +56 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeUsedSortOnFrontend.php
  186. +3 −3 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php
  187. +3 −3 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCategory.php
  188. +3 −3 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotDisplayingOnFrontend.php
  189. +3 −3 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductVisibleInCategory.php
  190. +82 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertRelatedProductsSection.php
  191. +82 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUpSellsProductsSection.php
  192. +86 −4 ...ts/functional/tests/app/Magento/Catalog/Test/Fixture/{CatalogCategoryEntity.php → CatalogCategory.php}
  193. +46 −4 ...ts/functional/tests/app/Magento/Catalog/Test/Fixture/{CatalogCategoryEntity.xml → CatalogCategory.xml}
  194. +559 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.php
  195. +293 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute.xml
  196. +101 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductAttribute/Options.php
  197. +17 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.php
  198. +6 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml
  199. +6 −5 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php
  200. +8 −1 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/Price.php
  201. +116 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/TaxClass.php
  202. +6 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.php
  203. +1 −0  dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml
  204. +3 −3 ...talogCategoryEntity/CatalogCategoryEntityInterface.php → CatalogCategory/CatalogCategoryInterface.php}
  205. +2 −2 ...s/functional/tests/app/Magento/Catalog/Test/Handler/{CatalogCategoryEntity → CatalogCategory}/Curl.php
  206. +80 −23 dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php
  207. +81 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogCategoryEdit.php
  208. +45 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogCategoryEdit.xml
  209. +80 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogProductAttributeIndex.php
  210. +45 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogProductAttributeIndex.xml
  211. +66 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogProductAttributeNew.php
  212. +39 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogProductAttributeNew.xml
  213. +2 −2 dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogProductEdit.php
  214. +1 −1  dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogProductEdit.xml
  215. +4 −2 dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogProductNew.php
  216. +1 −1  dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogProductNew.xml
  217. +2 −3 dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategory.php
  218. +2 −3 dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategoryEdit.php
  219. +29 −1 dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategoryView.php
  220. +12 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Category/CatalogCategoryView.xml
  221. +2 −2 ...functional/tests/app/Magento/Catalog/Test/Repository/{CatalogCategoryEntity.php → CatalogCategory.php}
  222. +112 −9 dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.php
  223. +102 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.php
  224. +4 −0 ...functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest/testUpdateCategory.csv
  225. +6 −6 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.php
  226. +1 −1  ...ts/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest/testCreate.csv
  227. +5 −5 dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php
  228. +67 −0 ...ts/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.php
  229. +9 −0 ...ento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest/testCreateProductAttribute.csv
  230. +63 −0 ...ts/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteSystemProductAttributeTest.php
  231. +2 −0  ...atalog/Test/TestCase/ProductAttribute/DeleteSystemProductAttributeTest/testDeleteSystemProductAttribute.csv
  232. +1 −1  dev/tests/functional/tests/app/Magento/Catalog/Test/etc/curl/di.xml
  233. +112 −5 dev/tests/functional/tests/app/Magento/Catalog/Test/etc/global/constraint.xml
  234. +10 −2 dev/tests/functional/tests/app/Magento/Catalog/Test/etc/global/fixture.xml
  235. +15 −0 dev/tests/functional/tests/app/Magento/Catalog/Test/etc/global/page.xml
  236. +45 −15 dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/{Form/Advanced.php → Advanced/Form.php}
  237. +51 −0 dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/Form.xml
  238. +127 −0 dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Block/Advanced/Result.php
  239. +185 −0 dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchProductsResult.php
  240. +3 −3 dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSuggestSearchingResult.php
  241. +71 −0 dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Page/AdvancedResult.php
  242. +39 −0 dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Page/AdvancedResult.xml
  243. +52 −0 dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Page/AdvancedSearch.php
  244. +33 −0 dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Page/AdvancedSearch.xml
  245. +11 −28 dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Page/CatalogsearchResult.php
  246. +33 −0 dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Page/CatalogsearchResult.xml
  247. +103 −0 dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest.php
  248. +14 −0 dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest/testSearch.csv
  249. +1 −1  dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchTest.php
  250. +7 −0 dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/global/constraint.xml
  251. +40 −0 dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/global/page.xml
  252. +79 −0 dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/DiscountCodes.php
  253. +149 −0 dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.php
  254. +39 −0 dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Shipping.xml
  255. +147 −0 dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php
  256. +58 −66 dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutCart.php
  257. +63 −0 dev/tests/functional/tests/app/Magento/Checkout/Test/Page/CheckoutCart.xml
  258. +0 −2  dev/tests/functional/tests/app/Magento/Cms/Test/Page/CmsIndex.php
  259. +4 −2 ...sts/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php
  260. +17 −210 dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.php
  261. +0 −68 dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.xml
  262. +5 −5 dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableInCategory.php
  263. +4 −4 dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableInGrid.php
  264. +106 −0 ...s/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeIsConfigurable.php
  265. +39 −9 dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/CatalogProductConfigurable.php
  266. +16 −27 ...{CatalogSearch/Test/Page/Advanced.php → ConfigurableProduct/Test/Page/Adminhtml/CatalogProductNew.php}
  267. +33 −0 dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Page/Adminhtml/CatalogProductNew.xml
  268. +44 −0 dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/CatalogProductConfigurable.php
  269. +8 −8 ...sts/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/Product/CreateConfigurableEntityTest.php
  270. +8 −0 dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/global/constraint.xml
  271. +2 −3 dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/{Form.php → CustomerForm.php}
  272. 0  dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/{Form.xml → CustomerForm.xml}
  273. +66 −0 dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerFailRegisterMessage.php
  274. +0 −1  dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/AddressInjectable.php
  275. +2 −2 dev/tests/functional/tests/app/Magento/Customer/Test/Page/Adminhtml/CustomerIndexEdit.php
  276. +1 −1  dev/tests/functional/tests/app/Magento/Customer/Test/Page/Adminhtml/CustomerIndexEdit.xml
  277. +2 −2 dev/tests/functional/tests/app/Magento/Customer/Test/Page/Adminhtml/CustomerIndexNew.php
  278. +1 −1  dev/tests/functional/tests/app/Magento/Customer/Test/Page/Adminhtml/CustomerIndexNew.xml
  279. +0 −1  dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountCreate.php
  280. +120 −0 dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php
  281. +2 −0  ...ests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity/testCreateExistingCustomer.csv
  282. +2 −4 dev/tests/functional/tests/app/Magento/Customer/Test/etc/curl/di.xml
  283. +6 −0 dev/tests/functional/tests/app/Magento/Customer/Test/etc/global/constraint.xml
  284. 0  ...ts/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/{Form.xml → ProductForm.xml}
  285. +6 −6 dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableProductForm.php
  286. +7 −2 dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/CatalogProductDownloadable.php
  287. +8 −8 dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php
  288. +1 −1  ...pp/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/testCreateDownloadableProduct.csv
  289. +36 −0 dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Rating/Edit/RatingForm.php
  290. +41 −0 dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Rating/Edit/RatingForm.xml
  291. +56 −0 dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Rating/Grid.php
  292. +31 −1 dev/tests/functional/tests/app/Magento/Review/Test/Block/Form.php
  293. +56 −0 dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInGrid.php
  294. +77 −0 dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInProductPage.php
  295. +77 −0 dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInProductPage.php
  296. +71 −0 dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessSaveMessage.php
  297. +128 −0 dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Rating.php
  298. +79 −0 dev/tests/functional/tests/app/Magento/Review/Test/Fixture/Rating.xml
  299. +68 −0 dev/tests/functional/tests/app/Magento/Review/Test/Page/Adminhtml/RatingEdit.php
  300. +39 −0 dev/tests/functional/tests/app/Magento/Review/Test/Page/Adminhtml/RatingEdit.xml
Sorry, we could not display the entire diff because too many files (420) changed.
View
47 CHANGELOG.md
@@ -1,3 +1,50 @@
+2.0.0.0-dev82
+=============
+* Added support for MTF Reporting Tool
+* Framework improvements:
+ * Covered the following Magento application components with unit tests:
+ * `ConfigurableProduct/Helper/Data.php`
+ * `ConfigurableProduct/Model/Export/RowCustomizer.php`
+ * `ConfigurableProduct/Model/Product/Type/Configurable.php`
+ * `ConfigurableProduct/Model/Product/Type/Plugin.php`
+ * `ConfigurableProduct/Model/Quote/Item/QuantityValidator/Initializer/Option/Plugin/ConfigurableProduct.php`
+ * `CatalogSearch/Helper/Data.php`
+ * Covered Magento lib with unit tests:
+ * `lib/internal/Magento/Framework/DB/Helper/AbstractHelper.php`
+ * `lib/internal/Magento/Framework/DB/Tree/Node.php`
+* Created Service API for Magento_Catalog Module:
+ * Implemented the Product API
+ * Implemented the ProductAttributeRead API
+* Fixed bugs:
+ * Fixed issues with form elements visibility on the backend
+ * Fixed an issue where backend forms contained an excessive container
+ * Fixed an issue where a wrong category structure was displayed on the Category page
+ * Fixed an issue where the pub/index.php entry point was broken because of the obsolete constants
+ * Fixed an issue where it was impossible to pass an empty array as an argument in DI configuration and layout updates
+ * Fixed an issue with status and visibility settings of a related product on the backend
+ * Fixed an issue with unused DB indexes, which used resources, but did not contribute to higher performance
+ * Fixed an issue where it was possible to create a downloadable product without specifying a link or a file
+ * Fixed an issue where a fatal error occured when opening a fixed bundle product with custom options page on the frontend
+ * Fixed an issue where the was a wrong config key for backend cataloginventory
+* Processed GitHub requests:
+ * [#548] (https://github.com/magento/magento2/issues/548) -- Console installer doesn't checks filesystem permissions
+ * [#552] (https://github.com/magento/magento2/issues/552) -- backend notifications sitebuild bug
+ * [#562] (https://github.com/magento/magento2/pull/562) -- Bugfix Magento\Framework\DB\Adapter\Pdo\Mysql::getCreateTable()
+ * [#565] (https://github.com/magento/magento2/pull/565) -- Magento\CatalogSearch\Model\Query::getResultCollection() not working
+ * [#557] (https://github.com/magento/magento2/issues/557) -- translation anomalies backend login page
+* Added the following functional tests:
+ * Advanced Search
+ * Existing Customer Creation
+ * Product Attribute Creation
+ * Product Rating Creation
+ * Sales Rule Creation
+ * System Product Attribute Deletion
+ * Tax Rate Creation
+ * Tax Rule Deletion
+ * Update Category
+ * Update Category Url Rewrite
+ * Update Product Url Rewrite
+
2.0.0.0-dev81
=============
* Framework improvements:
View
7 app/code/Magento/AdminNotification/Block/ToolbarEntry.php
@@ -31,6 +31,11 @@
class ToolbarEntry extends \Magento\Backend\Block\Template
{
/**
+ * Number of notifications showed on expandable window
+ */
+ const NOTIFICATIONS_NUMBER = 4;
+
+ /**
* Collection of latest unread notifications
*
* @var \Magento\AdminNotification\Model\Resource\Inbox\Collection
@@ -68,7 +73,7 @@ public function getUnreadNotificationCount()
*/
public function getLatestUnreadNotifications()
{
- return $this->_notificationList;
+ return $this->_notificationList->setPageSize(self::NOTIFICATIONS_NUMBER);
}
/**
View
69 app/code/Magento/Backend/Block/Widget/Grid/Extended.php
@@ -46,7 +46,7 @@ class Extended extends \Magento\Backend\Block\Widget\Grid implements \Magento\Ba
*
* @var \Magento\Framework\Data\Collection
*/
- protected $_collection = null;
+ protected $_collection;
/**
* Export flag
@@ -81,14 +81,14 @@ class Extended extends \Magento\Backend\Block\Widget\Grid implements \Magento\Ba
*
* @var string
*/
- protected $_massactionIdField = null;
+ protected $_massactionIdField;
/**
* Massaction row id filter
*
* @var string
*/
- protected $_massactionIdFilter = null;
+ protected $_massactionIdFilter;
/**
* Massaction block name
@@ -202,9 +202,7 @@ protected function _prepareLayout()
{
$this->setChild(
'export_button',
- $this->getLayout()->createBlock(
- 'Magento\Backend\Block\Widget\Button'
- )->setData(
+ $this->getLayout()->createBlock('Magento\Backend\Block\Widget\Button')->setData(
array(
'label' => __('Export'),
'onclick' => $this->getJsObjectName() . '.doExport()',
@@ -214,17 +212,13 @@ protected function _prepareLayout()
);
$this->setChild(
'reset_filter_button',
- $this->getLayout()->createBlock(
- 'Magento\Backend\Block\Widget\Button'
- )->setData(
+ $this->getLayout()->createBlock('Magento\Backend\Block\Widget\Button')->setData(
array('label' => __('Reset Filter'), 'onclick' => $this->getJsObjectName() . '.resetFilter()')
)
);
$this->setChild(
'search_button',
- $this->getLayout()->createBlock(
- 'Magento\Backend\Block\Widget\Button'
- )->setData(
+ $this->getLayout()->createBlock('Magento\Backend\Block\Widget\Button')->setData(
array(
'label' => __('Search'),
'onclick' => $this->getJsObjectName() . '.doFilter()',
@@ -289,15 +283,11 @@ public function addColumn($columnId, $column)
if (is_array($column)) {
$this->getColumnSet()->setChild(
$columnId,
- $this->getLayout()->createBlock(
- 'Magento\Backend\Block\Widget\Grid\Column\Extended'
- )->setData(
- $column
- )->setId(
- $columnId
- )->setGrid(
- $this
- )
+ $this->getLayout()
+ ->createBlock('Magento\Backend\Block\Widget\Grid\Column\Extended')
+ ->setData($column)
+ ->setId($columnId)
+ ->setGrid($this)
);
$this->getColumnSet()->getChildBlock($columnId)->setGrid($this);
} else {
@@ -437,19 +427,19 @@ protected function _prepareMassaction()
protected function _prepareMassactionColumn()
{
$columnId = 'massaction';
- $massactionColumn = $this->getLayout()->createBlock(
- 'Magento\Backend\Block\Widget\Grid\Column'
- )->setData(
- array(
- 'index' => $this->getMassactionIdField(),
- 'filter_index' => $this->getMassactionIdFilter(),
- 'type' => 'massaction',
- 'name' => $this->getMassactionBlock()->getFormFieldName(),
- 'is_system' => true,
- 'header_css_class' => 'col-select',
- 'column_css_class' => 'col-select'
- )
- );
+ $massactionColumn = $this->getLayout()
+ ->createBlock('Magento\Backend\Block\Widget\Grid\Column')
+ ->setData(
+ array(
+ 'index' => $this->getMassactionIdField(),
+ 'filter_index' => $this->getMassactionIdFilter(),
+ 'type' => 'massaction',
+ 'name' => $this->getMassactionBlock()->getFormFieldName(),
+ 'is_system' => true,
+ 'header_css_class' => 'col-select',
+ 'column_css_class' => 'col-select'
+ )
+ );
if ($this->getNoFilterMassactionColumn()) {
$massactionColumn->setData('filter', false);
@@ -980,8 +970,10 @@ public function _exportIterateCollection($callback, array $args)
* @param \Magento\Framework\Filesystem\File\WriteInterface $stream
* @return void
*/
- protected function _exportCsvItem(\Magento\Framework\Object $item, \Magento\Framework\Filesystem\File\WriteInterface $stream)
- {
+ protected function _exportCsvItem(
+ \Magento\Framework\Object $item,
+ \Magento\Framework\Filesystem\File\WriteInterface $stream
+ ) {
$row = array();
foreach ($this->getColumns() as $column) {
if (!$column->getIsSystem()) {
@@ -1142,7 +1134,10 @@ public function getExcelFile($sheetName = '')
$this->_isExport = true;
$this->_prepareGrid();
- $convert = new \Magento\Framework\Convert\Excel($this->getCollection()->getIterator(), array($this, 'getRowRecord'));
+ $convert = new \Magento\Framework\Convert\Excel(
+ $this->getCollection()->getIterator(),
+ array($this, 'getRowRecord')
+ );
$name = md5(microtime());
$file = $this->_path . '/' . $name . '.xml';
View
2  app/code/Magento/Backend/view/adminhtml/layout/default.xml
@@ -203,7 +203,7 @@
</block>
<block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-ui-timepicker-addon-js">
<arguments>
- <argument name="file" xsi:type="string">jquery/jquery-ui-timepicker-addon-1.0.1.js</argument>
+ <argument name="file" xsi:type="string">jquery/jquery-ui-timepicker-addon.js</argument>
</arguments>
</block>
<block class="Magento\Theme\Block\Html\Head\Script" name="magento-calendar-js">
View
4 app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml
@@ -72,7 +72,7 @@
<div class="field field-username">
<label for="username" class="label"><span><?php echo __('User Name:') ?></span></label>
<div class="control">
- <input type="text" id="username" name="login[username]" value="" class="required-entry input-text" placeholder="user name" />
+ <input type="text" id="username" name="login[username]" value="" class="required-entry input-text" placeholder="<?php echo __('user name') ?>" />
</div>
</div>
<div class="field field-password">
@@ -80,7 +80,7 @@
<div class="control">
<!-- This is a dummy hidden field to trick firefox from auto filling the password -->
<input type="text" class="input-text no-display" name="dummy" id="dummy" />
- <input type="password" id="login" name="login[password]" class="required-entry input-text" value="" placeholder="password" />
+ <input type="password" id="login" name="login[password]" class="required-entry input-text" value="" placeholder="<?php echo __('password') ?>" />
</div>
</div>
<?php echo $this->getChildHtml('form.additional.info'); ?>
View
51 app/code/Magento/Bundle/Model/Plugin/PriceBackend.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+namespace Magento\Bundle\Model\Plugin;
+
+/**
+ * Class PriceBackend
+ *
+ * Make price validation optional for bundle dynamic
+ */
+class PriceBackend
+{
+ /**
+ * @param \Magento\Catalog\Model\Product\Attribute\Backend\Price $subject
+ * @param Closure $proceed
+ * @param \Magento\Catalog\Model\Product $product
+ * @return bool
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
+ public function aroundValidate(
+ \Magento\Catalog\Model\Product\Attribute\Backend\Price $subject,
+ \Closure $proceed,
+ \Magento\Catalog\Model\Product $product
+ ) {
+ if ($product->getPriceType() == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_DYNAMIC) {
+ return true;
+ } else {
+ return $proceed($product);
+ }
+ }
+}
View
3  app/code/Magento/Bundle/etc/adminhtml/di.xml
@@ -37,4 +37,7 @@
</argument>
</arguments>
</type>
+ <type name="Magento\Catalog\Model\Product\Attribute\Backend\Price">
+ <plugin name="bundle" type="Magento\Bundle\Model\Plugin\PriceBackend" sortOrder="100" />
+ </type>
</config>
View
1  app/code/Magento/Bundle/etc/di.xml
@@ -71,6 +71,7 @@
<item name="group_price" xsi:type="string">Magento\Bundle\Pricing\Price\GroupPrice</item>
<item name="special_price" xsi:type="string">Magento\Bundle\Pricing\Price\SpecialPrice</item>
<item name="msrp_price" xsi:type="string">Magento\Catalog\Pricing\Price\MsrpPrice</item>
+ <item name="custom_option_price" xsi:type="string">Magento\Catalog\Pricing\Price\CustomOptionPrice</item>
<item name="base_price" xsi:type="string">Magento\Catalog\Pricing\Price\BasePrice</item>
<item name="configured_price" xsi:type="string">Magento\Bundle\Pricing\Price\ConfiguredPrice</item>
<item name="bundle_option" xsi:type="string">Magento\Bundle\Pricing\Price\BundleOptionPrice</item>
View
14 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php
@@ -22,15 +22,13 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-/**
- * Products mass update inventory tab
- *
- * @author Magento Core Team <core@magentocommerce.com>
- */
namespace Magento\Catalog\Block\Adminhtml\Product\Edit\Action\Attribute\Tab;
use Magento\CatalogInventory\Model\Stock\Item;
+/**
+ * Products mass update inventory tab
+ */
class Inventory extends \Magento\Backend\Block\Widget implements \Magento\Backend\Block\Widget\Tab\TabInterface
{
/**
@@ -91,7 +89,11 @@ public function getStoreId()
*/
public function getDefaultConfigValue($field)
{
- return $this->_scopeConfig->getValue(Item::XML_PATH_ITEM . $field, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $this->getStoreId());
+ return $this->_scopeConfig->getValue(
+ Item::XML_PATH_ITEM . $field,
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
+ $this->getStoreId()
+ );
}
/**
View
21 app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php
@@ -25,8 +25,6 @@
/**
* Product inventory data
- *
- * @author Magento Core Team <core@magentocommerce.com>
*/
class Inventory extends \Magento\Backend\Block\Widget
{
@@ -40,14 +38,14 @@ class Inventory extends \Magento\Backend\Block\Widget
*
* @var \Magento\Catalog\Helper\Data
*/
- protected $_catalogData = null;
+ protected $_catalogData;
/**
* Core registry
*
* @var \Magento\Framework\Registry
*/
- protected $_coreRegistry = null;
+ protected $_coreRegistry;
/**
* @var \Magento\CatalogInventory\Model\Source\Stock
@@ -138,7 +136,10 @@ public function getFieldValue($field)
return $this->getStockItem()->getDataUsingMethod($field);
}
- return $this->_scopeConfig->getValue(\Magento\CatalogInventory\Model\Stock\Item::XML_PATH_ITEM . $field, \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
+ return $this->_scopeConfig->getValue(
+ \Magento\CatalogInventory\Model\Stock\Item::XML_PATH_ITEM . $field,
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE
+ );
}
/**
@@ -153,7 +154,10 @@ public function getConfigFieldValue($field)
}
}
- return $this->_scopeConfig->getValue(\Magento\CatalogInventory\Model\Stock\Item::XML_PATH_ITEM . $field, \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
+ return $this->_scopeConfig->getValue(
+ \Magento\CatalogInventory\Model\Stock\Item::XML_PATH_ITEM . $field,
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE
+ );
}
/**
@@ -162,7 +166,10 @@ public function getConfigFieldValue($field)
*/
public function getDefaultConfigValue($field)
{
- return $this->_scopeConfig->getValue(\Magento\CatalogInventory\Model\Stock\Item::XML_PATH_ITEM . $field, \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
+ return $this->_scopeConfig->getValue(
+ \Magento\CatalogInventory\Model\Stock\Item::XML_PATH_ITEM . $field,
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE
+ );
}
/**
View
48 app/code/Magento/Catalog/Block/Product/AbstractProduct.php
@@ -21,17 +21,10 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
-
-/**
- * Catalog Product Abstract Block
- *
- * @author Magento Core Team <core@magentocommerce.com>
- */
namespace Magento\Catalog\Block\Product;
/**
- * Class AbstractProduct
+ * Catalog Product Abstract Block
*/
abstract class AbstractProduct extends \Magento\Framework\View\Element\Template
{
@@ -85,21 +78,21 @@
*
* @var \Magento\Framework\Registry
*/
- protected $_coreRegistry = null;
+ protected $_coreRegistry;
/**
* Catalog data
*
* @var \Magento\Catalog\Helper\Data
*/
- protected $_catalogData = null;
+ protected $_catalogData;
/**
* Tax data
*
* @var \Magento\Tax\Helper\Data
*/
- protected $_taxData = null;
+ protected $_taxData;
/**
* Catalog config
@@ -144,6 +137,11 @@
protected $reviewRenderer;
/**
+ * @var \Magento\CatalogInventory\Service\V1\StockItem
+ */
+ protected $stockItemService;
+
+ /**
* @param Context $context
* @param array $data
*/
@@ -162,6 +160,7 @@ public function __construct(
$this->_catalogData = $context->getCatalogHelper();
$this->_mathRandom = $context->getMathRandom();
$this->reviewRenderer = $context->getReviewRenderer();
+ $this->stockItemService = $context->getStockItemService();
parent::__construct($context, $data);
}
@@ -190,8 +189,9 @@ public function getAddToCartUrl($product, $additional = array())
}
/**
- * Retrieves url for form submitting:
- * some objects can use setSubmitRouteData() to set route and params for form submitting,
+ * Retrieves url for form submitting.
+ *
+ * Some objects can use setSubmitRouteData() to set route and params for form submitting,
* otherwise default url will be used
*
* @param \Magento\Catalog\Model\Product $product
@@ -240,12 +240,8 @@ public function getAddToCompareUrl()
*/
public function getMinimalQty($product)
{
- $stockItem = $product->getStockItem();
- if ($stockItem) {
- return $stockItem->getMinSaleQty()
- && $stockItem->getMinSaleQty() > 0 ? $stockItem->getMinSaleQty() * 1 : null;
- }
- return null;
+ $minSaleQty = $this->stockItemService->getMinSaleQty($product->getId());
+ return $minSaleQty > 0 ? $minSaleQty : null;
}
/**
@@ -259,19 +255,19 @@ public function getMinimalQty($product)
*/
public function getPriceHtml($product, $displayMinimalPrice = false, $idSuffix = '')
{
- $type_id = $product->getTypeId();
+ $typeId = $product->getTypeId();
if ($this->_catalogData->canApplyMsrp($product)) {
- $realPriceHtml = $this->_preparePriceRenderer($type_id)
+ $realPriceHtml = $this->_preparePriceRenderer($typeId)
->setProduct($product)
->setDisplayMinimalPrice($displayMinimalPrice)
->setIdSuffix($idSuffix)
->toHtml();
$product->setAddToCartUrl($this->getAddToCartUrl($product));
$product->setRealPriceHtml($realPriceHtml);
- $type_id = $this->_mapRenderer;
+ $typeId = $this->_mapRenderer;
}
- return $this->_preparePriceRenderer($type_id)
+ return $this->_preparePriceRenderer($typeId)
->setProduct($product)
->setDisplayMinimalPrice($displayMinimalPrice)
->setIdSuffix($idSuffix)
@@ -664,11 +660,7 @@ public function getProductPriceHtml(
$price = '';
if ($priceRender) {
- $price = $priceRender->render(
- $priceType,
- $product,
- $arguments
- );
+ $price = $priceRender->render($priceType, $product, $arguments);
}
return $price;
}
View
21 app/code/Magento/Catalog/Block/Product/Context.php
@@ -23,6 +23,9 @@
*/
namespace Magento\Catalog\Block\Product;
+/**
+ * Abstract product block context
+ */
class Context extends \Magento\Framework\View\Element\Template\Context
{
/**
@@ -81,6 +84,11 @@ class Context extends \Magento\Framework\View\Element\Template\Context
protected $reviewRenderer;
/**
+ * @var \Magento\CatalogInventory\Service\V1\StockItem
+ */
+ protected $stockItemService;
+
+ /**
* @param \Magento\Framework\App\RequestInterface $request
* @param \Magento\Framework\View\LayoutInterface $layout
* @param \Magento\Framework\Event\ManagerInterface $eventManager
@@ -115,6 +123,7 @@ class Context extends \Magento\Framework\View\Element\Template\Context
* @param \Magento\Theme\Helper\Layout $layoutHelper
* @param \Magento\Catalog\Helper\Image $imageHelper
* @param ReviewRendererInterface $reviewRenderer
+ * @param \Magento\CatalogInventory\Service\V1\StockItem $stockItemService
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
@@ -152,7 +161,8 @@ public function __construct(
\Magento\Catalog\Helper\Product\Compare $compareProduct,
\Magento\Theme\Helper\Layout $layoutHelper,
\Magento\Catalog\Helper\Image $imageHelper,
- ReviewRendererInterface $reviewRenderer
+ ReviewRendererInterface $reviewRenderer,
+ \Magento\CatalogInventory\Service\V1\StockItem $stockItemService
) {
$this->imageHelper = $imageHelper;
$this->layoutHelper = $layoutHelper;
@@ -165,6 +175,7 @@ public function __construct(
$this->catalogHelper = $catalogHelper;
$this->mathRandom = $mathRandom;
$this->reviewRenderer = $reviewRenderer;
+ $this->stockItemService = $stockItemService;
parent::__construct(
$request,
$layout,
@@ -193,6 +204,14 @@ public function __construct(
}
/**
+ * @return \Magento\CatalogInventory\Service\V1\StockItem
+ */
+ public function getStockItemService()
+ {
+ return $this->stockItemService;
+ }
+
+ /**
* @return \Magento\Checkout\Helper\Cart
*/
public function getCartHelper()
View
12 app/code/Magento/Catalog/Block/Product/View.php
@@ -236,15 +236,15 @@ public function getJsonConfig()
return $this->_jsonEncoder->encode($config);
}
- $_request = $this->_taxCalculation->getRateRequest(false, false, false);
+ $request = $this->_taxCalculation->getRateRequest(false, false, false);
/* @var $product \Magento\Catalog\Model\Product */
$product = $this->getProduct();
- $_request->setProductClassId($product->getTaxClassId());
- $defaultTax = $this->_taxCalculation->getRate($_request);
+ $request->setProductClassId($product->getTaxClassId());
+ $defaultTax = $this->_taxCalculation->getRate($request);
- $_request = $this->_taxCalculation->getRateRequest();
- $_request->setProductClassId($product->getTaxClassId());
- $currentTax = $this->_taxCalculation->getRate($_request);
+ $request = $this->_taxCalculation->getRateRequest();
+ $request->setProductClassId($product->getTaxClassId());
+ $currentTax = $this->_taxCalculation->getRate($request);
$tierPrices = array();
View
50 app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php
@@ -27,8 +27,6 @@
/**
* Adminhtml catalog product action attribute update controller
- *
- * @author Magento Core Team <core@magentocommerce.com>
*/
class Attribute extends Action
{
@@ -47,7 +45,7 @@ class Attribute extends Action
*
* @var \Magento\Catalog\Helper\Product
*/
- protected $_catalogProduct = null;
+ protected $_catalogProduct;
/**
* @param Action\Context $context
@@ -110,20 +108,13 @@ public function saveAction()
try {
if ($attributesData) {
- $dateFormat = $this->_objectManager->get(
- 'Magento\Framework\Stdlib\DateTime\TimezoneInterface'
- )->getDateFormat(
- \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_SHORT
- );
+ $dateFormat = $this->_objectManager->get('Magento\Framework\Stdlib\DateTime\TimezoneInterface')
+ ->getDateFormat(\Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_SHORT);
$storeId = $this->_helper->getSelectedStoreId();
foreach ($attributesData as $attributeCode => $value) {
- $attribute = $this->_objectManager->get(
- 'Magento\Eav\Model\Config'
- )->getAttribute(
- \Magento\Catalog\Model\Product::ENTITY,
- $attributeCode
- );
+ $attribute = $this->_objectManager->get('Magento\Eav\Model\Config')
+ ->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $attributeCode);
if (!$attribute->getAttributeId()) {
unset($attributesData[$attributeCode]);
continue;
@@ -141,7 +132,7 @@ public function saveAction()
$attributesData[$attributeCode] = $value;
} elseif ($attribute->getFrontendInput() == 'multiselect') {
// Check if 'Change' checkbox has been checked by admin for this attribute
- $isChanged = (bool)$this->getRequest()->getPost($attributeCode . '_checkbox');
+ $isChanged = (bool) $this->getRequest()->getPost($attributeCode . '_checkbox');
if (!$isChanged) {
unset($attributesData[$attributeCode]);
continue;
@@ -153,13 +144,8 @@ public function saveAction()
}
}
- $this->_objectManager->get(
- 'Magento\Catalog\Model\Product\Action'
- )->updateAttributes(
- $this->_helper->getProductIds(),
- $attributesData,
- $storeId
- );
+ $this->_objectManager->get('Magento\Catalog\Model\Product\Action')
+ ->updateAttributes($this->_helper->getProductIds(), $attributesData, $storeId);
}
if ($inventoryData) {
$stockItem = $this->_objectManager->create('Magento\CatalogInventory\Model\Stock\Item');
@@ -184,9 +170,7 @@ public function saveAction()
}
if ($stockItemSaved) {
- $this->_objectManager->get(
- 'Magento\Index\Model\Indexer'
- )->indexEvents(
+ $this->_objectManager->get('Magento\Index\Model\Indexer')->indexEvents(
\Magento\CatalogInventory\Model\Stock\Item::ENTITY,
\Magento\Index\Model\Event::TYPE_SAVE
);
@@ -222,9 +206,9 @@ public function saveAction()
$this->_productFlatIndexerProcessor->reindexList($this->_helper->getProductIds());
- if ($this->_catalogProduct->isDataForPriceIndexerWasChanged(
- $attributesData
- ) || !empty($websiteRemoveData) || !empty($websiteAddData)
+ if ($this->_catalogProduct->isDataForPriceIndexerWasChanged($attributesData)
+ || !empty($websiteRemoveData)
+ || !empty($websiteAddData)
) {
$this->_productPriceIndexerProcessor->reindexList($this->_helper->getProductIds());
}
@@ -251,7 +235,7 @@ protected function _validateProducts()
$productIds = $this->_helper->getProductIds();
if (!is_array($productIds)) {
$error = __('Please select products for attributes update.');
- } else if (!$this->_objectManager->create('Magento\Catalog\Model\Product')->isProductsHasSku($productIds)) {
+ } elseif (!$this->_objectManager->create('Magento\Catalog\Model\Product')->isProductsHasSku($productIds)) {
$error = __('Please make sure to define SKU values for all processed products.');
}
@@ -286,12 +270,8 @@ public function validateAction()
try {
if ($attributesData) {
foreach ($attributesData as $attributeCode => $value) {
- $attribute = $this->_objectManager->get(
- 'Magento\Eav\Model\Config'
- )->getAttribute(
- 'catalog_product',
- $attributeCode
- );
+ $attribute = $this->_objectManager->get('Magento\Eav\Model\Config')
+ ->getAttribute('catalog_product', $attributeCode);
if (!$attribute->getAttributeId()) {
unset($attributesData[$attributeCode]);
continue;
View
4 app/code/Magento/Catalog/Model/Product/Attribute/Backend/Sku.php
@@ -68,8 +68,8 @@ public function validate($object)
{
$attrCode = $this->getAttribute()->getAttributeCode();
$value = $object->getData($attrCode);
- if ($this->getAttribute()->getIsRequired() && $this->getAttribute()->isValueEmpty($value)) {
- return false;
+ if ($this->getAttribute()->getIsRequired() && strlen($value) === 0) {
+ throw new \Magento\Eav\Exception(__('The value of attribute "%1" must be set', $attrCode));
}
if ($this->string->strlen($object->getSku()) > self::SKU_MAX_LENGTH) {
View
9 app/code/Magento/Catalog/Model/Product/Attribute/Backend/Stock.php
@@ -22,16 +22,13 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
-/**
- * Quantity and Stock Status attribute processing
- *
- * @author Magento Core Team <core@magentocommerce.com>
- */
namespace Magento\Catalog\Model\Product\Attribute\Backend;
use Magento\Catalog\Model\Product;
+/**
+ * Quantity and Stock Status attribute processing
+ */
class Stock extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend
{
/**
View
84 app/code/Magento/Catalog/Model/Product/Type/AbstractType.php
@@ -21,14 +21,11 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
+namespace Magento\Catalog\Model\Product\Type;
/**
* Abstract model for product type implementation
- *
- * @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\Catalog\Model\Product\Type;
-
abstract class AbstractType
{
/**
@@ -76,13 +73,13 @@
const CALCULATE_PARENT = 1;
- /**
+ /**#@+
* values for shipment type (invoice etc)
- *
*/
const SHIPMENT_SEPARATELY = 1;
const SHIPMENT_TOGETHER = 0;
+ /**#@-*/
/**
* Process modes
@@ -132,14 +129,14 @@
*
* @var \Magento\Framework\Registry
*/
- protected $_coreRegistry = null;
+ protected $_coreRegistry;
/**
* Core event manager proxy
*
* @var \Magento\Framework\Event\ManagerInterface
*/
- protected $_eventManager = null;
+ protected $_eventManager;
/**
* @var \Magento\Framework\Logger
@@ -270,11 +267,9 @@ public function getParentIdsByChild($childId)
*/
public function getSetAttributes($product)
{
- return $product->getResource()->loadAllAttributes(
- $product
- )->getSortedAttributes(
- $product->getAttributeSetId()
- );
+ return $product->getResource()
+ ->loadAllAttributes($product)
+ ->getSortedAttributes($product->getAttributeSetId());
}
/**
@@ -440,13 +435,14 @@ protected function _prepareProduct(\Magento\Framework\Object $buyRequest, $produ
* @param string $processMode
* @return array|string
*/
- public function processConfiguration(\Magento\Framework\Object $buyRequest, $product, $processMode = self::PROCESS_MODE_LITE)
- {
- $_products = $this->_prepareProduct($buyRequest, $product, $processMode);
-
+ public function processConfiguration(
+ \Magento\Framework\Object $buyRequest,
+ $product,
+ $processMode = self::PROCESS_MODE_LITE
+ ) {
+ $products = $this->_prepareProduct($buyRequest, $product, $processMode);
$this->processFileQueue();
-
- return $_products;
+ return $products;
}
/**
@@ -583,25 +579,18 @@ protected function _prepareOptions(\Magento\Framework\Object $buyRequest, $produ
{
$transport = new \StdClass();
$transport->options = array();
- foreach ($product->getOptions() as $_option) {
- /* @var $_option \Magento\Catalog\Model\Product\Option */
- $group = $_option->groupFactory(
- $_option->getType()
- )->setOption(
- $_option
- )->setProduct(
- $product
- )->setRequest(
- $buyRequest
- )->setProcessMode(
- $processMode
- )->validateUserValue(
- $buyRequest->getOptions()
- );
+ foreach ($product->getOptions() as $option) {
+ /* @var $option \Magento\Catalog\Model\Product\Option */
+ $group = $option->groupFactory($option->getType())
+ ->setOption($option)
+ ->setProduct($product)
+ ->setRequest($buyRequest)
+ ->setProcessMode($processMode)
+ ->validateUserValue($buyRequest->getOptions());
$preparedValue = $group->prepareForCart();
if ($preparedValue !== null) {
- $transport->options[$_option->getId()] = $preparedValue;
+ $transport->options[$option->getId()] = $preparedValue;
}
}
@@ -659,15 +648,10 @@ public function getOrderOptions($product)
if ($option) {
$confItemOption = $product->getCustomOption(self::OPTION_PREFIX . $option->getId());
- $group = $option->groupFactory(
- $option->getType()
- )->setOption(
- $option
- )->setProduct(
- $product
- )->setConfigurationItemOption(
- $confItemOption
- );
+ $group = $option->groupFactory($option->getType())
+ ->setOption($option)
+ ->setProduct($product)
+ ->setConfigurationItemOption($confItemOption);
$optionArr['options'][] = array(
'label' => $option->getTitle(),
@@ -812,13 +796,9 @@ public function getOptionSku($product, $sku = '')
$confItemOption = $product->getCustomOption(self::OPTION_PREFIX . $optionId);
- $group = $option->groupFactory(
- $option->getType()
- )->setOption(
- $option
- )->setListener(
- new \Magento\Framework\Object()
- );
+ $group = $option->groupFactory($option->getType())
+ ->setOption($option)
+ ->setListener(new \Magento\Framework\Object());
$optionSku = $group->getOptionSku($confItemOption->getValue(), $skuDelimiter);
if ($optionSku) {
@@ -971,7 +951,7 @@ public function setConfig($config)
}
if (isset($config['can_use_qty_decimals'])) {
- $this->_canUseQtyDecimals = (bool)$config['can_use_qty_decimals'];
+ $this->_canUseQtyDecimals = (bool) $config['can_use_qty_decimals'];
}
return $this;
View
5 app/code/Magento/Catalog/Model/Product/Type/Simple.php
@@ -21,14 +21,11 @@
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
+namespace Magento\Catalog\Model\Product\Type;
/**
* Simple product type implementation
- *
- * @author Magento Core Team <core@magentocommerce.com>
*/
-namespace Magento\Catalog\Model\Product\Type;
-
class Simple extends \Magento\Catalog\Model\Product\Type\AbstractType
{
/**
View
1  app/code/Magento/Catalog/Model/Resource/Product/Link/Product/Collection.php
@@ -112,6 +112,7 @@ public function setProduct(\Magento\Catalog\Model\Product $product)
$this->_product = $product;
if ($product && $product->getId()) {
$this->_hasLinkFilter = true;
+ $this->setStore($product->getStore());
}
return $this;
}
View
85 app/code/Magento/Catalog/Service/V1/Data/Converter.php
@@ -0,0 +1,85 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+namespace Magento\Catalog\Service\V1\Data;
+
+use Magento\Catalog\Service\V1\Data\ProductBuilder;
+use Magento\Catalog\Service\V1\Data\Product as ProductDataObject;
+
+/**
+ * Product Model converter.
+ *
+ * Converts a Product Model to a Data Object or vice versa.
+ */
+class Converter
+{
+ /**
+ * @var ProductBuilder
+ */
+ protected $productBuilder;
+
+ /**
+ * @param ProductBuilder $productBuilder
+ */
+ public function __construct(ProductBuilder $productBuilder)
+ {
+ $this->productBuilder = $productBuilder;
+ }
+
+ /**
+ * Convert a product model to a product data entity
+ *
+ * @param \Magento\Catalog\Model\Product $productModel
+ * @return \Magento\Catalog\Service\V1\Data\Product
+ */
+ public function createProductDataFromModel(\Magento\Catalog\Model\Product $productModel)
+ {
+ $this->_populateBuilderWithAttributes($productModel);
+ return $this->productBuilder->create();
+ }
+
+ /**
+ * Loads the values from a product model
+ *
+ * @param \Magento\Catalog\Model\Product $productModel
+ * @return void
+ */
+ protected function _populateBuilderWithAttributes(\Magento\Catalog\Model\Product $productModel)
+ {
+ $attributes = array();
+ foreach ($this->productBuilder->getCustomAttributesCodes() as $attrCode) {
+ $value = $productModel->getDataUsingMethod($attrCode);
+ $value = $value ? $value : $productModel->getData($attrCode);
+ if (null !== $value) {
+ if ($attrCode == 'entity_id') {
+ $attributes[ProductDataObject::ID] = $value;
+ } else {
+ $attributes[$attrCode] = $value;
+ }
+ }
+ }
+
+ $this->productBuilder->populateWithArray($attributes);
+ return;
+ }
+}
View
393 app/code/Magento/Catalog/Service/V1/Data/Eav/AttributeMetadata.php
@@ -0,0 +1,393 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+namespace Magento\Catalog\Service\V1\Data\Eav;
+
+/**
+ * Class AttributeMetadata
+ */
+class AttributeMetadata extends \Magento\Framework\Service\Data\AbstractObject
+{
+ /**#@+
+ * Constants used as keys into $_data
+ */
+ const ATTRIBUTE_ID = 'attribute_id';
+
+ const ATTRIBUTE_CODE = 'attribute_code';
+
+ const FRONTEND_INPUT = 'frontend_input';
+
+ const VALIDATION_RULES = 'validation_rules';
+
+ const OPTIONS = 'options';
+
+ const VISIBLE = 'visible';
+
+ const REQUIRED = 'required';
+
+ const USER_DEFINED = 'user_defined';
+
+ const FRONTEND_LABEL = 'frontend_label';
+
+ const NOTE = 'note';
+
+ const BACKEND_TYPE = 'backend_type';
+
+ const DEFAULT_VALUE = 'default_value';
+
+ const UNIQUE = 'unique';
+
+ const APPLY_TO = 'apply_to';
+
+ const CONFIGURABLE = 'configurable';
+
+ const SEARCHABLE = 'searchable';
+
+ const VISIBLE_IN_ADVANCED_SEARCH = 'visible_in_advanced_search';
+
+ const COMPARABLE = 'comparable';
+
+ const USED_FOR_PROMO_RULES = 'used_for_promo_rules';
+
+ const VISIBLE_ON_FRONT = 'visible_on_front';
+
+ const USED_IN_PRODUCT_LISTING = 'used_in_product_listing';
+
+ const SCOPE = 'scope';
+
+ // additional fields
+ const WYSIWYG_ENABLED = 'wysiwyg_enabled';
+
+ const HTML_ALLOWED_ON_FRONT = 'html_allowed_on_front';
+
+ const FRONTEND_CLASS = 'frontend_class';
+
+ const USED_FOR_SORT_BY = 'used_for_sort_by';
+
+ const FILTERABLE = 'filterable';
+
+ const FILTERABLE_IN_SEARCH = 'filterable_in_search';
+
+ const POSITION = 'position';
+ /**#@-*/
+
+ /**
+ * Retrieve id of the attribute.
+ *
+ * @return string
+ */
+ public function getAttributeId()
+ {
+ return $this->_get(self::ATTRIBUTE_ID);
+ }
+
+ /**
+ * Retrieve code of the attribute.
+ *
+ * @return string
+ */
+ public function getAttributeCode()
+ {
+ return $this->_get(self::ATTRIBUTE_CODE);
+ }
+
+ /**
+ * Frontend HTML for input element.
+ *
+ * @return string
+ */
+ public function getFrontendInput()
+ {
+ return $this->_get(self::FRONTEND_INPUT);
+ }
+
+ /**
+ * Retrieve validation rules.
+ *
+ * @return \Magento\Catalog\Service\V1\Data\Eav\ValidationRule[]
+ */
+ public function getValidationRules()
+ {
+ return $this->_get(self::VALIDATION_RULES);
+ }
+
+ /**
+ * Whether attribute is visible on frontend.
+ *
+ * @return bool
+ */
+ public function isVisible()
+ {
+ return $this->_get(self::VISIBLE);
+ }
+
+ /**
+ * Whether attribute is required.
+ *
+ * @return bool
+ */
+ public function isRequired()
+ {
+ return $this->_get(self::REQUIRED);
+ }
+
+ /**
+ * Return options of the attribute (key => value pairs for select)
+ *
+ * @return \Magento\Catalog\Service\V1\Data\Eav\Option[]
+ */
+ public function getOptions()
+ {
+ return $this->_get(self::OPTIONS);
+ }
+
+ /**
+ * Whether current attribute has been defined by a user.
+ *
+ * @return bool
+ */
+ public function isUserDefined()
+ {
+ return $this->_get(self::USER_DEFINED);
+ }
+
+ /**
+ * Get label which supposed to be displayed on frontend.
+ *
+ * @return string
+ */
+ public function getFrontendLabel()
+ {
+ return $this->_get(self::FRONTEND_LABEL);
+ }
+
+ /**
+ * Get the note attribute for the element.
+ *
+ * @return string
+ */
+ public function getNote()
+ {
+ return $this->_get(self::NOTE);
+ }
+
+ /**
+ * Get backend type.
+ *
+ * @return string
+ */
+ public function getBackendType()
+ {
+ return $this->_get(self::BACKEND_TYPE);
+ }
+
+ /**
+ * Get default value for the element.
+ *
+ * @return string
+ */
+ public function getDefaultValue()
+ {
+ return $this->_get(self::DEFAULT_VALUE);
+ }
+
+ /**
+ * Whether this is a unique attribute
+ *
+ * @return string
+ */
+ public function isUnique()
+ {
+ return $this->_get(self::UNIQUE);
+ }
+
+ /**
+ * Get apply to value for the element
+ *
+ * Apply to. Empty for "Apply to all"
+ * or array of the following possible values:
+ * - 'simple',
+ * - 'grouped',
+ * - 'configurable',
+ * - 'virtual',
+ * - 'bundle',
+ * - 'downloadable'
+ *
+ * @return string[]
+ */
+ public function getApplyTo()
+ {
+ return $this->_get(self::APPLY_TO);
+ }
+
+ /**
+ * Whether the attribute can be used for configurable products
+ *
+ * @return string
+ */
+ public function isConfigurable()
+ {
+ return $this->_get(self::CONFIGURABLE);
+ }
+
+ /**
+ * Whether the attribute can be used in Quick Search
+ *
+ * @return string
+ */
+ public function isSearchable()
+ {
+ return $this->_get(self::SEARCHABLE);
+ }
+
+ /**
+ * Whether the attribute can be used in Advanced Search
+ *
+ * @return string
+ */
+ public function isVisibleInAdvancedSearch()
+ {
+ return $this->_get(self::VISIBLE_IN_ADVANCED_SEARCH);
+ }
+
+ /**
+ * Whether the attribute can be compared on the frontend
+ *
+ * @return string
+ */
+ public function isComparable()
+ {
+ return $this->_get(self::COMPARABLE);
+ }
+
+ /**
+ * Whether the attribute can be used for promo rules
+ *
+ * @return string
+ */
+ public function isUsedForPromoRules()
+ {
+ return $this->_get(self::USED_FOR_PROMO_RULES);
+ }
+
+ /**
+ * Whether the attribute is visible on the frontend
+ *
+ * @return string
+ */
+ public function isVisibleOnFront()
+ {
+ return $this->_get(self::VISIBLE_ON_FRONT);
+ }
+
+ /**
+ * Whether the attribute can be used in product listing
+ *
+ * @return string
+ */
+ public function getUsedInProductListing()
+ {
+ return $this->_get(self::USED_IN_PRODUCT_LISTING);
+ }
+
+ /**
+ * Retrieve attribute scope
+ *
+ * @return string
+ */
+ public function getScope()
+ {
+ return $this->_get(self::SCOPE);
+ }
+
+ /**
+ * Retrieve frontend class of attribute
+ *
+ * @return string
+ */
+ public function getFrontendClass()
+ {
+ return $this->_get(self::FRONTEND_CLASS);
+ }
+
+ /**
+ * Enable WYSIWYG flag
+ *
+ * @return bool
+ */
+ public function isWysiwygEnabled()
+ {
+ return (bool)$this->_get(self::WYSIWYG_ENABLED);
+ }
+
+ /**
+ * Whether the HTML tags are allowed on the frontend
+ *
+ * @return bool
+ */
+ public function isHtmlAllowedOnFront()
+ {
+ return (bool)$this->_get(self::HTML_ALLOWED_ON_FRONT);
+ }
+
+ /**
+ * Whether it is used for sorting in product listing
+ *
+ * @return bool
+ * @SuppressWarnings(PHPMD.BooleanGetMethodName)
+ */
+ public function getUsedForSortBy()
+ {
+ return (bool)$this->_get(self::USED_FOR_SORT_BY);
+ }
+
+ /**
+ * Whether it used in layered navigation
+ *
+ * @return bool
+ */
+ public function isFilterable()
+ {
+ return (bool)$this->_get(self::FILTERABLE);
+ }
+
+ /**
+ * Whether it is used in search results layered navigation
+ *
+ * @return bool
+ */
+ public function isFilterableInSearch()
+ {
+ return (bool)$this->_get(self::FILTERABLE_IN_SEARCH);
+ }
+
+ /**
+ * Get position
+ *
+ * @return int
+ */
+ public function getPosition()
+ {
+ return (int)$this->_get(self::POSITION);
+ }
+}
View
441 app/code/Magento/Catalog/Service/V1/Data/Eav/AttributeMetadataBuilder.php
@@ -0,0 +1,441 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+namespace Magento\Catalog\Service\V1\Data\Eav;
+
+use Magento\Framework\Service\Data\AbstractObjectBuilder;
+use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
+
+/**
+ * Class AttributeMetadataBuilder
+ */
+class AttributeMetadataBuilder extends AbstractObjectBuilder
+{
+ /**
+ * Option builder
+ *
+ * @var OptionBuilder
+ */
+ protected $optionBuilder;
+
+ /**