Skip to content

Commit

Permalink
2.0.0.0-dev78
Browse files Browse the repository at this point in the history
* Fixed bugs:
  * Fixed an issue where a blank page was displayed when changing store view on a product page
  * Fixed an issue where it was impossible to change attribute template during product creation
  * Fixed an issue where the Categories field and the New Category button was displayed during product creation for users with no permissions to access Products and Categories
  * Fixed an issue where no records were found in the User Roles grid if no users were assigned to a role
  * Fixed an issue where variable values in the Newsletter templates were not displayed
  * Fixed an issue where 'No files found' was displayed in the JS Editor on the Design page
  * Fixed an issue where the State/Province list on frontend was displayed with HTML tags if inline translate was enabled
  * Fixed an issue where CAPTCHA was not displayed on the Contact Us page
  * Fixed an issue where scheduled backups were not displayed and neither performed
  * Fixed functional tests failing PSR-2 test
  • Loading branch information
magento-team committed May 16, 2014
1 parent 75b30db commit f78121f
Show file tree
Hide file tree
Showing 144 changed files with 2,279 additions and 549 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
2.0.0.0-dev78
=============
* Fixed bugs:
* Fixed an issue where a blank page was displayed when changing store view on a product page
* Fixed an issue where it was impossible to change attribute template during product creation
* Fixed an issue where the Categories field and the New Category button was displayed during product creation for users with no permissions to access Products and Categories
* Fixed an issue where no records were found in the User Roles grid if no users were assigned to a role
* Fixed an issue where variable values in the Newsletter templates were not displayed
* Fixed an issue where 'No files found' was displayed in the JS Editor on the Design page
* Fixed an issue where the State/Province list on frontend was displayed with HTML tags if inline translate was enabled
* Fixed an issue where CAPTCHA was not displayed on the Contact Us page
* Fixed an issue where scheduled backups were not displayed and neither performed
* Fixed functional tests failing PSR-2 test

2.0.0.0-dev77
=============
* Themes update:
* Blank theme was refactored to implement the mobile-first approach
* Added Readme.md file
* Fixed bugs:
* Fixed an issue where it was impossible to place order using store credit
* Fixed an issue where adding products with custom options from a wishlist to shopping cart caused an error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
namespace Magento\Catalog\Block\Adminhtml\Product\Helper\Form;

use Magento\Catalog\Model\Resource\Category\Collection;
use Magento\Framework\AuthorizationInterface;

/**
* Product form category field helper
Expand Down Expand Up @@ -52,6 +53,11 @@ class Category extends \Magento\Framework\Data\Form\Element\Multiselect
*/
protected $_jsonEncoder;

/**
* @var AuthorizationInterface
*/
protected $authorization;

/**
* @param \Magento\Framework\Data\Form\Element\Factory $factoryElement
* @param \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection
Expand All @@ -60,6 +66,7 @@ class Category extends \Magento\Framework\Data\Form\Element\Multiselect
* @param \Magento\Backend\Helper\Data $backendData
* @param \Magento\Framework\View\LayoutInterface $layout
* @param \Magento\Framework\Json\EncoderInterface $jsonEncoder
* @param AuthorizationInterface $authorization
* @param array $data
*/
public function __construct(
Expand All @@ -70,15 +77,30 @@ public function __construct(
\Magento\Backend\Helper\Data $backendData,
\Magento\Framework\View\LayoutInterface $layout,
\Magento\Framework\Json\EncoderInterface $jsonEncoder,
array $data = array()
AuthorizationInterface $authorization,
array $data = []
) {
$this->_jsonEncoder = $jsonEncoder;
$this->_collectionFactory = $collectionFactory;
$this->_backendData = $backendData;
$this->authorization = $authorization;
parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
$this->_layout = $layout;
}

/**
* Get no display
*
* @return bool
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
*/
public function getNoDisplay()
{

$isNotAllowed = !$this->authorization->isAllowed('Magento_Catalog::categories');
return $this->getData('no_display') || $isNotAllowed;
}

/**
* Get values for select
*
Expand All @@ -94,10 +116,10 @@ public function getValues()
$collection->addAttributeToSelect('name');
$collection->addIdFilter($values);

$options = array();
$options = [];

foreach ($collection as $category) {
$options[] = array('label' => $category->getName(), 'value' => $category->getId());
$options[] = ['label' => $category->getName(), 'value' => $category->getId()];
}
return $options;
}
Expand Down Expand Up @@ -127,14 +149,14 @@ public function getAfterElementHtml()
$button = $this->_layout->createBlock(
'Magento\Backend\Block\Widget\Button'
)->setData(
array(
'id' => 'add_category_button',
'label' => $newCategoryCaption,
'title' => $newCategoryCaption,
'onclick' => 'jQuery("#new-category").dialog("open")',
'disabled' => $this->getDisabled()
)
);
[
'id' => 'add_category_button',
'label' => $newCategoryCaption,
'title' => $newCategoryCaption,
'onclick' => 'jQuery("#new-category").dialog("open")',
'disabled' => $this->getDisabled()
]
);
$return = <<<HTML
<input id="{$htmlId}-suggest" placeholder="$suggestPlaceholder" />
<script>
Expand All @@ -151,12 +173,12 @@ public function getAfterElementHtml()
*/
protected function _getSelectorOptions()
{
return array(
return [
'source' => $this->_backendData->getUrl('catalog/category/suggestCategories'),
'valueField' => '#' . $this->getHtmlId(),
'className' => 'category-select',
'multiselect' => true,
'showAll' => true
);
];
}
}
10 changes: 5 additions & 5 deletions app/code/Magento/Catalog/Controller/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ public function viewAction()
$specifyOptions = $this->getRequest()->getParam('options');

