Permalink
Browse files

Update as of 7/19/2012

* Implemented inheritance of locales. Inheritance is declared in `app/locale/<locale_name>/config.xml`
* Moved declaration of modules from `app/etc/modules/<module>.xml` to `app/code/<pool>/<namespace>/<module>/config.xml`
* Implemented ability to match URLs in format `protocol://base_url/area/module/controller/action` (as opposite to only `module/controller/action`), utilized this feature in backend (admin) area
* Added product attribute set "Minimal Attributes", which consists of required system attributes only
* Improved customers import:
  * Implemented "Delete" behavior for importing customers, customer addresses and financial data
  * Implemented "Custom" behavior, which allows to specify behavior for each item directly from the imported file
* Updated performance tests:
  * Enabled Product View, Category View, Add to Cart, Quick Search and Advanced Search scenarios
  * Added ability to specify configuration parameters per scenario and refactored bootstrap of performance tests
* Implemented `mage.js` for base JavaScript initialization of the application
* Implemented new JS translation mechanism. JavaScript translations are loaded by locale code stored in cookies
* Implemented unit tests for JavaScript widgets in Visual Design Editor
* Added jQuery plugins: Cookie, Metadata, Validation, Head JS
* Fixed issues:
  * Impossible to add configurable product to the cart
  * Impossible to apply Shopping Cart Price Rule with any conditions to cart with simple and virtual product
  * Memory leak in email templates
  * Impossible to place order with Multiple Addresses using 3D Secure
  * Required product attributes are not exported
  * "Forgot Your Password" link on checkout page inactive after captcha reloading
  * Validation of "Number of Symbols" field in Captcha configuration doesn't work
  * Other small fixes
