Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update as of 9/05/2012

* Implemented encryption of the credit card name and expiration date for the payment method "Credit Card (saved)"
* Implemented console utility `dev/tools/migration/get_aliases_map.php`, which generates map file "M1 class alias" to "M2 class name"
* Implemented automatic data upgrades for replacing "M1 class aliases" to "M2 class names" in a database
* Implemented recursive `chmod` in the library class `Varien_Io_File`
* Improved verbosity of the library class `Magento_Shell`
* Migrated client-side translation mechanism to jQuery
* Performance tests:
  * Improved assertion for number of created orders for the checkout performance testing scenario
    * Reverted the feature of specifying PHP scenarios to be executed before and after a JMeter scenario
    * Implemented validation for the number of created orders as a part of the JMeter scenario
    * Implemented the "Admin Login" user activity as a separate file to be reused in the performance testing scenarios
  * Implemented fixture of 100k customers for the performance tests
  * Implemented fixture of 100k products for the performance tests
    * Enhanced module `Mage_ImportExport` in order to utilize it for the fixture implementation
  * Implemented back-end performance testing scenario, which covers Dashboard, Manage Products, Manage Customers pages
* Fixes:
  * Fixed Magento console installer to enable write permission recursively to the `var` directory
  * Fixed performance tests to enable write permission recursively to the `var` directory
  * Fixed integration test `Mage_Adminhtml_Model_System_Config_Source_Admin_PageTest::testToOptionArray` to not produce "Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity" in the developer mode