if ($this->getRequest()->isPost() && $this->getRequest()->getParam(self::PARAM_NAME_URL_ENCODED)) {
$product = $this->_initProduct();
if (!$product) {
$this->noProductRedirect();
}
if ($specifyOptions) {
$product = $this->_initProduct();
if (!$product) {
$this->noProductRedirect();
}
$notice = $product->getTypeInstance()->getSpecifyOptionMessage();
$this->messageManager->addNotice($notice);
$this->getResponse()->setRedirect($this->_redirect->getRedirectUrl());
}
$this->getResponse()->setRedirect($this->_redirect->getRedirectUrl());
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ jQuery(function($) {
});

var nameDataMapper = function() {
return $(this).data('elementId');
return $(this).data('attributeCode');
};
//add new element elements or reorder
$page.find('[data-form=edit-product] [data-role=tabs] .fieldset, #product_info_tabs .fieldset')
Expand Down
4 changes: 4 additions & 0 deletions app/code/Magento/Checkout/view/frontend/js/region-updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
*/
_renderSelectOption: function(selectElement, key, value) {
selectElement.append($.proxy(function() {
if (value.code && $(value.name).is('span')) {
key = value.code;
value.name = $(value.name).text();
}
$.template('regionTemplate', this.options.regionTemplate);
if (this.options.defaultRegion === key) {
return $.tmpl('regionTemplate', {value: key, title: value.name, isSelected: true});
Expand Down
27 changes: 15 additions & 12 deletions app/code/Magento/Cron/Model/Config/Converter/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ class Db implements \Magento\Framework\Config\ConverterInterface
*/
public function convert($source)
{
$jobs = isset($source['crontab']['default']['jobs']) ? $source['crontab']['default']['jobs'] : array();
$cronTab = isset($source['crontab']) ? $source['crontab'] : array();

if (empty($jobs)) {
return $jobs;
if (empty($cronTab)) {
return $cronTab;
}
return $this->_extractParams($jobs);
return $this->_extractParams($cronTab);
}

/**
Expand All @@ -50,18 +50,21 @@ public function convert($source)
* @param array $jobs
* @return array
*/
protected function _extractParams(array $jobs)
protected function _extractParams(array $cronTab)
{
$result = array();
foreach ($jobs as $jobName => $value) {
$result[$jobName] = $value;
foreach ($cronTab as $groupName => $groupConfig) {
$jobs = $groupConfig['jobs'];
foreach ($jobs as $jobName => $value) {
$result[$groupName][$jobName] = $value;

if (isset($value['schedule']) && is_array($value['schedule'])) {
$this->_processConfigParam($value, $jobName, $result);
$this->_processScheduleParam($value, $jobName, $result);
}
if (isset($value['schedule']) && is_array($value['schedule'])) {
$this->_processConfigParam($value, $jobName, $result[$groupName]);
$this->_processScheduleParam($value, $jobName, $result[$groupName]);
}

$this->_processRunModel($value, $jobName, $result);
$this->_processRunModel($value, $jobName, $result[$groupName]);
}
}
return $result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</div>
<?php endif;?>
</div>
<iframe name="preview_iframe" id="preview_iframe" frameborder="0" title="<?php echo __('Preview') ?>" width="100%" onload="iframeSetHeight()"></iframe>
<iframe name="preview_iframe" id="preview_iframe" frameborder="0" title="<?php echo __('Preview') ?>" width="100%"></iframe>
<?php echo $this->getChildHtml('preview_form'); ?>
</div>

Expand Down Expand Up @@ -67,13 +67,9 @@ function unBlockPreview() {
Event.observe(window, 'load', preview);
Event.observe(previewIframe, 'load', unBlockPreview);

function iframeSetHeight() {
var iFrameID = document.getElementById('preview_iframe');
if(iFrameID) {
iFrameID.height = "";
iFrameID.height = iFrameID.contentWindow.document.body.scrollHeight + "px";
}
}
jQuery("#preview_iframe").load(function() {
jQuery(this).height(jQuery(this).contents().find("html").height() );
});

//]]>
</script>
Expand Down
5 changes: 0 additions & 5 deletions app/code/Magento/Theme/view/adminhtml/tabs/fieldset/js.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
<input type="hidden" name="js_uploaded_files[]" value="${temporary}" />
</div>

<div class="no-display" id="no-js-files-found-template">
<span class="filename"><?php echo __('We found no files.') ?></span>
</div>


<ul id="js-files-container" class="js-files-container ui-sortable" ></ul>

Expand All @@ -67,7 +63,6 @@ jQuery(function($) {

$('#js-files-container').themeJsList({
templateId : '#js-uploaded-file-template',
emptyTemplateId : '#no-js-files-found-template',
refreshFileListEvent : 'refreshJsList',
prefixItemId : 'js-file-'
});
Expand Down
33 changes: 16 additions & 17 deletions app/code/Magento/User/Block/Role/Grid/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function __construct(
\Magento\Framework\Json\EncoderInterface $jsonEncoder,
\Magento\Framework\Registry $coreRegistry,
\Magento\User\Model\RoleFactory $roleFactory,
array $data = array()
array $data = []
) {
parent::__construct($context, $backendHelper, $data);
$this->_jsonEncoder = $jsonEncoder;
Expand All @@ -82,7 +82,6 @@ protected function _construct()
$this->setDefaultSort('role_user_id');
$this->setDefaultDir('asc');
$this->setId('roleUserGrid');
$this->setDefaultFilter(array('in_role_users' => 1));
$this->setUseAjax(true);
}

Expand All @@ -98,10 +97,10 @@ protected function _addColumnFilterToCollection($column)
$inRoleIds = 0;
}
if ($column->getFilter()->getValue()) {
$this->getCollection()->addFieldToFilter('user_id', array('in' => $inRoleIds));
$this->getCollection()->addFieldToFilter('user_id', ['in' => $inRoleIds]);
} else {
if ($inRoleIds) {
$this->getCollection()->addFieldToFilter('user_id', array('nin' => $inRoleIds));
$this->getCollection()->addFieldToFilter('user_id', ['nin' => $inRoleIds]);
}
}
} else {
Expand Down Expand Up @@ -129,50 +128,50 @@ protected function _prepareColumns()
{
$this->addColumn(
'in_role_users',
array(
[
'header_css_class' => 'a-center',
'type' => 'checkbox',
'name' => 'in_role_users',
'values' => $this->getUsers(),
'align' => 'center',
'index' => 'user_id'
)
]
);

$this->addColumn(
'role_user_id',
array('header' => __('User ID'), 'width' => 5, 'align' => 'left', 'sortable' => true, 'index' => 'user_id')
['header' => __('User ID'), 'width' => 5, 'align' => 'left', 'sortable' => true, 'index' => 'user_id']
);

$this->addColumn(
'role_user_username',
array('header' => __('User Name'), 'align' => 'left', 'index' => 'username')
['header' => __('User Name'), 'align' => 'left', 'index' => 'username']
);

$this->addColumn(
'role_user_firstname',
array('header' => __('First Name'), 'align' => 'left', 'index' => 'firstname')
['header' => __('First Name'), 'align' => 'left', 'index' => 'firstname']
);

$this->addColumn(
'role_user_lastname',
array('header' => __('Last Name'), 'align' => 'left', 'index' => 'lastname')
['header' => __('Last Name'), 'align' => 'left', 'index' => 'lastname']
);

$this->addColumn(
'role_user_email',
array('header' => __('Email'), 'width' => 40, 'align' => 'left', 'index' => 'email')
['header' => __('Email'), 'width' => 40, 'align' => 'left', 'index' => 'email']
);

$this->addColumn(
'role_user_is_active',
array(
[
'header' => __('Status'),
'index' => 'is_active',
'align' => 'left',
'type' => 'options',
'options' => array('1' => __('Active'), '0' => __('Inactive'))
)
'options' => ['1' => __('Active'), '0' => __('Inactive')]
]
);

/*
Expand Down Expand Up @@ -202,7 +201,7 @@ protected function _prepareColumns()
public function getGridUrl()
{
$roleId = $this->getRequest()->getParam('rid');
return $this->getUrl('*/*/editrolegrid', array('rid' => $roleId));
return $this->getUrl('*/*/editrolegrid', ['rid' => $roleId]);
}

/**
Expand All @@ -224,7 +223,7 @@ public function getUsers($json = false)
$users = $this->_roleFactory->create()->setId($roleId)->getRoleUsers();
if (sizeof($users) > 0) {
if ($json) {
$jsonUsers = array();
$jsonUsers = [];
foreach ($users as $usrid) {
$jsonUsers[$usrid] = 0;
}
Expand All @@ -236,7 +235,7 @@ public function getUsers($json = false)
if ($json) {
return '{}';
} else {
return array();
return [];
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dev/tests/functional/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
session_start();
require_once __DIR__ . '/../../../app/bootstrap.php';
restore_error_handler();
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/vendor/autoload.php';
2 changes: 1 addition & 1 deletion dev/tests/functional/isolation.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
//Isolation script sample
//exec('mysql -uroot -p123123q -e"DROP DATABASE mtf; CREATE DATABASE mtf CHARACTER SET utf8;"');
//exec('mysql -uroot -p123123q mtf < /var/www/mtf/mtf.dump.sql');
//exec('rm -rf /var/www/mtf/var/*');
//exec('rm -rf /var/www/mtf/var/*');
Loading

0 comments on commit f78121f

Please sign in to comment.