* GitHub requests:
  * [#37](#37) -- fixed particular case of "HEADERS ALREADY SENT" error in WYSIWYG thumbnail
  * [#39](#39) -- added `composer.json`
  * [#40](#40) -- fixed generation of "secret key" in backend URLs to honor `_forward` in controllers
  • Loading branch information...
1 parent 3330e25 commit 1617a6e877458019c3b48a018a595a7f550b51f3 @magento-team magento-team committed Jul 20, 2012
Showing 322 changed files with 20,833 additions and 3,196 deletions.
View
@@ -1,3 +1,33 @@
+Update as of 7/19/2012
+=====================
+* Implemented inheritance of locales. Inheritance is declared in `app/locale/<locale_name>/config.xml`
+* Moved declaration of modules from `app/etc/modules/<module>.xml` to `app/code/<pool>/<namespace>/<module>/config.xml`
+* Implemented ability to match URLs in format `protocol://base_url/area/module/controller/action` (as opposite to only `module/controller/action`), utilized this feature in backend (admin) area
+* Added product attribute set "Minimal Attributes", which consists of required system attributes only
+* Improved customers import:
+ * Implemented "Delete" behavior for importing customers, customer addresses and financial data
+ * Implemented "Custom" behavior, which allows to specify behavior for each item directly from the imported file
+* Updated performance tests:
+ * Enabled Product View, Category View, Add to Cart, Quick Search and Advanced Search scenarios
+ * Added ability to specify configuration parameters per scenario and refactored bootstrap of performance tests
+* Implemented `mage.js` for base JavaScript initialization of the application
+* Implemented new JS translation mechanism. JavaScript translations are loaded by locale code stored in cookies
+* Implemented unit tests for JavaScript widgets in Visual Design Editor
+* Added jQuery plugins: Cookie, Metadata, Validation, Head JS
+* Fixed issues:
+ * Impossible to add configurable product to the cart
+ * Impossible to apply Shopping Cart Price Rule with any conditions to cart with simple and virtual product
+ * Memory leak in email templates
+ * Impossible to place order with Multiple Addresses using 3D Secure
+ * Required product attributes are not exported
+ * "Forgot Your Password" link on checkout page inactive after captcha reloading
+ * Validation of "Number of Symbols" field in Captcha configuration doesn't work
+ * Other small fixes
+* GitHub requests:
+ * [#37](https://github.com/magento/magento2/pull/37) -- fixed particular case of "HEADERS ALREADY SENT" error in WYSIWYG thumbnail
+ * [#39](https://github.com/magento/magento2/pull/39) -- added `composer.json`
+ * [#40](https://github.com/magento/magento2/pull/40) -- fixed generation of "secret key" in backend URLs to honor `_forward` in controllers
+
Update as of 7/3/2012
=====================
* Refactored backend (admin) menu generation:
@@ -29,6 +29,8 @@
<modules>
<Phoenix_Moneybookers>
<version>1.6.0.0</version>
+ <active>true</active>
+ <codePool>community</codePool>
</Phoenix_Moneybookers>
</modules>
<global>
@@ -29,6 +29,11 @@
<modules>
<Mage_Admin>
<version>1.6.1.0</version>
+ <active>true</active>
+ <codePool>core</codePool>
+ <depends>
+ <Mage_Core/>
+ </depends>
</Mage_Admin>
</modules>
</config>
@@ -29,6 +29,12 @@
<modules>
<Mage_AdminNotification>
<version>1.6.0.0</version>
+ <active>true</active>
+ <codePool>core</codePool>
+ <depends>
+ <Mage_Core/>
+ <Mage_Adminhtml/>
+ </depends>
</Mage_AdminNotification>
</modules>
<global>
@@ -42,6 +42,7 @@ class Mage_Adminhtml_Model_System_Config_Backend_Admin_Custompath extends Mage_C
protected function _beforeSave()
{
if ($this->getOldValue() != $this->getValue()) {
+ Mage::helper('Mage_Backend_Helper_Data')->clearAreaFrontName();
Mage::register('custom_admin_path_redirect', true, true);
}
return $this;
@@ -42,9 +42,7 @@ public function afterCustomUrlChanged($observer)
$adminSession->unsetAll();
$adminSession->getCookie()->delete($adminSession->getSessionName());
- $route = ((bool)(string)Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_USE_CUSTOM_ADMIN_PATH))
- ? Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_CUSTOM_ADMIN_PATH)
- : Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_ADMINHTML_ROUTER_FRONTNAME);
+ $route = Mage::helper('Mage_Backend_Helper_Data')->getAreaFrontName();
Mage::app()->getResponse()
->setRedirect(Mage::getBaseUrl() . $route)
@@ -42,6 +42,7 @@ class Mage_Adminhtml_Model_System_Config_Backend_Admin_Usecustompath extends Mag
protected function _beforeSave()
{
if ($this->getOldValue() != $this->getValue()) {
+ Mage::helper('Mage_Backend_Helper_Data')->clearAreaFrontName();
Mage::register('custom_admin_path_redirect', true, true);
}
@@ -189,7 +189,7 @@ public function thumbnailAction()
$adapter = Mage::helper('Mage_Core_Helper_Data')->getImageAdapterType();
$image = Varien_Image_Adapter::factory($adapter);
$image->open($thumb);
- $image->display();
+ $this->getResponse()->setHeader('Content-Type', $image->getMimeType())->setBody($image->getImage());
} else {
// todo: genearte some placeholder
}
@@ -44,24 +44,15 @@ public function directiveAction()
$directive = Mage::helper('Mage_Core_Helper_Data')->urlDecode($directive);
$url = Mage::getModel('Mage_Core_Model_Email_Template_Filter')->filter($directive);
$adapter = Mage::helper('Mage_Core_Helper_Data')->getImageAdapterType();
+ $image = Varien_Image_Adapter::factory($adapter);
+ $response = $this->getResponse();
try {
- $image = Varien_Image_Adapter::factory($adapter);
$image->open($url);
- $image->display();
+ $response->setHeader('Content-Type', $image->getMimeType())->setBody($image->getImage());
} catch (Exception $e) {
- $image = Varien_Image_Adapter::factory($adapter);
$image->open(Mage::getSingleton('Mage_Cms_Model_Wysiwyg_Config')->getSkinImagePlaceholderUrl());
- $image->display();
- /*
- $image = imagecreate(100, 100);
- $bkgrColor = imagecolorallocate($image,10,10,10);
- imagefill($image,0,0,$bkgrColor);
- $textColor = imagecolorallocate($image,255,255,255);
- imagestring($image, 4, 10, 10, 'Skin image', $textColor);
- header('Content-type: image/png');
- imagepng($image);
- imagedestroy($image);
- */
+ $response->setHeader('Content-Type', $image->getMimeType())->setBody($image->getImage());
+ Mage::logException($e);
}
}
}
@@ -29,6 +29,11 @@
<modules>
<Mage_Adminhtml>
<version>0.7.1</version>
+ <active>true</active>
+ <codePool>core</codePool>
+ <depends>
+ <Mage_Admin/>
+ </depends>
</Mage_Adminhtml>
</modules>
<global>
@@ -312,7 +312,7 @@ Packaging.prototype = {
newPackage: function() {
var pack = this.template.cloneNode(true);
- pack.id = 'package_block_' + ++this.packageIncrement;
+ pack.id = 'package_block_' + (++this.packageIncrement);
pack.addClassName('package-block');
pack.select('.package-number span')[0].update(this.packageIncrement);
this.packagesContent.insert({top: pack});
@@ -29,6 +29,11 @@
<modules>
<Mage_Api>
<version>1.6.0.0</version>
+ <active>true</active>
+ <codePool>core</codePool>
+ <depends>
+ <Mage_Core />
+ </depends>
</Mage_Api>
</modules>
<global>
@@ -29,6 +29,12 @@
<modules>
<Mage_Api2>
<version>1.0.0.0</version>
+ <active>true</active>
+ <codePool>core</codePool>
+ <depends>
+ <Mage_Core />
+ <Mage_Oauth />
+ </depends>
</Mage_Api2>
</modules>
<global>
@@ -121,7 +121,7 @@ public function placeAction()
$adminUrl = Mage::getSingleton('Mage_Adminhtml_Model_Url');
if ($adminUrl->useSecretKey()) {
$requestToPaygate->setKey(
- $adminUrl->getSecretKey('authorizenet_directpost_payment','redirect')
+ $adminUrl->getSecretKey('adminhtml', 'authorizenet_directpost_payment','redirect')
);
}
$result['directpost'] = array('fields' => $requestToPaygate->getData());
@@ -29,6 +29,13 @@
<modules>
<Mage_Authorizenet>
<version>1.5.0.0</version>
+ <active>true</active>
+ <codePool>core</codePool>
+ <depends>
+ <Mage_Paygate/>
+ <Mage_Sales/>
+ <Mage_Checkout/>
+ </depends>
</Mage_Authorizenet>
</modules>
<adminhtml>
@@ -114,7 +114,7 @@ public function getCacheKeyInfo()
protected function _afterToHtml($html)
{
$html = preg_replace_callback(
- '#'.Mage_Backend_Model_Url::SECRET_KEY_PARAM_NAME.'/\$([^\/].*)/([^\$].*)\$#U',
+ '#'.Mage_Backend_Model_Url::SECRET_KEY_PARAM_NAME.'/\$([^\/].*)/([^\/].*)/([^\$].*)\$#U',
array($this, '_callbackSecretKey'),
$html
);
@@ -131,7 +131,7 @@ protected function _afterToHtml($html)
protected function _callbackSecretKey($match)
{
return Mage_Backend_Model_Url::SECRET_KEY_PARAM_NAME . '/'
- . $this->_url->getSecretKey($match[1], $match[2]);
+ . $this->_url->getSecretKey($match[1], $match[2], $match[3]);
}
/**
@@ -391,7 +391,7 @@ protected function _forward($action, $controller = null, $module = null, array $
*/
public function getUrl($route='', $params=array())
{
- return Mage::helper('Mage_Backend_Helper_Data')->getUrl($route, $params);
+ return Mage_Backend_Helper_Data::getUrl($route, $params);
}
/**
@@ -28,16 +28,52 @@
class Mage_Backend_Controller_Router_Default extends Mage_Core_Controller_Varien_Router_Base
{
/**
+ * List of required request parameters
+ * Order sensitive
+ * @var array
+ */
+ protected $_requiredParams = array(
+ 'areaFrontName',
+ 'moduleFrontName',
+ 'controllerName',
+ 'actionName',
+ );
+
+ /**
+ * Url key of area
+ *
+ * @var string
+ */
+ protected $_areaFrontName;
+
+ /**
+ * Fetch area front name from params
+ *
+ * @param array $options
+ * @throws InvalidArgumentException
+ */
+ public function __construct(array $options = array())
+ {
+ parent::__construct($options);
+ $this->_areaFrontName = Mage::helper('Mage_Backend_Helper_Data')->getAreaFrontName();
+ if (empty($this->_areaFrontName)) {
+ throw new InvalidArgumentException('Area Front Name should be defined');
+ }
+ }
+
+ /**
* Fetch default path
*/
public function fetchDefault()
{
+ $defaultModuleFrontName = (string) Mage::getConfig()->getNode('admin/routers/adminhtml/args/frontName');
// set defaults
$d = explode('/', $this->_getDefaultPath());
$this->getFront()->setDefault(array(
- 'module' => !empty($d[0]) ? $d[0] : '',
- 'controller' => !empty($d[1]) ? $d[1] : 'index',
- 'action' => !empty($d[2]) ? $d[2] : 'index'
+ 'area' => !empty($d[0]) ? $d[0] : '',
+ 'module' => !empty($d[1]) ? $d[1] : $defaultModuleFrontName,
+ 'controller' => !empty($d[2]) ? $d[2] : 'index',
+ 'action' => !empty($d[3]) ? $d[3] : 'index'
));
}
@@ -120,66 +156,26 @@ protected function _getCurrentSecureUrl($request)
*/
public function collectRoutes($configArea, $useRouterName)
{
- if ((string)Mage::getConfig()->getNode(Mage_Backend_Helper_Data::XML_PATH_USE_CUSTOM_ADMIN_PATH)) {
- $customUrl = (string)Mage::getConfig()->getNode(Mage_Backend_Helper_Data::XML_PATH_CUSTOM_ADMIN_PATH);
- $xmlPath = Mage_Backend_Helper_Data::XML_PATH_ADMINHTML_ROUTER_FRONTNAME;
- if ((string)Mage::getConfig()->getNode($xmlPath) != $customUrl) {
- Mage::getConfig()->setNode($xmlPath, $customUrl, true);
- }
- }
- $this->_collectRoutes('admin', $useRouterName);
+ parent::collectRoutes('admin', $useRouterName);
}
/**
- * Collect modules routers configuration from configuration
+ * Check whether redirect should be used for secure routes
*
- * @param string $configArea
- * @param string $useRouterName
- * @return void
+ * @return bool
*/
- protected function _collectRoutes($configArea, $useRouterName)
+ protected function _shouldRedirectToSecure()
{
- $routers = array();
- $routersConfigNode = Mage::getConfig()->getNode($configArea.'/routers');
- if($routersConfigNode) {
- $routers = $routersConfigNode->children();
- }
- foreach ($routers as $routerName=>$routerConfig) {
- $use = (string)$routerConfig->use;
- if ($use == $useRouterName) {
- $modules = array();
- if (isset($routerConfig->args->module)) {
- $modules = array((string)$routerConfig->args->module);
- }
-
- if ($routerConfig->args->modules) {
- foreach ($routerConfig->args->modules->children() as $customModule) {
- if ($customModule) {
- if ($before = $customModule->getAttribute('before')) {
- $position = array_search($before, $modules);
- if ($position === false) {
- $position = 0;
- }
- array_splice($modules, $position, 0, (string)$customModule);
- } elseif ($after = $customModule->getAttribute('after')) {
- $position = array_search($after, $modules);
- if ($position === false) {
- $position = count($modules);
- }
- array_splice($modules, $position+1, 0, (string)$customModule);
- } else {
- $modules[] = (string)$customModule;
- }
- }
- }
- }
-
- $frontName = (string)$routerConfig->args->frontName;
- $this->addModule($frontName, $modules, $routerName);
- }
- }
+ return false;
}
+ /**
+ * Build controller file name based on moduleName and controllerName
+ *
+ * @param string $realModule
+ * @param string $controller
+ * @return string
+ */
public function getControllerFileName($realModule, $controller)
{
/**
@@ -199,6 +195,13 @@ public function getControllerFileName($realModule, $controller)
return $file . DS . ucfirst($this->_area) . DS . uc_words($controller, DS) . 'Controller.php';
}
+ /**
+ * Build controller class name based on moduleName and controllerName
+ *
+ * @param string $realModule
+ * @param string $controller
+ * @return string
+ */
public function getControllerClassName($realModule, $controller)
{
/**
@@ -216,4 +219,15 @@ public function getControllerClassName($realModule, $controller)
$realModule = implode('_', array_splice($parts, 0, 2));
return $realModule . '_' . ucfirst($this->_area) . '_' . uc_words($controller) . 'Controller';
}
+
+ /**
+ * Check whether this router should process given request
+ *
+ * @param array $params
+ * @return bool
+ */
+ protected function _canProcess(array $params)
+ {
+ return $params['areaFrontName'] == $this->_areaFrontName;
+ }
}
Oops, something went wrong.

0 comments on commit 1617a6e

Please sign in to comment.