* GitHub requests:
  * [#43](#43) -- implemented logging of executed setup files
  * [#44](#44)
    * Implemented support of writing logs into wrappers (for example, `php://output`)
    * Enforced a log writer model to be an instance of `Zend_Log_Writer_Stream`
  * [#49](#49)
    * Fixed sorting of totals according to "before" and "after" properties
    * Introduced `Magento_Data_Graph` library class and utilized it for finding cycles in "before" and "after" declarations
    * Implemented tests for totals sorting including the ambiguous cases
  • Loading branch information...
commit c0cf1affff1bf37b75d4dbe636405f9142757745 1 parent fa5121e
@mage2-team mage2-team authored
Showing with 4,723 additions and 700 deletions.
  1. +31 −0 CHANGELOG.markdown
  2. +45 −22 app/Mage.php
  3. +1 −7 app/code/community/Phoenix/Moneybookers/view/adminhtml/activation.js
  4. +1 −5 app/code/core/Mage/Adminhtml/Helper/Media/Js.php
  5. +4 −0 app/code/core/Mage/Adminhtml/view/adminhtml/dataflow.xml
  6. +2 −0  app/code/core/Mage/Adminhtml/view/adminhtml/main.xml
  7. +3 −1 app/code/core/Mage/Adminhtml/view/adminhtml/page/js/translate.phtml
  8. +1 −1  app/code/core/Mage/Adminhtml/view/adminhtml/promo/rules.js
  9. +1 −1  app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/scripts.js
  10. +56 −0 app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.16-1.6.0.0.17.php
  11. +1 −1  app/code/core/Mage/Catalog/etc/config.xml
  12. +44 −0 app/code/core/Mage/CatalogRule/data/catalogrule_setup/data-upgrade-1.6.0.3-1.6.0.4.php
  13. +1 −1  app/code/core/Mage/CatalogRule/etc/config.xml
  14. +5 −5 app/code/core/Mage/Checkout/view/frontend/opcheckout.js
  15. +55 −0 app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.2-1.6.0.0.3.php
  16. +1 −1  app/code/core/Mage/Cms/etc/config.xml
  17. +1 −1  app/code/core/Mage/Core/Helper/Js.php
  18. +4 −1 app/code/core/Mage/Core/Model/Resource/Setup.php
  19. +760 −0 app/code/core/Mage/Core/Model/Resource/Setup/Migration.php
  20. +43 −0 app/code/core/Mage/Core/data/core_setup/data-upgrade-1.6.0.3-1.6.0.4.php
  21. +4 −1 app/code/core/Mage/Core/etc/config.xml
  22. +14 −4 ...ipts_before.php → app/code/core/Mage/Customer/data/customer_setup/data-upgrade-1.6.2.0.1-1.6.2.0.2.php
  23. +1 −1  app/code/core/Mage/Customer/etc/config.xml
  24. +11 −11 app/code/core/Mage/DesignEditor/view/frontend/js/change/layout.js
  25. +4 −4 app/code/core/Mage/DesignEditor/view/frontend/js/design_editor.js
  26. +75 −0 app/code/core/Mage/Eav/data/eav_setup/data-upgrade-1.6.0.0-1.6.0.1.php
  27. +1 −1  app/code/core/Mage/Eav/etc/config.xml
  28. +4 −5 app/code/core/Mage/ImportExport/Model/Import.php
  29. +1 −1  app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php
  30. +3 −2 app/code/core/Mage/ImportExport/controllers/Adminhtml/ImportController.php
  31. +1 −2  app/code/core/Mage/Install/Model/Installer/Console.php
  32. +2 −0  app/code/core/Mage/Install/view/install/page.phtml
  33. +49 −0 app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.1-1.6.0.2.php
  34. +2 −2 app/code/core/Mage/Newsletter/etc/config.xml
  35. +4 −0 app/code/core/Mage/Page/view/frontend/layout.xml
  36. +1 −1  app/code/core/Mage/Payment/Model/Info.php
  37. +1 −1  app/code/core/Mage/Payment/etc/config.xml
  38. +2 −1  app/code/core/Mage/Payment/etc/system.xml
  39. +105 −63 app/code/core/Mage/Sales/Model/Config/Ordered.php
  40. +54 −0 app/code/core/Mage/Sales/Model/ConverterInterface.php
  41. +111 −0 app/code/core/Mage/Sales/Model/Payment/Method/Converter.php
  42. +0 −6 app/code/core/Mage/Sales/Model/Quote/Payment.php
  43. +68 −0 app/code/core/Mage/Sales/Model/Resource/Abstract.php
  44. +1 −0  app/code/core/Mage/Sales/Model/Resource/Order/Payment.php
  45. +10 −0 app/code/core/Mage/Sales/Model/Resource/Order/Payment/Collection.php
  46. +1 −0  app/code/core/Mage/Sales/Model/Resource/Quote/Payment.php
  47. +10 −0 app/code/core/Mage/Sales/Model/Resource/Quote/Payment/Collection.php
  48. +95 −0 app/code/core/Mage/Sales/data/sales_setup/data-upgrade-1.6.0.8-1.6.0.9.php
  49. +1 −1  app/code/core/Mage/Sales/etc/config.xml
  50. +50 −0 app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.8-1.6.0.9.php
  51. +44 −0 app/code/core/Mage/SalesRule/data/salesrule_setup/data-upgrade-1.6.0.3-1.6.0.4.php
  52. +1 −1  app/code/core/Mage/SalesRule/etc/config.xml
  53. +14 −9 ...ite/checkout_before.php → app/code/core/Mage/Widget/data/widget_setup/data-upgrade-1.6.0.0-1.6.0.1.php
  54. +1 −1  app/code/core/Mage/Widget/etc/config.xml
  55. +4 −0 app/design/frontend/default/iphone/Mage_Page/layout.xml
  56. +4 −0 app/design/frontend/default/modern/Mage_Page/layout.xml
  57. +1 −2  dev/tests/integration/testsuite/Mage/Adminhtml/Model/System/Config/Source/Admin/PageTest.php
  58. +3 −3 dev/tests/integration/testsuite/Mage/Core/Helper/JsTest.php
  59. +11 −10 dev/tests/integration/testsuite/Mage/ImportExport/Model/ImportTest.php
  60. +3 −0  dev/tests/integration/testsuite/Mage/Install/controllers/WizardControllerTest.php
  61. +23 −0 dev/tests/integration/testsuite/MageTest.php
  62. +37 −0 dev/tests/integration/testsuite/integrity/Mage/Sales/TotalDeclarationTest.php
  63. +3 −1 dev/tests/js/jsTestDriver.conf
  64. +67 −0 dev/tests/js/testsuite/mage/translate/translateTest.js
  65. +32 −16 dev/tests/performance/framework/Magento/Config.php
  66. +98 −0 dev/tests/performance/framework/Magento/ImportExport/Fixture/Generator.php
  67. +9 −0 dev/tests/performance/framework/Magento/Installer.php
  68. +0 −42 dev/tests/performance/framework/Magento/Scenario.php
  69. +1 −0  dev/tests/performance/framework/tests/unit/phpunit.xml.dist
  70. +74 −19 dev/tests/performance/framework/tests/unit/testsuite/Magento/ConfigTest.php
  71. +15 −1 ...it/testsuite/Magento/{_files/scenario_with_scripts_after.php → ImportExport/Fixture/GeneratorTest.php}
  72. +1 −1  dev/tests/performance/framework/tests/unit/testsuite/Magento/InstallerTest.php
  73. +0 −27 dev/tests/performance/framework/tests/unit/testsuite/Magento/ScenarioTest.php
  74. +0 −29 dev/tests/performance/framework/tests/unit/testsuite/Magento/_files/scenario_with_scripts.jmx
  75. +0 −37 dev/tests/performance/framework/tests/unit/testsuite/Magento/_files/scenario_with_scripts.jtl
  76. +204 −0 dev/tests/performance/testsuite/backend.jmx
  77. +183 −31 dev/tests/performance/testsuite/checkout.jmx
  78. +0 −49 dev/tests/performance/testsuite/checkout_after.php
  79. +57 −0 dev/tests/performance/testsuite/fixtures/catalog_100k_products.php
  80. +74 −0 dev/tests/performance/testsuite/fixtures/customer_100k_customers.php
  81. +4 −97 dev/tests/performance/testsuite/product_edit.jmx
  82. +229 −0 dev/tests/performance/testsuite/reusable/admin_login.jmx
  83. +1 −0  dev/tests/static/testsuite/Php/_files/whitelist/core.txt
  84. +270 −0 dev/tests/unit/testsuite/Mage/Core/Model/Resource/Setup/MigrationTest.php
  85. +91 −0 dev/tests/unit/testsuite/Mage/Core/Model/Resource/Setup/_files/data_content_plain_model.php
  86. +56 −0 dev/tests/unit/testsuite/Mage/Core/Model/Resource/Setup/_files/data_content_plain_pk_fields.php
  87. +60 −0 dev/tests/unit/testsuite/Mage/Core/Model/Resource/Setup/_files/data_content_plain_resource.php
  88. +64 −0 dev/tests/unit/testsuite/Mage/Core/Model/Resource/Setup/_files/data_content_serialized.php
  89. +64 −0 dev/tests/unit/testsuite/Mage/Core/Model/Resource/Setup/_files/data_content_wiki.php
  90. +64 −0 dev/tests/unit/testsuite/Mage/Core/Model/Resource/Setup/_files/data_content_xml.php
  91. +118 −0 dev/tests/unit/testsuite/Mage/Sales/Model/Config/OrderTest.php
  92. +77 −0 dev/tests/unit/testsuite/Mage/Sales/Model/Config/_files/core_totals_config.php
  93. +51 −0 dev/tests/unit/testsuite/Mage/Sales/Model/Config/_files/custom_totals_config.php
  94. +123 −0 dev/tests/unit/testsuite/Magento/Data/GraphTest.php
  95. +28 −20 dev/tests/unit/testsuite/Magento/ShellTest.php
  96. +108 −0 dev/tests/unit/testsuite/Varien/Io/FileTest.php
  97. +36 −0 dev/tools/migration/aliases_map/composite_modules_ce.php
  98. +192 −0 dev/tools/migration/get_aliases_map.php
  99. +195 −0 lib/Magento/Data/Graph.php
  100. +17 −10 lib/Magento/Shell.php
  101. +3 −6 lib/Varien/Data/Form/Element/Editor.php
  102. +115 −93 lib/Varien/Io/File.php
  103. +1 −7 pub/js/mage/adminhtml/flexuploader.js
  104. +1 −1  pub/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js
  105. +1 −1  pub/js/mage/adminhtml/wysiwyg/widget.js
  106. +1 −0  pub/js/mage/jquery-no-conflict.js
  107. +39 −23 pub/js/mage/translate.js
  108. +2 −6 pub/js/prototype/validation.js
  109. +2 −3 pub/js/varien/js.js
View
31 CHANGELOG.markdown
@@ -1,3 +1,34 @@
+Update as of 9/05/2012
+======================
+* Implemented encryption of the credit card name and expiration date for the payment method "Credit Card (saved)"
+* Implemented console utility `dev/tools/migration/get_aliases_map.php`, which generates map file "M1 class alias" to "M2 class name"
+* Implemented automatic data upgrades for replacing "M1 class aliases" to "M2 class names" in a database
+* Implemented recursive `chmod` in the library class `Varien_Io_File`
+* Improved verbosity of the library class `Magento_Shell`
+* Migrated client-side translation mechanism to jQuery
+* Performance tests:
+ * Improved assertion for number of created orders for the checkout performance testing scenario
+ * Reverted the feature of specifying PHP scenarios to be executed before and after a JMeter scenario
+ * Implemented validation for the number of created orders as a part of the JMeter scenario
+ * Implemented the "Admin Login" user activity as a separate file to be reused in the performance testing scenarios
+ * Implemented fixture of 100k customers for the performance tests
+ * Implemented fixture of 100k products for the performance tests
+ * Enhanced module `Mage_ImportExport` in order to utilize it for the fixture implementation
+ * Implemented back-end performance testing scenario, which covers Dashboard, Manage Products, Manage Customers pages
+* Fixes:
+ * Fixed Magento console installer to enable write permission recursively to the `var` directory
+ * Fixed performance tests to enable write permission recursively to the `var` directory
+ * Fixed integration test `Mage_Adminhtml_Model_System_Config_Source_Admin_PageTest::testToOptionArray` to not produce "Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity" in the developer mode
+* GitHub requests:
+ * [#43](https://github.com/magento/magento2/pull/43) -- implemented logging of executed setup files
+ * [#44](https://github.com/magento/magento2/pull/44)
+ * Implemented support of writing logs into wrappers (for example, `php://output`)
+ * Enforced a log writer model to be an instance of `Zend_Log_Writer_Stream`
+ * [#49](https://github.com/magento/magento2/pull/49)
+ * Fixed sorting of totals according to "before" and "after" properties
+ * Introduced `Magento_Data_Graph` library class and utilized it for finding cycles in "before" and "after" declarations
+ * Implemented tests for totals sorting including the ambiguous cases
+
Update as of 8/30/2012
======================
* Fixes:
View
67 app/Mage.php
@@ -100,6 +100,13 @@
static private $_isInstalled;
/**
+ * Logger entities
+ *
+ * @var array
+ */
+ static private $_loggers = array();
+
+ /**
* Magento edition constants
*/
const EDITION_COMMUNITY = 'Community';
@@ -172,6 +179,7 @@ public static function reset()
self::$_isDownloader = false;
self::$_isDeveloperMode = false;
self::$_isInstalled = null;
+ self::$_loggers = array();
// do not reset $headersSentThrowsException
}
@@ -761,50 +769,65 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
return;
}
- static $loggers = array();
-
$level = is_null($level) ? Zend_Log::DEBUG : $level;
$file = empty($file) ? 'system.log' : $file;
try {
- if (!isset($loggers[$file])) {
- $logDir = self::getBaseDir('var') . DS . 'log';
- $logFile = $logDir . DS . $file;
-
- if (!is_dir($logDir)) {
- mkdir($logDir);
- chmod($logDir, 0777);
- }
-
- if (!file_exists($logFile)) {
- file_put_contents($logFile, '');
- chmod($logFile, 0777);
- }
+ if (!isset(self::$_loggers[$file])) {
+ $logFile = self::_expandLogFileName($file);
$format = '%timestamp% %priorityName% (%priority%): %message%' . PHP_EOL;
$formatter = new Zend_Log_Formatter_Simple($format);
$writerModel = (string)self::getConfig()->getNode('global/log/core/writer_model');
- if (!self::$_app || !$writerModel) {
- $writer = new Zend_Log_Writer_Stream($logFile);
- }
- else {
- $writer = new $writerModel($logFile);
+ if (!self::$_app || !$writerModel || !is_subclass_of($writerModel, 'Zend_Log_Writer_Stream')) {
+ $writerModel = 'Zend_Log_Writer_Stream';
}
+ /** @var $writer Zend_Log_Writer_Stream */
+ $writer = new $writerModel($logFile);
$writer->setFormatter($formatter);
- $loggers[$file] = new Zend_Log($writer);
+ self::$_loggers[$file] = new Zend_Log($writer);
}
if (is_array($message) || is_object($message)) {
$message = print_r($message, true);
}
- $loggers[$file]->log($message, $level);
+ self::$_loggers[$file]->log($message, $level);
}
catch (Exception $e) {
}
}
/**
+ * Expand log file name to absolute path, if necessary
+ *
+ * @param string $file
+ * @return string
+ */
+ protected static function _expandLogFileName($file)
+ {
+ /*
+ * Check whether a file is a wrapper
+ * @link http://www.php.net/manual/en/wrappers.php
+ */
+ if (preg_match('#^[a-z][a-z0-9+.-]*\://#i', $file)) {
+ return $file;
+ }
+ $dir = self::getBaseDir('var') . DIRECTORY_SEPARATOR . 'log';
+ $file = $dir . DIRECTORY_SEPARATOR . $file;
+ if (!is_dir($dir)) {
+ mkdir($dir);
+ chmod($dir, 0777);
+ }
+ if (!file_exists($file)) {
+ file_put_contents($file, '');
+ chmod($file, 0777);
+ }
+ return $file;
+ }
+
+
+ /**
* Write exception to log
*
* @param Exception $e
View
8 app/code/community/Phoenix/Moneybookers/view/adminhtml/activation.js
@@ -74,13 +74,7 @@ Moneybookers.prototype = {
},
translate: function(text) {
- try {
- if(Translator){
- return Translator.translate(text);
- }
- }
- catch(e){}
- return text;
+ return jQuery.mage.__ ? jQuery.mage.__(text) : text;
},
button: function () {
View
6 app/code/core/Mage/Adminhtml/Helper/Media/Js.php
@@ -60,11 +60,7 @@ public function __construct()
*/
public function getTranslatorScript()
{
- $script = 'if (typeof(Translator) == \'undefined\') {'
- . ' var Translator = new Translate('.$this->getTranslateJson().');'
- . '} else {'
- . ' Translator.add('.$this->getTranslateJson().');'
- . '}';
+ $script = '(function($) {$.mage.translate.add(' . $this->getTranslateJson() . ')})(jQuery);';
return $this->getScript($script);
}
View
4 app/code/core/Mage/Adminhtml/view/adminhtml/dataflow.xml
@@ -32,6 +32,8 @@
<remove name="root"/>
<block type="Mage_Adminhtml_Block_Page" name="convert_root" output="1" template="admin/page.phtml">
<block type="Mage_Adminhtml_Block_Page_Head" name="convert_root_head" as="head" template="page/head.phtml">
+ <action method="addJs"><file>jquery/jquery-1.7.1.min.js</file></action>
+ <action method="addJs"><file>mage/jquery-no-conflict.js</file></action>
<action method="addJs"><file>prototype/prototype.js</file></action>
<action method="addJs"><file>prototype/validation.js</file></action>
<action method="addJs"><file>varien/js.js</file></action>
@@ -46,6 +48,8 @@
<remove name="root"/>
<block type="Mage_Adminhtml_Block_Page" name="convert_root" output="1" template="admin/page.phtml">
<block type="Mage_Adminhtml_Block_Page_Head" name="convert_root_head" as="head" template="page/head.phtml">
+ <action method="addJs"><file>jquery/jquery-1.7.1.min.js</file></action>
+ <action method="addJs"><file>mage/jquery-no-conflict.js</file></action>
<action method="addJs"><file>prototype/prototype.js</file></action>
<action method="addJs"><file>prototype/validation.js</file></action>
<action method="addJs"><file>varien/js.js</file></action>
View
2  app/code/core/Mage/Adminhtml/view/adminhtml/main.xml
@@ -55,6 +55,8 @@ Supported layout update handles (special):
<block type="Mage_Adminhtml_Block_Page" name="root" output="1" template="admin/page.phtml">
<block type="Mage_Adminhtml_Block_Page_Head" name="head" as="head" template="page/head.phtml">
<action method="setTitle" translate="title"><title>Magento Admin</title></action>
+ <action method="addJs"><file>jquery/jquery-1.7.1.min.js</file></action>
+ <action method="addJs"><file>mage/jquery-no-conflict.js</file></action>
<action method="addJs"><file>prototype/prototype.js</file></action>
<action method="addJs"><file>mage/adminhtml/fix-extjs-defer.js</file><params/><if/><condition>can_load_ext_js</condition></action>
<action method="addJs"><file>mage/adminhtml/fix-extjs-defer-before.js</file><params/><if/><condition>can_load_ext_js</condition></action>
View
4 app/code/core/Mage/Adminhtml/view/adminhtml/page/js/translate.phtml
@@ -63,5 +63,7 @@ $_data = array(
);
?>
<script type="text/javascript">
- var Translator = new Translate(<?php echo Zend_Json::encode($_data) ?>);
+ (function($) {
+ $.mage.translate.add(<?php echo Zend_Json::encode($_data) ?>)
+ })(jQuery);
</script>
View
2  app/code/core/Mage/Adminhtml/view/adminhtml/promo/rules.js
@@ -295,7 +295,7 @@ VarienRulesForm.prototype = {
var new_type = elem.value;
var new_elem = document.createElement('LI');
new_elem.className = 'rule-param-wait';
- new_elem.innerHTML = Translator.translate('Please wait, loading...');
+ new_elem.innerHTML = jQuery.mage.__('Please wait, loading...');
children_ul.insertBefore(new_elem, $(elem).up('li'));
new Ajax.Request(this.newChildUrl, {
View
2  app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/scripts.js
@@ -60,7 +60,7 @@ AdminOrder.prototype = {
}
});
- var searchButton = new ControlButton(Translator.translate('Add Products')),
+ var searchButton = new ControlButton(jQuery.mage.__('Add Products')),
searchAreaId = this.getAreaId('search');
searchButton.onClick = function() {
$(searchAreaId).show();
View
56 app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.16-1.6.0.0.17.php
@@ -0,0 +1,56 @@
+<?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.
+ *
+ * @category Mage
+ * @package Mage_Catalog
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/** @var $this Mage_Catalog_Model_Resource_Setup */
+
+/** @var $installer Mage_Core_Model_Resource_Setup_Migration */
+$installer = Mage::getResourceModel('Mage_Core_Model_Resource_Setup_Migration', 'core_setup');
+$installer->startSetup();
+
+$attributeData = $this->getAttribute('catalog_category', 'custom_layout_update');
+$installer->appendClassAliasReplace('catalog_category_entity_text', 'value',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_BLOCK,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_XML,
+ array('value_id'),
+ 'attribute_id = ' . (int) $attributeData['attribute_id']
+);
+
+$attributeData = $this->getAttribute('catalog_product', 'custom_layout_update');
+$installer->appendClassAliasReplace('catalog_product_entity_text', 'value',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_BLOCK,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_XML,
+ array('value_id'),
+ 'attribute_id = ' . (int) $attributeData['attribute_id']
+);
+
+$installer->appendClassAliasReplace('catalog_eav_attribute', 'frontend_input_renderer',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_BLOCK,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_PLAIN,
+ array('attribute_id')
+);
+$installer->doUpdateClassAliases();
+
+$installer->endSetup();
View
2  app/code/core/Mage/Catalog/etc/config.xml
@@ -28,7 +28,7 @@
<config>
<modules>
<Mage_Catalog>
- <version>1.6.0.0.16</version>
+ <version>1.6.0.0.17</version>
<active>true</active>
<codePool>core</codePool>
<depends>
View
44 app/code/core/Mage/CatalogRule/data/catalogrule_setup/data-upgrade-1.6.0.3-1.6.0.4.php
@@ -0,0 +1,44 @@
+<?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.
+ *
+ * @category Mage
+ * @package Mage_CatalogRule
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/** @var $installer Mage_Core_Model_Resource_Setup_Migration */
+$installer = Mage::getResourceModel('Mage_Core_Model_Resource_Setup_Migration', 'core_setup');
+$installer->startSetup();
+
+$installer->appendClassAliasReplace('catalogrule', 'conditions_serialized',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_MODEL,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_SERIALIZED,
+ array('rule_id')
+);
+$installer->appendClassAliasReplace('catalogrule', 'actions_serialized',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_MODEL,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_SERIALIZED,
+ array('rule_id')
+);
+
+$installer->doUpdateClassAliases();
+
+$installer->endSetup();
View
2  app/code/core/Mage/CatalogRule/etc/config.xml
@@ -28,7 +28,7 @@
<config>
<modules>
<Mage_CatalogRule>
- <version>1.6.0.3</version>
+ <version>1.6.0.4</version>
<active>true</active>
<codePool>core</codePool>
<depends>
View
10 app/code/core/Mage/Checkout/view/frontend/opcheckout.js
@@ -136,7 +136,7 @@ Checkout.prototype = {
this.gotoSection('billing');
}
else{
- alert(Translator.translate('Please choose to register or to checkout as a guest').stripTags());
+ alert(jQuery.mage.__('Please choose to register or to checkout as a guest').stripTags());
return false;
}
document.body.fire('login:setMethod', {method : this.method});
@@ -545,7 +545,7 @@ ShippingMethod.prototype = {
validate: function() {
var methods = document.getElementsByName('shipping_method');
if (methods.length==0) {
- alert(Translator.translate('Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.').stripTags());
+ alert(jQuery.mage.__('Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.').stripTags());
return false;
}
@@ -558,7 +558,7 @@ ShippingMethod.prototype = {
return true;
}
}
- alert(Translator.translate('Please specify shipping method.').stripTags());
+ alert(jQuery.mage.__('Please specify shipping method.').stripTags());
return false;
},
@@ -732,7 +732,7 @@ Payment.prototype = {
}
var methods = document.getElementsByName('payment[method]');
if (methods.length==0) {
- alert(Translator.translate('Your order cannot be completed at this time as there is no payment methods available for it.').stripTags());
+ alert(jQuery.mage.__('Your order cannot be completed at this time as there is no payment methods available for it.').stripTags());
return false;
}
for (var i=0; i<methods.length; i++) {
@@ -744,7 +744,7 @@ Payment.prototype = {
if (result) {
return true;
}
- alert(Translator.translate('Please specify payment method.').stripTags());
+ alert(jQuery.mage.__('Please specify payment method.').stripTags());
return false;
},
View
55 app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.2-1.6.0.0.3.php
@@ -0,0 +1,55 @@
+<?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.
+ *
+ * @category Mage
+ * @package Mage_Cms
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/** @var $installer Mage_Core_Model_Resource_Setup_Migration */
+$installer = Mage::getResourceModel('Mage_Core_Model_Resource_Setup_Migration', 'core_setup');
+$installer->startSetup();
+
+$installer->appendClassAliasReplace('cms_block', 'content',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_BLOCK,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_WIKI,
+ array('block_id')
+);
+$installer->appendClassAliasReplace('cms_page', 'content',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_BLOCK,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_WIKI,
+ array('page_id')
+);
+$installer->appendClassAliasReplace('cms_page', 'layout_update_xml',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_BLOCK,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_XML,
+ array('page_id')
+);
+$installer->appendClassAliasReplace('cms_page', 'custom_layout_update_xml',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_BLOCK,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_XML,
+ array('page_id')
+);
+
+$installer->doUpdateClassAliases();
+
+$installer->endSetup();
+
View
2  app/code/core/Mage/Cms/etc/config.xml
@@ -28,7 +28,7 @@
<config>
<modules>
<Mage_Cms>
- <version>1.6.0.0.2</version>
+ <version>1.6.0.0.3</version>
<active>true</active>
<codePool>core</codePool>
<depends>
View
2  app/code/core/Mage/Core/Helper/Js.php
@@ -72,7 +72,7 @@ public function getTranslateJson()
*/
public function getTranslatorScript()
{
- $script = 'var Translator = new Translate('.$this->getTranslateJson().');';
+ $script = '(function($) {$.mage.translate.add(' . $this->getTranslateJson() . ')})(jQuery);';
return $this->getScript($script);
}
View
5 app/code/core/Mage/Core/Model/Resource/Setup.php
@@ -640,10 +640,13 @@ protected function _modifyResourceDb($actionType, $fromVersion, $toVersion)
if ($result) {
$this->_setResourceVersion($actionType, $file['toVersion']);
+ Mage::log($fileName);
+ } else {
+ Mage::log("Failed resource setup: {$fileName}");
}
} catch (Exception $e) {
printf('<pre>%s</pre>', print_r($e, true));
- throw Mage::exception('Mage_Core', Mage::helper('Mage_Core_Helper_Data')->__('Error in file: "%s" - %s', $fileName, $e->getMessage()));
+ throw new Magento_Exception(sprintf('Error in file: "%s" - %s', $fileName, $e->getMessage()), 0, $e);
}
$version = $file['toVersion'];
$this->getConnection()->allowDdlCache();
View
760 app/code/core/Mage/Core/Model/Resource/Setup/Migration.php
@@ -0,0 +1,760 @@
+<?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.
+ *
+ * @category Mage
+ * @package Mage_Core
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * Resource setup model with methods needed for migration process between Magento versions
+ */
+class Mage_Core_Model_Resource_Setup_Migration extends Mage_Core_Model_Resource_Setup
+{
+ /**#@+
+ * Type of field content where class alias is used
+ */
+ const FIELD_CONTENT_TYPE_PLAIN = 'plain';
+ const FIELD_CONTENT_TYPE_XML = 'xml';
+ const FIELD_CONTENT_TYPE_WIKI = 'wiki';
+ const FIELD_CONTENT_TYPE_SERIALIZED = 'serialized';
+ /**#@-*/
+
+ /**#@+
+ * Entity type of alias
+ */
+ const ENTITY_TYPE_MODEL = 'Model';
+ const ENTITY_TYPE_BLOCK = 'Block';
+ const ENTITY_TYPE_RESOURCE = 'Model_Resource';
+ /**#@-*/
+
+ /**#@+
+ * Find/replace patterns
+ */
+ const PLAIN_FIND_PATTERN = '/^(?P<alias>[a-z]+[_a-z\d]*?\/[a-z]+[_a-z\d]*?)::.*?$/sui';
+ const WIKI_FIND_PATTERN
+ = '/{{(block|widget).*?type=\"(?P<alias>[a-z]+[_a-z\d]*?\/[a-z]+[_a-z\d]*?)\".*?}}/sui';
+ const XML_FIND_PATTERN = '/<block.*?type=\"(?P<alias>[a-z]+[_a-z\d]*?\/[a-z]+[_a-z\d]*?)\".*?>/sui';
+ const SERIALIZED_FIND_PATTERN = '#(?P<string>s:\d+:"(?P<alias>[a-z]+[_a-z\d]*?/[a-z]+[_a-z\d]*?)")#sui';
+ const SERIALIZED_REPLACE_PATTERN = 's:%d:"%s"';
+ /**#@-*/
+
+ /**
+ * Config key for path to aliases map file
+ */
+ const CONFIG_KEY_PATH_TO_MAP_FILE = 'global/migration/path_to_aliases_map_file';
+
+ /**
+ * List of possible entity types sorted by possibility of usage
+ *
+ * @var array
+ */
+ protected $_entityTypes = array(self::ENTITY_TYPE_MODEL, self::ENTITY_TYPE_BLOCK, self::ENTITY_TYPE_RESOURCE);
+
+ /**
+ * Rows per page. To split processing data from tables
+ *
+ * @var int
+ */
+ protected $_rowsPerPage = 100;
+
+ /**
+ * Replace rules for tables
+ *
+ * [table name] => array(
+ * [field name] => array(
+ * 'entity_type' => [entity type]
+ * 'content_type' => [content type]
+ * 'additional_where' => [additional where]
+ * )
+ * )
+ *
+ * @var array
+ */
+ protected $_replaceRules = array();
+
+ /**
+ * Aliases to classes map
+ *
+ * [entity type] => array(
+ * [alias] => [class name]
+ * )
+ *
+ * @var array
+ */
+ protected $_aliasesMap;
+
+ /**
+ * Replacement regexps for specified content types
+ *
+ * @var array
+ */
+ protected $_replacePatterns = array(
+ self::FIELD_CONTENT_TYPE_WIKI => self::WIKI_FIND_PATTERN,
+ self::FIELD_CONTENT_TYPE_XML => self::XML_FIND_PATTERN,
+ );
+
+ /**
+ * @var Mage_Core_Helper_Data
+ */
+ protected $_coreHelper;
+
+ /**
+ * Application root absolute path
+ *
+ * @var string
+ */
+ protected $_baseDir;
+
+ /**
+ * Path to map file from config
+ *
+ * @var string
+ */
+ protected $_pathToMapFile;
+
+ /**
+ * List of composite module names
+ *
+ * @var array
+ */
+ protected $_compositeModules;
+
+ /**
+ * Constructor
+ *
+ * @param string $resourceName
+ * @param array $data
+ */
+ public function __construct($resourceName, array $data = array())
+ {
+ if (!isset($data['resource_config'])
+ || !isset($data['connection_config'])
+ || !isset($data['module_config'])
+ || !isset($data['connection'])
+ ) {
+ parent::__construct($resourceName);
+ } else {
+ $this->_resourceName = $resourceName;
+
+ if (isset($data['connection'])) {
+ $this->_conn = $data['connection'];
+ }
+
+ $this->_initConfigs($data);
+ }
+
+ if (isset($data['autoload'])) {
+ $this->_autoload = $data['autoload'];
+ } else {
+ $this->_autoload = Magento_Autoload::getInstance();
+ }
+
+ if (isset($data['core_helper'])) {
+ $this->_coreHelper = $data['core_helper'];
+ } else {
+ $this->_coreHelper = Mage::helper('Mage_Core_Helper_Data');
+ }
+
+ if (isset($data['base_dir'])) {
+ $this->_baseDir = $data['base_dir'];
+ } else {
+ $this->_baseDir = Mage::getBaseDir();
+ }
+
+ $this->_initAliasesMapConfiguration($data);
+ }
+
+ /**
+ * Init configs
+ *
+ * @param array $data
+ */
+ protected function _initConfigs(array $data = array())
+ {
+ if (isset($data['resource_config'])) {
+ $this->_resourceConfig = $data['resource_config'];
+ }
+
+ if (isset($data['connection_config'])) {
+ $this->_connectionConfig = $data['connection_config'];
+ }
+
+ if (isset($data['module_config'])) {
+ $this->_moduleConfig = $data['module_config'];
+ }
+ }
+
+ /**
+ * Init aliases map configuration
+ *
+ * @param array $data
+ */
+ protected function _initAliasesMapConfiguration(array $data = array())
+ {
+ if (isset($data['path_to_map_file'])) {
+ $this->_pathToMapFile = $data['path_to_map_file'];
+ } else {
+ $this->_pathToMapFile = Mage::getConfig()->getNode(self::CONFIG_KEY_PATH_TO_MAP_FILE);
+ }
+
+ if (isset($data['aliases_map'])) {
+ $this->_aliasesMap = $data['aliases_map'];
+ }
+ }
+
+ /**
+ * Add alias replace rule
+ *
+ * @param string $tableName name of table to replace aliases in
+ * @param string $fieldName name of table column to replace aliases in
+ * @param string $entityType entity type of alias
+ * @param string $fieldContentType type of field content where class alias is used
+ * @param array $primaryKeyFields row pk field(s) to update by
+ * @param string $additionalWhere additional where condition
+ * @return void
+ */
+ public function appendClassAliasReplace($tableName, $fieldName, $entityType = '',
+ $fieldContentType = self::FIELD_CONTENT_TYPE_PLAIN, array $primaryKeyFields = array(), $additionalWhere = ''
+ ) {
+ if (!isset($this->_replaceRules[$tableName])) {
+ $this->_replaceRules[$tableName] = array();
+ }
+
+ if (!isset($this->_replaceRules[$tableName][$fieldName])) {
+ $this->_replaceRules[$tableName][$fieldName] = array(
+ 'entity_type' => $entityType,
+ 'content_type' => $fieldContentType,
+ 'pk_fields' => $primaryKeyFields,
+ 'additional_where' => $additionalWhere,
+ );
+ }
+ }
+
+ /**
+ * Start process of replacing aliases with class names using rules
+ */
+ public function doUpdateClassAliases()
+ {
+ foreach ($this->_replaceRules as $tableName => $tableRules) {
+ $this->_updateClassAliasesInTable($tableName, $tableRules);
+ }
+ }
+
+ /**
+ * Update class aliases in table
+ *
+ * @param string $tableName name of table to replace aliases in
+ * @param array $tableRules replacing rules for table
+ */
+ protected function _updateClassAliasesInTable($tableName, array $tableRules)
+ {
+ foreach ($tableRules as $fieldName => $fieldRule) {
+ $pagesCount = ceil(
+ $this->_getRowsCount($tableName, $fieldName, $fieldRule['additional_where']) / $this->_rowsPerPage
+ );
+
+ for ($page = 1; $page <= $pagesCount; $page++) {
+ $this->_applyFieldRule($tableName, $fieldName, $fieldRule, $page);
+ }
+ }
+ }
+
+ /**
+ * Get amount of rows for table column which should be processed
+ *
+ * @param string $tableName name of table to replace aliases in
+ * @param string $fieldName name of table column to replace aliases in
+ * @param string $additionalWhere additional where condition
+ *
+ * @return int
+ */
+ protected function _getRowsCount($tableName, $fieldName, $additionalWhere = '')
+ {
+ $adapter = $this->getConnection();
+
+ $query = $adapter->select()
+ ->from($adapter->getTableName($tableName), array('rows_count' => new Zend_Db_Expr('COUNT(*)')))
+ ->where($fieldName . ' IS NOT NULL');
+
+ if (!empty($additionalWhere)) {
+ $query->where($additionalWhere);
+ }
+
+ return (int) $adapter->fetchOne($query);
+ }
+
+ /**
+ * Replace aliases with class names in rows
+ *
+ * @param string $tableName name of table to replace aliases in
+ * @param string $fieldName name of table column to replace aliases in
+ * @param array $fieldRule
+ * @param int $currentPage
+ */
+ protected function _applyFieldRule($tableName, $fieldName, array $fieldRule, $currentPage = 0)
+ {
+ $fieldsToSelect = array($fieldName);
+ if (!empty($fieldRule['pk_fields'])) {
+ $fieldsToSelect = array_merge($fieldsToSelect, $fieldRule['pk_fields']);
+ }
+ $tableData = $this->_getTableData($tableName, $fieldName, $fieldsToSelect, $fieldRule['additional_where'],
+ $currentPage
+ );
+
+ $fieldReplacements = array();
+ foreach ($tableData as $rowData) {
+ $replacement = $this->_getReplacement($rowData[$fieldName], $fieldRule['content_type'],
+ $fieldRule['entity_type']
+ );
+ if ($replacement !== $rowData[$fieldName]) {
+ $fieldReplacement = array(
+ 'to' => $replacement
+ );
+ if (empty($fieldRule['pk_fields'])) {
+ $fieldReplacement['where_fields'] = array($fieldName => $rowData[$fieldName]);
+ } else {
+ $fieldReplacement['where_fields'] = array();
+ foreach ($fieldRule['pk_fields'] as $pkField) {
+ $fieldReplacement['where_fields'][$pkField] = $rowData[$pkField];
+ }
+ }
+ $fieldReplacements[] = $fieldReplacement;
+ }
+ }
+
+ $this->_updateRowsData($tableName, $fieldName, $fieldReplacements);
+ }
+
+ /**
+ * Update rows data in database
+ *
+ * @param string $tableName
+ * @param string $fieldName
+ * @param array $fieldReplacements
+ */
+ protected function _updateRowsData($tableName, $fieldName, array $fieldReplacements)
+ {
+ if (count($fieldReplacements) > 0) {
+ $adapter = $this->getConnection();
+
+ foreach ($fieldReplacements as $fieldReplacement) {
+ $where = array();
+ foreach ($fieldReplacement['where_fields'] as $whereFieldName => $value) {
+ $where[$adapter->quoteIdentifier($whereFieldName) . ' = ?'] = $value;
+ }
+ $adapter->update(
+ $adapter->getTableName($tableName),
+ array($fieldName => $fieldReplacement['to']),
+ $where
+ );
+ }
+ }
+ }
+
+ /**
+ * Get data for table column which should be processed
+ *
+ * @param string $tableName name of table to replace aliases in
+ * @param string $fieldName name of table column to replace aliases in
+ * @param array $fieldsToSelect array of fields to select
+ * @param string $additionalWhere additional where condition
+ * @param int $currPage
+ *
+ * @return array
+ */
+ protected function _getTableData($tableName, $fieldName, array $fieldsToSelect, $additionalWhere = '',
+ $currPage = 0
+ ) {
+ $adapter = $this->getConnection();
+
+ $query = $adapter->select()
+ ->from($adapter->getTableName($tableName), $fieldsToSelect)
+ ->where($fieldName . ' IS NOT NULL');
+
+ if (!empty($additionalWhere)) {
+ $query->where($additionalWhere);
+ }
+
+ if ($currPage) {
+ $query->limitPage($currPage, $this->_rowsPerPage);
+ }
+
+ return $adapter->fetchAll($query);
+ }
+
+ /**
+ * Get data with replaced aliases with class names
+ *
+ * @param string $data
+ * @param string $contentType type of data (field content)
+ * @param string $entityType entity type of alias
+ *
+ * @return string
+ */
+ protected function _getReplacement($data, $contentType, $entityType = '')
+ {
+ switch ($contentType) {
+ case self::FIELD_CONTENT_TYPE_SERIALIZED:
+ $data = $this->_getAliasInSerializedStringReplacement($data, $entityType);
+ break;
+ // wiki and xml content types use the same replacement method
+ case self::FIELD_CONTENT_TYPE_WIKI:
+ case self::FIELD_CONTENT_TYPE_XML:
+ $data = $this->_getPatternReplacement($data, $contentType, $entityType);
+ break;
+ case self::FIELD_CONTENT_TYPE_PLAIN:
+ default:
+ $data = $this->_getModelReplacement($data, $entityType);
+ break;
+ }
+
+ return $data;
+ }
+
+ /**
+ * Get appropriate class name for alias
+ *
+ * @param string $alias
+ * @param string $entityType entity type of alias
+ *
+ * @return string
+ */
+ protected function _getCorrespondingClassName($alias, $entityType = '')
+ {
+ if ($this->_isFactoryName($alias)) {
+ if ($className = $this->_getAliasFromMap($alias, $entityType)) {
+ return $className;
+ }
+
+ list($module, $name) = $this->_getModuleName($alias);
+
+ if (!empty($entityType)) {
+ $className = $this->_getClassName($module, $entityType, $name);
+ $properEntityType = $entityType;
+ } else {
+ // Try to find appropriate class name for all entity types
+ $className = '';
+ $properEntityType = '';
+ foreach ($this->_entityTypes as $entityType) {
+ if (empty($className)) {
+ $className = $this->_getClassName($module, $entityType, $name);
+ $properEntityType = $entityType;
+ } else {
+ // If was found more than one match - alias cannot be replaced
+ return '';
+ }
+ }
+ }
+ $this->_pushToMap($properEntityType, $alias, $className);
+ return $className;
+ }
+
+ return '';
+ }
+
+ /**
+ * Replacement for model alias and model alias with method
+ *
+ * @param string $data
+ * @param string $entityType
+ * @return string
+ */
+ protected function _getModelReplacement($data, $entityType = '')
+ {
+ if (preg_match(self::PLAIN_FIND_PATTERN, $data, $matches)) {
+ $classAlias = $matches['alias'];
+ $className = $this->_getCorrespondingClassName($classAlias, $entityType);
+ if ($className) {
+ return str_replace($classAlias, $className, $data);
+ }
+ }
+
+ $className = $this->_getCorrespondingClassName($data, $entityType);
+ if (!empty($className)) {
+ return $className;
+ } else {
+ return $data;
+ }
+ }
+
+ /**
+ * Replaces class aliases using pattern
+ *
+ * @param string $data
+ * @param string $contentType
+ * @param string $entityType
+ * @return string|null
+ */
+ protected function _getPatternReplacement($data, $contentType, $entityType = '')
+ {
+ if (!array_key_exists($contentType, $this->_replacePatterns)) {
+ return null;
+ }
+
+ $replacements = array();
+ $pattern = $this->_replacePatterns[$contentType];
+ preg_match_all($pattern, $data, $matches, PREG_PATTERN_ORDER);
+ if (isset($matches['alias'])) {
+ $matches = array_unique($matches['alias']);
+ foreach ($matches as $classAlias) {
+ $className = $this->_getCorrespondingClassName($classAlias, $entityType);
+ if ($className) {
+ $replacements[$classAlias] = $className;
+ }
+ }
+ }
+
+ foreach ($replacements as $classAlias => $className) {
+ $data = str_replace($classAlias, $className, $data);
+ }
+
+ return $data;
+ }
+
+ /**
+ * Generate class name
+ *
+ * @param string $module
+ * @param string $type
+ * @param string $name
+ *
+ * @return string
+ */
+ protected function _getClassName($module, $type, $name = null)
+ {
+ $className = implode('_', array_map('ucfirst', explode('_', $module . '_' . $type . '_' . $name)));
+
+ if (Magento_Autoload::getInstance()->classExists($className)) {
+ return $className;
+ }
+
+ return '';
+ }
+
+ /**
+ * Whether the given class name is a factory name
+ *
+ * @param string $factoryName
+ *
+ * @return bool
+ */
+ protected function _isFactoryName($factoryName)
+ {
+ return false !== strpos($factoryName, '/') || preg_match('/^[a-z\d]+(_[A-Za-z\d]+)?$/', $factoryName);
+ }
+
+ /**
+ * Transform factory name into a pair of module and name
+ *
+ * @param string $factoryName
+ *
+ * @return array
+ */
+ protected function _getModuleName($factoryName)
+ {
+ if (false !== strpos($factoryName, '/')) {
+ list($module, $name) = explode('/', $factoryName);
+ } else {
+ $module = $factoryName;
+ $name = false;
+ }
+ $compositeModuleName = $this->_getCompositeModuleName($module);
+ if (null !== $compositeModuleName) {
+ $module = $compositeModuleName;
+ } elseif (false === strpos($module, '_')) {
+ $module = "Mage_{$module}";
+ }
+ return array($module, $name);
+ }
+
+ /**
+ * Get composite module name by module alias
+ *
+ * @param $moduleAlias
+ *
+ * @return string|null
+ */
+ protected function _getCompositeModuleName($moduleAlias)
+ {
+ if (null === $this->_compositeModules) {
+ $this->_compositeModules = static::getCompositeModules();
+ }
+ if (array_key_exists($moduleAlias, $this->_compositeModules)) {
+ return $this->_compositeModules[$moduleAlias];
+ }
+ return null;
+ }
+
+ /**
+ * Search class by alias in map
+ *
+ * @param string $alias
+ * @param string $entityType
+ *
+ * @return string
+ */
+ protected function _getAliasFromMap($alias, $entityType = '')
+ {
+ if ($map = $this->_getAliasesMap()) {
+ if (!empty($entityType) && isset($map[$entityType]) && !empty($map[$entityType][$alias])) {
+ return $map[$entityType][$alias];
+ } else {
+ $className = '';
+ foreach ($this->_entityTypes as $entityType) {
+ if (empty($className)) {
+ if (isset($map[$entityType]) && !empty($map[$entityType][$alias])) {
+ $className = $map[$entityType][$alias];
+ }
+ } else {
+ return '';
+ }
+ }
+ return $className;
+ }
+ }
+
+ return '';
+ }
+
+ /**
+ * Store already generated class name for alias
+ *
+ * @param $entityType
+ * @param $alias
+ * @param $className
+ */
+ protected function _pushToMap($entityType, $alias, $className)
+ {
+ // Load map from file if it wasn't loaded
+ $this->_getAliasesMap();
+
+ if (!isset($this->_aliasesMap[$entityType])) {
+ $this->_aliasesMap[$entityType] = array();
+ }
+
+ if (!isset($this->_aliasesMap[$entityType][$alias])) {
+ $this->_aliasesMap[$entityType][$alias] = $className;
+ }
+ }
+
+ /**
+ * Retrieve aliases to classes map if exit
+ *
+ * @return array
+ */
+ protected function _getAliasesMap()
+ {
+ if (is_null($this->_aliasesMap)) {
+ $this->_aliasesMap = array();
+
+ $map = $this->_loadMap($this->_pathToMapFile);
+
+ if (!empty($map)) {
+ $this->_aliasesMap = $this->_coreHelper->jsonDecode($map);
+ }
+ }
+
+ return $this->_aliasesMap;
+ }
+
+ /**
+ * Load aliases to classes map from file
+ *
+ * @param string $pathToMapFile
+ *
+ * @return string
+ */
+ protected function _loadMap($pathToMapFile)
+ {
+ $pathToMapFile = $this->_baseDir . DS . $pathToMapFile;
+ if (file_exists($pathToMapFile)) {
+ return file_get_contents($pathToMapFile);
+ }
+
+ return '';
+ }
+
+ /**
+ * @param string $data
+ * @param string $entityType
+ * @return mixed
+ */
+ protected function _getAliasInSerializedStringReplacement($data, $entityType = '')
+ {
+ $matches = $this->_parseSerializedString($data);
+ if (isset($matches['alias']) && count($matches['alias']) > 0) {
+ foreach ($matches['alias'] as $key => $alias) {
+ $className = $this->_getCorrespondingClassName($alias, $entityType);
+
+ if (!empty($className)) {
+ $replaceString = sprintf(self::SERIALIZED_REPLACE_PATTERN, strlen($className), $className);
+ $data = str_replace($matches['string'][$key], $replaceString, $data);
+ }
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * Parse class aliases from serialized string
+ *
+ * @param $string
+ * @return array
+ */
+ protected function _parseSerializedString($string)
+ {
+ if ($string && preg_match_all(self::SERIALIZED_FIND_PATTERN, $string, $matches)) {
+ unset($matches[0], $matches[1], $matches[2]);
+ return $matches;
+ } else {
+ return array();
+ }
+ }
+
+ /**
+ * List of correspondence between composite module aliases and module names
+ *
+ * @static
+ * @return array
+ */
+ public static function getCompositeModules()
+ {
+ return array(
+ 'adminnotification' => 'Mage_AdminNotification',
+ 'catalogindex' => 'Mage_CatalogIndex',
+ 'cataloginventory' => 'Mage_CatalogInventory',
+ 'catalogrule' => 'Mage_CatalogRule',
+ 'catalogsearch' => 'Mage_CatalogSearch',
+ 'currencysymbol' => 'Mage_CurrencySymbol',
+ 'giftmessage' => 'Mage_GiftMessage',
+ 'googleanalytics' => 'Mage_GoogleAnalytics',
+ 'googlebase' => 'Mage_GoogleBase',
+ 'googlecheckout' => 'Mage_GoogleCheckout',
+ 'importexport' => 'Mage_ImportExport',
+ 'paypaluk' => 'Mage_PaypalUk',
+ 'productalert' => 'Mage_ProductAlert',
+ 'salesrule' => 'Mage_SalesRule',
+ 'xmlconnect' => 'Mage_XmlConnect',
+ );
+ }
+}
View
43 app/code/core/Mage/Core/data/core_setup/data-upgrade-1.6.0.3-1.6.0.4.php
@@ -0,0 +1,43 @@
+<?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.
+ *
+ * @category Mage
+ * @package Mage_Core
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/** @var $installer Mage_Core_Model_Resource_Setup_Migration */
+$installer = Mage::getResourceModel('Mage_Core_Model_Resource_Setup_Migration', 'core_setup');
+$installer->startSetup();
+
+$installer->appendClassAliasReplace('core_config_data', 'value',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_MODEL,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_PLAIN,
+ array('config_id')
+);
+$installer->appendClassAliasReplace('core_layout_update', 'xml',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_BLOCK,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_XML,
+ array('layout_update_id')
+);
+$installer->doUpdateClassAliases();
+
+$installer->endSetup();
View
5 app/code/core/Mage/Core/etc/config.xml
@@ -28,7 +28,7 @@
<config>
<modules>
<Mage_Core>
- <version>1.6.0.3</version>
+ <version>1.6.0.4</version>
<active>true</active>
<codePool>core</codePool>
</Mage_Core>
@@ -95,6 +95,9 @@
<allow_map_update>1</allow_map_update>
</design_fallback>
</dev>
+ <migration>
+ <path_to_aliases_map_file>app/etc/aliases_to_classes_map.json</path_to_aliases_map_file>
+ </migration>
</global>
<frontend>
<routers>
View
18 ...o/_files/scenario_with_scripts_before.php → ...etup/data-upgrade-1.6.2.0.1-1.6.2.0.2.php
@@ -18,11 +18,21 @@
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
- * @category Magento
- * @package performance_tests
- * @subpackage unit_tests
+ * @category Mage
+ * @package Mage_Customer
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-// Nothing here, just file existence is needed
+/** @var $installer Mage_Core_Model_Resource_Setup_Migration */
+$installer = Mage::getResourceModel('Mage_Core_Model_Resource_Setup_Migration', 'core_setup');
+$installer->startSetup();
+
+$installer->appendClassAliasReplace('customer_eav_attribute', 'data_model',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_MODEL,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_PLAIN,
+ array('attribute_id')
+);
+$installer->doUpdateClassAliases();
+
+$installer->endSetup();
View
2  app/code/core/Mage/Customer/etc/config.xml
@@ -28,7 +28,7 @@
<config>
<modules>
<Mage_Customer>
- <version>1.6.2.0.1</version>
+ <version>1.6.2.0.2</version>
<active>true</active>
<codePool>core</codePool>
<depends>
View
22 app/code/core/Mage/DesignEditor/view/frontend/js/change/layout.js
@@ -41,7 +41,7 @@
status: 'active',
getType: function() {
if (!this.type) {
- throw Error(Translator.translate('Type of change is not defined'));
+ throw Error($.mage.__('Type of change is not defined'));
}
return this.type;
},
@@ -50,13 +50,13 @@
},
undo: function() {
if (this.status == 'undone') {
- throw Error(Translator.translate("Can't undo change twice"));
+ throw Error($.mage.__("Can't undo change twice"));
}
alert('undo');
this.status = 'undone';
},
getTitle: function() {
- throw Error(Translator.translate('Method "getTitle" is not implemented'));
+ throw Error($.mage.__('Method "getTitle" is not implemented'));
},
setData: function(data) {
this.data = data;
@@ -65,10 +65,10 @@
return this.data;
},
getPostData: function() {
- throw Error(Translator.translate('Method "getTitle" is not implemented'));
+ throw Error($.mage.__('Method "getTitle" is not implemented'));
},
setActionData: function() {
- throw Error(Translator.translate('Method "getTitle" is not implemented'));
+ throw Error($.mage.__('Method "getTitle" is not implemented'));
}
};
}
@@ -106,13 +106,13 @@
case ACTION_MOVE:
if (data.origin.container == data.destination.container) {
- title = Translator.translate('Block #block# sorted').replace('#block#', data.block);
+ title = $.mage.__('Block #block# sorted').replace('#block#', data.block);
} else {
- title = Translator.translate('Block #block# moved').replace('#block#', data.block);
+ title = $.mage.__('Block #block# moved').replace('#block#', data.block);
}
break;
case ACTION_REMOVE:
- title = Translator.translate('Block #block# removed').replace('#block#', data.block);
+ title = $.mage.__('Block #block# removed').replace('#block#', data.block);
break;
}
return title;
@@ -126,7 +126,7 @@
return this[ '_' + type + this._stringToTitleCase(action) ](data);
break;
default:
- throw Error(Translator.translate('Invalid action "#action#"').replace('#action#', action));
+ throw Error($.mage.__('Invalid action "#action#"').replace('#action#', action));
}
},
/** @todo maybe we need to create global object for strings? */
@@ -229,7 +229,7 @@
var change = new fileChange();
break;
default:
- throw Error(Translator.translate('Invalid change type "#type#"').replace('#type#', type));
+ throw Error($.mage.__('Invalid change type "#type#"').replace('#type#', type));
}
return $.extend(new abstractChange(), change);
}
@@ -311,7 +311,7 @@
},
error: function(data) {
_isSaveLocked = false;
- throw Error(Translator.translate('Some problem with save action'));
+ throw Error($.mage.__('Some problem with save action'));
}
});
}
View
8 app/code/core/Mage/DesignEditor/view/frontend/js/design_editor.js
@@ -239,7 +239,7 @@
try {
if (this._history.getItems().length == 0) {
/** @todo temporary report */
- alert(Translator.translate('No changes found.'));
+ alert($.mage.__('No changes found.'));
return false;
}
var data = this._preparePostItems(this._history.getItems());
@@ -255,7 +255,7 @@
try {
if (this._history.getItems().length == 0) {
/** @todo temporary report */
- alert(Translator.translate('No changes found.'));
+ alert($.mage.__('No changes found.'));
return false;
}
var data = this._preparePostItems(this._history.getItems());
@@ -314,13 +314,13 @@
success: function(data) {
if (data.error) {
/** @todo add error validator */
- throw Error(Translator.translate('Some problem with save action'));
+ throw Error($.mage.__('Some problem with save action'));
return;
}
postResult = data.success;
},
error: function(data) {
- throw Error(Translator.translate('Some problem with save action'));
+ throw Error($.mage.__('Some problem with save action'));
}
});
return postResult;
View
75 app/code/core/Mage/Eav/data/eav_setup/data-upgrade-1.6.0.0-1.6.0.1.php
@@ -0,0 +1,75 @@
+<?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.
+ *
+ * @category Mage
+ * @package Mage_Eav
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/** @var $installer Mage_Core_Model_Resource_Setup_Migration */
+$installer = Mage::getResourceModel('Mage_Core_Model_Resource_Setup_Migration', 'core_setup');
+$installer->startSetup();
+
+$installer->appendClassAliasReplace('eav_attribute', 'attribute_model',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_MODEL,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_PLAIN,
+ array('attribute_id')
+);
+$installer->appendClassAliasReplace('eav_attribute', 'backend_model',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_MODEL,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_PLAIN,
+ array('attribute_id')
+);
+$installer->appendClassAliasReplace('eav_attribute', 'frontend_model',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_MODEL,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_PLAIN,
+ array('attribute_id')
+);
+$installer->appendClassAliasReplace('eav_attribute', 'source_model',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_MODEL,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_PLAIN,
+ array('attribute_id')
+);
+
+$installer->appendClassAliasReplace('eav_entity_type', 'entity_model',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_MODEL,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_PLAIN,
+ array('entity_type_id')
+);
+$installer->appendClassAliasReplace('eav_entity_type', 'attribute_model',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_MODEL,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_PLAIN,
+ array('entity_type_id')
+);
+$installer->appendClassAliasReplace('eav_entity_type', 'increment_model',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_MODEL,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_PLAIN,
+ array('entity_type_id')
+);
+$installer->appendClassAliasReplace('eav_entity_type', 'entity_attribute_collection',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_RESOURCE,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_PLAIN,
+ array('entity_type_id')
+);
+
+$installer->doUpdateClassAliases();
+
+$installer->endSetup();
View
2  app/code/core/Mage/Eav/etc/config.xml
@@ -28,7 +28,7 @@
<config>
<modules>
<Mage_Eav>
- <version>1.6.0.0</version>
+ <version>1.6.0.1</version>
<active>true</active>
<codePool>core</codePool>
<depends>
View
9 app/code/core/Mage/ImportExport/Model/Import.php
@@ -480,15 +480,14 @@ public function uploadSource()
/**
* Validates source file and returns validation result.
*
- * @param string $sourceFile Full path to source file
+ * @param Mage_ImportExport_Model_Import_Adapter_Abstract $source
* @return bool
*/
- public function validateSource($sourceFile)
+ public function validateSource(Mage_ImportExport_Model_Import_Adapter_Abstract $source)
{
$this->addLogComment(Mage::helper('Mage_ImportExport_Helper_Data')->__('Begin data validation'));
- $result = $this->_getEntityAdapter()
- ->setSource($this->_getSourceAdapter($sourceFile))
- ->isDataValid();
+ $adapter = $this->_getEntityAdapter()->setSource($source);
+ $result = $adapter->isDataValid();
$messages = $this->getOperationResultMessages($result);
$this->addLogComment($messages);
View
2  app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php
@@ -75,7 +75,7 @@
* @throws Mage_Core_Exception
* @return void
*/
- final public function __construct($source)
+ public function __construct($source)
{
if (!is_string($source)) {
Mage::throwException(Mage::helper('Mage_ImportExport_Helper_Data')->__('Source file path must be a string'));
View
5 app/code/core/Mage/ImportExport/controllers/Adminhtml/ImportController.php
@@ -141,8 +141,9 @@ public function validateAction()
try {
/** @var $import Mage_ImportExport_Model_Import */
- $import = Mage::getModel('Mage_ImportExport_Model_Import');
- $validationResult = $import->validateSource($import->setData($data)->uploadSource());
+ $import = Mage::getModel('Mage_ImportExport_Model_Import')->setData($data);
+ $source = Mage_ImportExport_Model_Import_Adapter::findAdapterFor($import->uploadSource());
+ $validationResult = $import->validateSource($source);
if (!$import->getProcessedRowsCount()) {
$resultBlock->addError($this->__('File does not contain data. Please upload another one'));
View
3  app/code/core/Mage/Install/Model/Installer/Console.php
@@ -327,8 +327,7 @@ public function install(array $options)
/**
* Change directories mode to be writable by apache user
*/
- @chmod('var/cache', 0777);
- @chmod('var/session', 0777);
+ Varien_Io_File::chmodRecursive(Mage::getBaseDir('var'), 0777);
return $encryptionKey;
View
2  app/code/core/Mage/Install/view/install/page.phtml
@@ -38,6 +38,8 @@
<link rel="icon" href="<?php echo $this->getSkinUrl('Mage_Page::favicon.ico') ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->getSkinUrl('Mage_Page::favicon.ico') ?>" type="image/x-icon" />
+<script type="text/javascript" src="<?php echo $this->getSkinUrl('jquery/jquery-1.7.1.min.js') ?>"></script>
+<script type="text/javascript" src="<?php echo $this->getSkinUrl('mage/jquery-no-conflict.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('prototype/prototype.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('prototype/validation.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('scriptaculous/effects.js') ?>"></script>
View
49 app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.1-1.6.0.2.php
@@ -0,0 +1,49 @@
+<?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.
+ *
+ * @category Mage
+ * @package Mage_Newsletter
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/** @var $installer Mage_Core_Model_Resource_Setup_Migration */
+$installer = Mage::getResourceModel('Mage_Core_Model_Resource_Setup_Migration', 'core_setup');
+$installer->startSetup();
+
+$installer->appendClassAliasReplace('newsletter_template', 'template_text',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_BLOCK,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_WIKI,
+ array('template_id')
+);
+$installer->appendClassAliasReplace('newsletter_template', 'template_text_preprocessed',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_BLOCK,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_WIKI,
+ array('template_id')
+);
+$installer->appendClassAliasReplace('newsletter_queue', 'newsletter_text',
+ Mage_Core_Model_Resource_Setup_Migration::ENTITY_TYPE_BLOCK,
+ Mage_Core_Model_Resource_Setup_Migration::FIELD_CONTENT_TYPE_WIKI,
+ array('queue_id')
+);
+
+$installer->doUpdateClassAliases();
+
+$installer->endSetup();
View
4 app/code/core/Mage/Newsletter/etc/config.xml
@@ -28,7 +28,7 @@
<config>
<modules>
<Mage_Newsletter>
- <version>1.6.0.1</version>
+ <version>1.6.0.2</version>
<active>true</active>
<codePool>core</codePool>
<depends>
@@ -176,4 +176,4 @@
</newsletter_send_all>
</jobs>
</crontab>
-</config>
+</config>
View
4 app/code/core/Mage/Page/view/frontend/layout.xml
@@ -35,6 +35,8 @@ Default layout, loads most of the pages
<block type="Mage_Page_Block_Html" name="root" output="1" template="3columns.phtml">
<block type="Mage_Page_Block_Html_Head" name="head" as="head">
+ <action method="addJs"><file>jquery/jquery-1.7.1.min.js</file></action>
+ <action method="addJs"><file>mage/jquery-no-conflict.js</file></action>
<action method="addJs"><file>prototype/prototype.js</file></action>
<action method="addJs"><file>lib/ccard.js</file></action>
<action method="addJs"><file>prototype/validation.js</file></action>
@@ -92,6 +94,8 @@ Default layout, loads most of the pages
<block type="Mage_Page_Block_Html" name="root" output="1" template="print.phtml">
<block type="Mage_Page_Block_Html_Head" name="head" as="head">
+ <action method="addJs"><file>jquery/jquery-1.7.1.min.js</file></action>
+ <action method="addJs"><file>mage/jquery-no-conflict.js</file></action>
<action method="addJs"><file>prototype/prototype.js</file></action>
<action method="addJs"><file>mage/translate.js</file></action>
<action method="addJs"><file>lib/ccard.js</file></action>
View
2  app/code/core/Mage/Payment/Model/Info.php
@@ -45,7 +45,7 @@ class Mage_Payment_Model_Info extends Mage_Core_Model_Abstract
*
* @param string $key
* @param mixed $index
- * @return unknown
+ * @return mixed
*/
public function getData($key='', $index=null)
{
View
2  app/code/core/Mage/Payment/etc/config.xml
@@ -153,7 +153,7 @@
<default>
<payment>
<ccsave>
- <active>1</active>
+ <active>0</active>
<cctypes>AE,VI,MC,DI</cctypes>
<model>Mage_Payment_Model_Method_Ccsave</model>
<order_status>pending</order_status>
View
3  app/code/core/Mage/Payment/etc/system.xml
@@ -45,8 +45,9 @@
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
- <active translate="label">
+ <active translate="label comment">
<label>Enabled</label>
+ <comment>Enabling this method will store credit card information in the database, which may increase your security or compliance requirements.</comment>
<frontend_type>select</frontend_type>
<source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model>
<sort_order>1</sort_order>
View
168 app/code/core/Mage/Sales/Model/Config/Ordered.php
@@ -124,59 +124,56 @@ protected function _prepareConfigArray($code, $totalConfig)
/**
* Aggregate before/after information from all items and sort totals based on this data
*
+ * @param array $config
* @return array
*/