Skip to content

Commit 975952e

Browse files
committed
2.0.0.0-dev34
* Test Framework: * Created `CodingStandard_ToolInterface` - new interface for coding standard static tests. Refactored `CodeSniffer` class as an implementation of the interface * Fixed DB isolation in integration tests after themes refactoring * Minor test fixes * Changes in product creation process * Added ability to change product type "on the fly" depending on selected options * Added ability of new category creation on "General" tab * Moved "Associated Products" tab contents to collapsible block on "General" tab for configurable products * Visual enhancement made for base image and Virtual/Downloadable checkbox * Refactored implementation of associated products in backend (admin) to make them configurable through grid layout, rather than hard-coded. * Enhanced product variation matrix for configurable products * Changed "Apply To" feature in product attributes management due to changes in product creation process * Fixed XSS vulnerabilities in `Mage_Wishlist_IndexController`, `Mage_Adminhtml_Block_Review_Edit_Form`, `Mage_Catalog_Product_CompareController` * Bug fixes * Fixed error on `Catalog -> Google Content -> Manage Items page` * Fixed bug with "Update Attributes" mass action for products on backend caused by setting incorrect inheritance of `Mage_Adminhtml_Helper_Catalog_Product_Edit_Action_Attribute` * Added additional validation of "quantity" field to fix issues with inventory during product saving * Added additional validation into `EAV` models to forbid creation of two products with the same unique multi-select attribute
1 parent 71f6961 commit 975952e

File tree

155 files changed

+4999
-1421
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+4999
-1421
lines changed

Diff for: CHANGELOG.markdown

+21
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
2.0.0.0-dev34
2+
=============
3+
* Test Framework:
4+
* Created `CodingStandard_ToolInterface` - new interface for coding standard static tests. Refactored `CodeSniffer` class as an implementation of the interface
5+
* Fixed DB isolation in integration tests after themes refactoring
6+
* Minor test fixes
7+
* Changes in product creation process
8+
* Added ability to change product type "on the fly" depending on selected options
9+
* Added ability of new category creation on "General" tab
10+
* Moved "Associated Products" tab contents to collapsible block on "General" tab for configurable products
11+
* Visual enhancement made for base image and Virtual/Downloadable checkbox
12+
* Refactored implementation of associated products in backend (admin) to make them configurable through grid layout, rather than hard-coded.
13+
* Enhanced product variation matrix for configurable products
14+
* Changed "Apply To" feature in product attributes management due to changes in product creation process
15+
* Fixed XSS vulnerabilities in `Mage_Wishlist_IndexController`, `Mage_Adminhtml_Block_Review_Edit_Form`, `Mage_Catalog_Product_CompareController`
16+
* Bug fixes
17+
* Fixed error on `Catalog -> Google Content -> Manage Items page`
18+
* Fixed bug with "Update Attributes" mass action for products on backend caused by setting incorrect inheritance of `Mage_Adminhtml_Helper_Catalog_Product_Edit_Action_Attribute`
19+
* Added additional validation of "quantity" field to fix issues with inventory during product saving
20+
* Added additional validation into `EAV` models to forbid creation of two products with the same unique multi-select attribute
21+
122
2.0.0.0-dev33
223
=============
324
* Improved Themes functionality to meet the following requirements:

Diff for: app/Mage.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public static function getVersion()
153153
{
154154
$i = self::getVersionInfo();
155155
return trim("{$i['major']}.{$i['minor']}.{$i['revision']}" . ($i['patch'] != '' ? ".{$i['patch']}" : "")
156-
. "-{$i['stability']}{$i['number']}", '.-');
156+
. "-{$i['stability']}{$i['number']}", '.-');
157157
}
158158

159159
/**
@@ -170,7 +170,7 @@ public static function getVersionInfo()
170170
'revision' => '0',
171171
'patch' => '0',
172172
'stability' => 'dev',
173-
'number' => '33',
173+
'number' => '34',
174174
);
175175
}
176176

@@ -280,7 +280,7 @@ public static function setRoot($appRoot = '')
280280
}
281281

282282
if ('' === $appRoot) {
283-
// automagically find application root by dirname of Mage.php
283+
// automatically find application root by dirname of Mage.php
284284
$appRoot = dirname(__FILE__);
285285
}
286286

@@ -896,6 +896,7 @@ public static function getIsDeveloperMode()
896896
* Display exception
897897
*
898898
* @param Exception $e
899+
* @param string $extra
899900
*/
900901
public static function printException(Exception $e, $extra = '')
901902
{

Diff for: app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
*/
3535
class Mage_Adminhtml_Block_Catalog_Category_Tree extends Mage_Adminhtml_Block_Catalog_Category_Abstract
3636
{
37+
const XML_PATH_SUGGESTED_CATEGORIES_LIMIT = 'global/catalog/suggested_categories/limit';
3738

3839
protected $_withProductCount;
3940

@@ -119,7 +120,9 @@ public function getSuggestedCategoriesJson($namePart)
119120

120121
$matchingNamesCollection = clone $collection;
121122
$matchingNamesCollection->addAttributeToFilter('name', array('like' => "%{$namePart}%"))
123+
->addAttributeToFilter('entity_id', array('neq' => Mage_Catalog_Model_Category::TREE_ROOT_ID))
122124
->addAttributeToSelect('path')
125+
->setPageSize((string)Mage::getConfig()->getNode(self::XML_PATH_SUGGESTED_CATEGORIES_LIMIT))
123126
->setStoreId($storeId);
124127

125128
$shownCategoriesIds = array();

Diff for: app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ protected function _prepareForm()
114114
'all' => Mage::helper('Mage_Catalog_Helper_Data')->__('All Product Types'),
115115
'custom' => Mage::helper('Mage_Catalog_Helper_Data')->__('Selected Product Types')
116116
),
117-
'required' => true
117+
'required' => true,
118+
'disabled' => !$attributeObject->getIsUserDefined() && $attributeObject->getId(),
118119
), 'frontend_class');
119120

