Skip to content

Commit

Permalink
Merge pull request magento#1017 from magento-folks/develop
Browse files Browse the repository at this point in the history
[Folks] Bug Fixes
  • Loading branch information
Olexii Korshenko committed Dec 16, 2014
2 parents 5db792e + 219f716 commit db526c3
Show file tree
Hide file tree
Showing 921 changed files with 6,201 additions and 5,663 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public function beforeSave($customer)
{
$attributeName = $this->getAttribute()->getName();
$inputValue = $customer->getData($attributeName);
$inputValue = is_null($inputValue) ? $this->getAttribute()->getDefaultValue() : $inputValue;
$sanitizedValue = !empty($inputValue) ? '1' : '0';
$customer->setData($attributeName, $sanitizedValue);
return $this;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/**
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
*/
namespace Magento\Customer\Model\Config\Backend\CreateAccount;

class DisableAutoGroupAssignDefault extends \Magento\Framework\App\Config\Value
{
/**
* @var \Magento\Eav\Model\Config
*/
protected $eavConfig;

/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Framework\App\Config\ScopeConfigInterface $config
* @param \Magento\Eav\Model\Config $eavConfig
* @param \Magento\Framework\Model\Resource\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\Db $resourceCollection
* @param array $data
*/
public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Framework\App\Config\ScopeConfigInterface $config,
\Magento\Eav\Model\Config $eavConfig,
\Magento\Framework\Model\Resource\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\Db $resourceCollection = null,
array $data = []
) {
$this->eavConfig = $eavConfig;
parent::__construct($context, $registry, $config, $resource, $resourceCollection, $data);
}

/**
* Save EAV default value after save
*
* @return $this
*/
public function afterSave()
{
$result = parent::afterSave();

$attributeObject = $this->eavConfig->getAttribute('customer', 'disable_auto_group_change');
$attributeObject->setData('default_value', $this->getValue());
$attributeObject->save();

return $result;
}
}
1 change: 1 addition & 0 deletions app/code/Magento/Customer/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<field id="viv_disable_auto_group_assign_default" translate="label" type="select" sortOrder="57" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Default Value for Disable Automatic Group Changes Based on VAT ID</label>
<source_model>Magento\Backend\Model\Config\Source\Yesno</source_model>
<backend_model>Magento\Customer\Model\Config\Backend\CreateAccount\DisableAutoGroupAssignDefault</backend_model>
</field>
<field id="vat_frontend_visibility" translate="label" type="select" sortOrder="58" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Show VAT Number on Frontend</label>
Expand Down
18 changes: 18 additions & 0 deletions app/code/Magento/ProductAlert/Block/Product/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,29 @@ class View extends \Magento\Framework\View\Element\Template
*/
protected $_helper;

/**
* @var \Magento\Core\Helper\PostData
*/
protected $coreHelper;

/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\ProductAlert\Helper\Data $helper
* @param \Magento\Framework\Registry $registry
* @param \Magento\Core\Helper\PostData $coreHelper
* @param array $data
*/
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Magento\ProductAlert\Helper\Data $helper,
\Magento\Framework\Registry $registry,
\Magento\Core\Helper\PostData $coreHelper,
array $data = []
) {
parent::__construct($context, $data);
$this->_registry = $registry;
$this->_helper = $helper;
$this->coreHelper = $coreHelper;
}

/**
Expand All @@ -51,4 +59,14 @@ protected function getProduct()
}
return false;
}

/**
* Retrieve post action config
*
* @return string
*/
public function getPostAction()
{
return $this->coreHelper->getPostData($this->getSignupUrl());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
?>
<?php /* @var $this \Magento\ProductAlert\Block\Product\View */?>
<div class="product alert <?php echo $this->getHtmlClass() ?>">
<a href="<?php echo $this->escapeHtml($this->getSignupUrl()) ?>"
<a href="#" data-post='<?php echo $this->getPostAction(); ?>'
title="<?php echo $this->escapeHtml(__($this->getSignupLabel())); ?>" class="action alert">
<?php echo $this->escapeHtml(__($this->getSignupLabel())); ?>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="backend.page">
<block class="Magento\Rma\Block\Adminhtml\Rma\Create" name="content">
<referenceContainer name="content">
<block class="Magento\Rma\Block\Adminhtml\Rma\Create" name="rma_create">
<block class="Magento\Rma\Block\Adminhtml\Rma\Create\Form" template="create/form.phtml" name="form">
<block class="Magento\Rma\Block\Adminhtml\Rma\Create\Order" template="create/order.phtml" name="rma_create_order">
<block class="Magento\Rma\Block\Adminhtml\Rma\Create\Order\Grid" name="grid"/>
</block>
</block>
</block>
</referenceBlock>
</referenceContainer>
</body>
</page>
32 changes: 24 additions & 8 deletions dev/build/core_dev/functional/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,26 +198,42 @@
<replacefilter token="{{url}}" value="${env.http_host}${env.build.key}/instance-${instanceIndex}"/>
</replace>

<condition property="env.bamboo_tests_configuration" value="basic">
<not><isset property="env.bamboo_tests_configuration"/></not>
</condition>

<replace file="${dir.build_directory}/instance-${instanceIndex}/dev/tests/functional/config/server.yml.dist">
<replacefilter token="{{selenium_host}}" value="${env.selenium_host}"/>
<replacefilter token="{{selenium_port}}" value="${env.selenium_port}"/>
<replacefilter token="{{selenium_timeout}}" value="${env.selenium_timeout}"/>
<replacefilter token="{{selenium_browser}}" value="${env.selenium_browser}"/>
</replace>

<condition property="env.bamboo_tests_configuration" value="basic">
<not><isset property="env.bamboo_tests_configuration"/></not>
</condition>
<condition property="env.bamboo_module_whitelist" value="">
<not><isset property="env.bamboo_module_whitelist"/></not>
</condition>
<!-- Property which defines whether Magento console installation is performed -->
<condition property="env.bamboo_is_magento_installed" value="1">
<not><isset property="env.bamboo_is_magento_installed"/></not>
</condition>

<replace file="${dir.build_directory}/instance-${instanceIndex}/dev/tests/functional/phpunit.xml">
<replacefilter token="{{admin_url}}" value="${env.http_host}${env.build.key}/instance-${instanceIndex}/backend/"/>
<replacefilter token="{{url}}" value="${env.http_host}${env.build.key}/instance-${instanceIndex}"/>
<replacefilter token="{{admin_url}}" value="${env.http_host}${env.build.key}/instance-${instanceIndex}/backend/" />
<replacefilter token="{{url}}" value="${env.http_host}${env.build.key}/instance-${instanceIndex}" />
<replacefilter token="{{tests_configuration}}" value="${env.bamboo_tests_configuration}" />
<replacefilter token="{{module_whitelist}}" value="${env.bamboo_module_whitelist}" />
</replace>

<replace file="${dir.build_directory}/instance-${instanceIndex}/dev/tests/functional/config/install_data.yml.dist">
<replacefilter token="{{db_host}}" value="${env.db_host}"/>
<replacefilter token="{{db_user}}" value="${env.db_user}"/>
<replacefilter token="{{db_password}}" value="${env.db_password}"/>
<replacefilter token="{{db_name}}" value="${env.db_name_prefix}${instanceIndex}"/>
<replacefilter token="{{url}}" value="${env.http_host}${env.build.key}/instance-${instanceIndex}"/>
</replace>

<script language="javascript"><![CDATA[
var currentInstance = project.getProperty('instanceIndex');
if (currentInstance > 0) {
if (currentInstance > 0 && project.getProperty('env.bamboo_is_magento_installed') == 1) {
self.project.executeTarget('_import_mysql_dump');
self.project.executeTarget('_copy_config_php');
self.project.executeTarget('_update_db');
Expand Down Expand Up @@ -269,7 +285,7 @@

<script language="javascript"><![CDATA[
var currentInstance = project.getProperty('instanceIndex');
if (currentInstance == 0) {
if (currentInstance == 0 && project.getProperty('env.bamboo_is_magento_installed') == 1) {
self.project.executeTarget( '_install_standalone_application' );
}
]]></script>
Expand Down
8 changes: 8 additions & 0 deletions dev/build/core_dev/functional/config/install_data.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
db_credentials:
dbHost: {{db_host}}
dbUser: {{db_user}}
dbPassword: {{db_password}}
dbName: {{db_name}}
url:
base_url: {{url}}
backend_frontname: backend
2 changes: 2 additions & 0 deletions dev/build/core_dev/functional/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@
<env name="server_config_path" value="config/server.yml.dist"/>
<env name="isolation_config_path" value="config/isolation.yml.dist"/>
<env name="handlers_config_path" value="config/handler.yml.dist"/>
<env name="install_config_path" value="config/install_data.yml.dist" />
<env name="configuration:Mtf/TestSuite/InjectableTests" value="{{tests_configuration}}"/>
<env name="log_directory" value="var/log"/>
<env name="events_preset" value="base"/>
<env name="module_whitelist" value="{{module_whitelist}}" />
<!--{{parallel_instances}}-->
</php>

Expand Down
3 changes: 1 addition & 2 deletions dev/tests/functional/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"magento/mtf": "1.0.0-rc9",
"magento/mtf": "1.0.0-rc10",
"php": ">=5.4.0",
"phpunit/phpunit": "4.1.0",
"phpunit/phpunit-selenium": ">=1.2",
Expand All @@ -21,7 +21,6 @@
"Mtf\\": ["lib/Mtf/", "generated/Mtf/", "testsuites/Mtf/"],
"Magento\\": ["generated/Magento/", "tests/app/Magento/"],
"Test\\": "generated/Test/"

}
}
}
10 changes: 5 additions & 5 deletions dev/tests/functional/composer.json.dist
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"require": {
"magento/mtf": "dev-master",
"magento/mtf": "dev-develop",
"php": ">=5.4.0",
"phpunit/phpunit": "4.1.0",
"phpunit/phpunit-selenium": ">=1.2",
"netwing/selenium-server-standalone": ">=2.35"
},
"autoload": {
"psr-0": {
"Mtf\\": "lib",
"Magento\\": "",
"": ["testsuites", "generated", "lib", "tests/app"]
"psr-4": {
"Mtf\\": ["lib/Mtf/", "generated/Mtf/", "testsuites/Mtf/"],
"Magento\\": ["generated/Magento/", "tests/app/Magento/"],
"Test\\": "generated/Test/"
}
}
}
9 changes: 9 additions & 0 deletions dev/tests/functional/config/install_data.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
db_credentials:
dbHost: '127.0.0.1'
dbUser: 'root'
dbPassword: '123123q'
dbName: 'default'
url:
base_url: 'http://127.0.0.1/magento2/'
backend_frontname: 'backend'
6 changes: 4 additions & 2 deletions dev/tests/functional/lib/Mtf/App/State/State1.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ public function __construct(Config $config)
public function apply()
{
parent::apply();
$this->config->switchData('app_state1_configuration');
$this->config->persist();
if (file_exists(dirname(dirname(dirname(MTF_BP))) . '/app/etc/config.php')) {
$this->config->switchData('app_state1_configuration');
$this->config->persist();
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class ConditionsElement extends AbstractElement
*
* @var string
*/
protected $ruleParamInput = '.element [name^="rule[conditions]"]';
protected $ruleParamInput = '.element [name^="rule"]';

/**
* Set value to conditions
Expand Down
Loading

0 comments on commit db526c3

Please sign in to comment.