120121
$fieldset->addField('is_configurable', 'select', array(

Diff for: app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php

+34-3
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,9 @@ public function getDuplicateUrl()
217217

218218
public function getHeader()
219219
{
220-
$header = '';
221220
if ($this->getProduct()->getId()) {
222221
$header = $this->escapeHtml($this->getProduct()->getName());
223-
}
224-
else {
222+
} else {
225223
$header = Mage::helper('Mage_Catalog_Helper_Data')->__('New Product');
226224
}
227225
if ($setName = $this->getAttributeSetName()) {
@@ -277,4 +275,37 @@ public function getAttributesAllowedForAutogeneration()
277275
{
278276
return $this->helper('Mage_Catalog_Helper_Product')->getAttributesAllowedForAutogeneration();
279277
}
278+
279+
/**
280+
* Get data for JS (product type transition)
281+
*
282+
* @return string
283+
*/
284+
public function getTypeSwitcherData()
285+
{
286+
return Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array(
287+
'tab_id' => 'product_info_tabs_downloadable_items',
288+
'is_virtual_id' => Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight_Renderer::VIRTUAL_FIELD_HTML_ID,
289+
'weight_id' => 'weight',
290+
'current_type' => $this->getProduct()->getTypeId(),
291+
'attributes' => $this->_getAttributes(),
292+
));
293+
}
294+
295+
/**
296+
* Get formed array with attribute codes and Apply To property
297+
*
298+
* @return array
299+
*/
300+
protected function _getAttributes()
301+
{
302+
/** @var $product Mage_Catalog_Model_Product */
303+
$product = $this->getProduct();
304+
$attributes = array();
305+
306+
foreach ($product->getAttributes() as $key => $attribute) {
307+
$attributes[$key] = $attribute->getApplyTo();
308+
}
309+
return $attributes;
310+
}
280311
}

Diff for: app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/AttributeSet.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @package Mage_Adminhtml
3232
* @author Magento Core Team <core@magentocommerce.com>
3333
*/
34-
class Mage_Adminhtml_Block_Catalog_Product_Edit_AttributeSet extends Mage_Adminhtml_Block_Widget_Form
34+
class Mage_Adminhtml_Block_Catalog_Product_Edit_AttributeSet extends Mage_Backend_Block_Widget_Form
3535
{
3636
protected function _prepareForm()
3737
{
@@ -54,6 +54,14 @@ protected function _prepareForm()
5454
->toOptionArray()
5555
));
5656

57+
$fieldset->addField(
58+
'type_id',
59+
'hidden',
60+
array(
61+
'name' => 'type_id',
62+
'value' => Mage::registry('product')->getTypeId(),
63+
)
64+
);
5765
$this->setForm($form);
5866
}
5967
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?php
2+
/**
3+
* Magento
4+
*
5+
* NOTICE OF LICENSE
6+
*
7+
* This source file is subject to the Open Software License (OSL 3.0)
8+
* that is bundled with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* http://opensource.org/licenses/osl-3.0.php
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to license@magentocommerce.com so we can send you a copy immediately.
14+
*
15+
* DISCLAIMER
16+
*
17+
* Do not edit or add to this file if you wish to upgrade Magento to newer
18+
* versions in the future. If you wish to customize Magento for your
19+
* needs please refer to http://www.magentocommerce.com for more information.
20+
*
21+
* @category Mage
22+
* @package Mage_Adminhtml
23+
* @copyright Copyright (c) 2012 X.commerce, Inc. (http://www.magentocommerce.com)
24+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25+
*/
26+
27+
/**
28+
* New category creation form
29+
*
30+
* @category Mage
31+
* @package Mage_Adminhtml
32+
* @author Magento Core Team <core@magentocommerce.com>
33+
*/
34+
class Mage_Adminhtml_Block_Catalog_Product_Edit_NewCategory extends Mage_Backend_Block_Widget_Form
35+
{
36+
/**
37+
* Form preparation
38+
*/
39+
protected function _prepareForm()
40+
{
41+
$form = new Varien_Data_Form();
42+
43+
$form->addField('new_category_messages', 'note', array());
44+
45+
$fieldset = $form->addFieldset('new_category_form', array());
46+
47+
$fieldset->addField('new_category_name', 'text', array(
48+
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Category Name'),
49+
'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Category Name'),
50+
'required' => true,
51+
));
52+
53+
$fieldset->addField('new_category_parent', 'text', array(
54+
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Parent Category'),
55+
'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Parent Category'),
56+
'autocomplete' => 'off',
57+
'required' => true,
58+
'class' => 'validate-parent-category',
59+
));
60+
61+
$fieldset->addField('new_category_parent_id', 'hidden', array());
62+
63+
$this->setForm($form);
64+
}
65+
66+
/**
67+
* Category save action URL
68+
*
69+
* @return string
70+
*/
71+
public function getSaveCategoryUrl()
72+
{
73+
return $this->getUrl('*/catalog_category/save');
74+
}
75+
76+
/**
77+
* Category suggestion action URL
78+
*
79+
* @return string
80+
*/
81+
public function getSuggestCategoryUrl()
82+
{
83+
return $this->getUrl('*/catalog_category/suggestCategories');
84+
}
85+
}

0 commit comments

Comments
 (0)