Skip to content

Commit

Permalink
Merge pull request #29 from magento-firedrakes/MAGETWO-44416
Browse files Browse the repository at this point in the history
[Firedrakes] Bugfixes
  • Loading branch information
Korshenko, Olexii(okorshenko) committed Oct 23, 2015
2 parents 4197d0e + bac72ac commit 1f0b802
Show file tree
Hide file tree
Showing 139 changed files with 660 additions and 421 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ protected function _construct()
$this->addButton(
'save_in_new_set',
[
'label' => __('Save in New Product Template'),
'label' => __('Save in New Attribute Set'),
'class' => 'save',
'onclick' => 'saveAttributeInNewSet(\'' . __('Enter Name for New Product Template') . '\')'
'onclick' => 'saveAttributeInNewSet(\'' . __('Enter Name for New Attribute Set') . '\')'
],
100
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ protected function _prepareLayout()
'label' => __('Delete'),
'onclick' => 'deleteConfirm(\'' . $this->escapeJsQuote(
__(
'You are about to delete all products in this product template. '
'You are about to delete all products in this attribute set. '
. 'Are you sure you want to do that?'
)
) . '\', \'' . $this->getUrl(
Expand Down Expand Up @@ -187,7 +187,7 @@ public function getSetFormHtml()
*/
protected function _getHeader()
{
return __("Edit Product Template '%1'", $this->_getAttributeSet()->getAttributeSetName());
return __("Edit Attribute Set '%1'", $this->_getAttributeSet()->getAttributeSetName());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function _prepareForm()

/** @var \Magento\Framework\Data\Form $form */
$form = $this->_formFactory->create();
$fieldset = $form->addFieldset('set_name', ['legend' => __('Edit Product Template Name')]);
$fieldset = $form->addFieldset('set_name', ['legend' => __('Edit Attribute Set Name')]);
$fieldset->addField(
'attribute_set_name',
'text',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function _prepareLayout()
*/
protected function _getHeader()
{
return __('Add New Product Template');
return __('Add New Attribute Set');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected function _prepareLayout()
'addButton',
'Magento\Backend\Block\Widget\Button',
[
'label' => __('Add Product Template'),
'label' => __('Add Attribute Set'),
'onclick' => 'setLocation(\'' . $this->getUrl('catalog/*/add') . '\')',
'class' => 'add primary add-set'
]
Expand All @@ -48,7 +48,7 @@ public function getNewButtonHtml()
*/
protected function _getHeader()
{
return __('Product Templates');
return __('Attribute Sets');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct(
public function getSelectorOptions()
{
return [
'source' => $this->getUrl('catalog/product/suggestProductTemplates'),
'source' => $this->getUrl('catalog/product/suggestAttributeSets'),
'className' => 'category-select',
'showRecent' => true,
'storageKey' => 'product-template-key',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ protected function _prepareColumns()
$this->addColumn(
'set_name',
[
'header' => __('Product Template'),
'header' => __('Attribute Set'),
'index' => 'attribute_set_id',
'type' => 'options',
'options' => $sets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ protected function _prepareColumns()
$this->addColumn(
'set_name',
[
'header' => __('Product Template'),
'header' => __('Attribute Set'),
'index' => 'attribute_set_id',
'type' => 'options',
'options' => $sets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ protected function _prepareColumns()
$this->addColumn(
'set_name',
[
'header' => __('Product Template'),
'header' => __('Attribute Set'),
'index' => 'attribute_set_id',
'type' => 'options',
'options' => $sets,
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ protected function _prepareColumns()
$this->addColumn(
'set_name',
[
'header' => __('Product Template'),
'header' => __('Attribute Set'),
'index' => 'attribute_set_id',
'type' => 'options',
'options' => $sets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct(
}

/**
* Retrieve list of product templates with search part contained in label
* Retrieve list of attribute sets with search part contained in label
*
* @param string $labelPart
* @return array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(
$this->resultJsonFactory = $resultJsonFactory;
}
/**
* Add attribute to product template
* Add attribute to attribute set
*
* @return \Magento\Framework\Controller\Result\Json
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function execute()
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */
$resultPage = $this->resultPageFactory->create();
$resultPage->setActiveMenu('Magento_Catalog::catalog_attributes_sets');
$resultPage->getConfig()->getTitle()->prepend(__('New Product Template'));
$resultPage->getConfig()->getTitle()->prepend(__('New Attribute Set'));
$resultPage->addContent(
$resultPage->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Toolbar\Add')
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function execute()
$resultRedirect = $this->resultRedirectFactory->create();
try {
$this->attributeSetRepository->deleteById($setId);
$this->messageManager->addSuccess(__('The product template has been removed.'));
$this->messageManager->addSuccess(__('The attribute set has been removed.'));
$resultRedirect->setPath('catalog/*/');
} catch (\Exception $e) {
$this->messageManager->addError(__('We can\'t delete this set right now.'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function execute()
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */
$resultPage = $this->resultPageFactory->create();
$resultPage->setActiveMenu('Magento_Catalog::catalog_attributes_sets');
$resultPage->getConfig()->getTitle()->prepend(__('Product Templates'));
$resultPage->getConfig()->getTitle()->prepend(__('Attribute Sets'));
$resultPage->getConfig()->getTitle()->prepend(
$attributeSet->getId() ? $attributeSet->getAttributeSetName() : __('New Set')
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public function execute()
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */
$resultPage = $this->resultPageFactory->create();
$resultPage->setActiveMenu('Magento_Catalog::catalog_attributes_sets');
$resultPage->getConfig()->getTitle()->prepend(__('Product Templates'));
$resultPage->getConfig()->getTitle()->prepend(__('Attribute Sets'));
$resultPage->addBreadcrumb(__('Catalog'), __('Catalog'));
$resultPage->addBreadcrumb(__('Manage Product Templates'), __('Product Templates'));
$resultPage->addBreadcrumb(__('Manage Attribute Sets'), __('Attribute Sets'));
return $resultPage;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function execute()
}
if (!$model->getId()) {
throw new \Magento\Framework\Exception\LocalizedException(
__('This product template no longer exists.')
__('This attribute set no longer exists.')
);
}
$data = $this->_objectManager->get('Magento\Framework\Json\Helper\Data')
Expand All @@ -100,12 +100,12 @@ public function execute()
$model->initFromSkeleton($this->getRequest()->getParam('skeleton_set'));
}
$model->save();
$this->messageManager->addSuccess(__('You saved the product template.'));
$this->messageManager->addSuccess(__('You saved the attribute set.'));
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->messageManager->addError($e->getMessage());
$hasError = true;
} catch (\Exception $e) {
$this->messageManager->addException($e, __('Something went wrong while saving the product template.'));
$this->messageManager->addException($e, __('Something went wrong while saving the attribute set.'));
$hasError = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
namespace Magento\Catalog\Controller\Adminhtml\Product;

class SuggestProductTemplates extends \Magento\Backend\App\Action
class SuggestAttributeSets extends \Magento\Backend\App\Action
{
/**
* @var \Magento\Framework\Controller\Result\JsonFactory
Expand Down Expand Up @@ -34,7 +34,7 @@ public function __construct(
}

/**
* Action for product template selector
* Action for attribute set selector
*
* @return \Magento\Framework\Controller\Result\Json
*/
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function getFlatColumnsDdlDefinition()
'unsigned' => true,
'nullable' => false,
'default' => '0',
'comment' => 'Product Template ID',
'comment' => 'Attribute Set ID',
];
$columns['type_id'] = [
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function getAttributeSet()
$attributeSet = $this->attributeSetFactory->create();
$attributeSet->setEntityTypeId($this->entityTypeId)->load($this->name, 'attribute_set_name');
if ($attributeSet->getId()) {
throw new AlreadyExistsException(__('Product Template already exists.'));
throw new AlreadyExistsException(__('Attribute Set already exists.'));
}

$attributeSet->setAttributeSetName($this->name)->validate();
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Model/ResourceModel/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ public function validate($object)
$entityType = $this->typeFactory->create()->loadByCode(\Magento\Catalog\Model\Product::ENTITY);
$attributeSet = $this->setFactory->create()->load($object->getAttributeSetId());
if ($attributeSet->getEntityTypeId() != $entityType->getId()) {
return ['attribute_set' => 'Invalid product template entity type'];
return ['attribute_set' => 'Invalid attribute set entity type'];
}

return parent::validate($object);
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Setup/InstallSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
null,
['unsigned' => true, 'nullable' => false, 'default' => '0'],
'Product Template ID'
'Attribute Set ID'
)
->addColumn(
'type_id',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected function setUp()

public function testGetList()
{
$attributeSetName = 'Default Product Template';
$attributeSetName = 'Default Attribute Set';
$expectedResult = [
$this->getMock('\Magento\Catalog\Api\Data\ProductAttributeInterface'),
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function setUp()
public function testValidateWrongAttributeSet()
{
$productTypeId = 4;
$expectedErrorMessage = ['attribute_set' => 'Invalid product template entity type'];
$expectedErrorMessage = ['attribute_set' => 'Invalid attribute set entity type'];

$productMock = $this->getMock(
'\Magento\Framework\DataObject',
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/etc/acl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<resource id="Magento_Backend::stores_attributes">
<resource id="Magento_Catalog::attributes_attributes" title="Product" sortOrder="30" />
<resource id="Magento_Catalog::update_attributes" title="Update Attributes" sortOrder="35" />
<resource id="Magento_Catalog::sets" title="Product Template" sortOrder="40"/>
<resource id="Magento_Catalog::sets" title="Attribute Set" sortOrder="40"/>
</resource>
</resource>
</resource>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/etc/adminhtml/menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<add id="Magento_Catalog::catalog_products" title="Catalog" module="Magento_Catalog" sortOrder="10" parent="Magento_Catalog::inventory" action="catalog/product/" resource="Magento_Catalog::products"/>
<add id="Magento_Catalog::catalog_categories" title="Categories" module="Magento_Catalog" sortOrder="20" parent="Magento_Catalog::inventory" action="catalog/category/" resource="Magento_Catalog::categories"/>
<add id="Magento_Catalog::catalog_attributes_attributes" title="Product" module="Magento_Catalog" sortOrder="30" parent="Magento_Backend::stores_attributes" action="catalog/product_attribute/" resource="Magento_Catalog::attributes_attributes"/>
<add id="Magento_Catalog::catalog_attributes_sets" title="Product Template" module="Magento_Catalog" sortOrder="40" parent="Magento_Backend::stores_attributes" action="catalog/product_set/" resource="Magento_Catalog::sets"/>
<add id="Magento_Catalog::catalog_attributes_sets" title="Attribute Set" module="Magento_Catalog" sortOrder="40" parent="Magento_Backend::stores_attributes" action="catalog/product_set/" resource="Magento_Catalog::sets"/>

<add id="Magento_Catalog::inventory" title="Inventory" module="Magento_Catalog" sortOrder="10" parent="Magento_Catalog::catalog" dependsOnModule="Magento_Catalog" resource="Magento_Catalog::catalog"/>
</menu>
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Catalog/i18n/de_DE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Empty,Leer
"Based On","Basierend auf"
"Add New Attribute Set","Neuer Eigenschaftensatz hinzufügen"
"Add New Set","Neuen Satz hinzufügen"
"Product Templates","Product Templates"
"Attribute Sets","Attribute Sets"
"Close Window","Fenster Schließen"
"New Product","Neues Produkt"
"Save & Edit","Save & Edit"
Expand Down Expand Up @@ -280,7 +280,7 @@ Categories,Kategorien
"This attribute set no longer exists.","Dieses Eigenschaftenset existiert nicht mehr."
"You saved the attribute set.","You saved the attribute set."
"An error occurred while saving the attribute set.","Beim Speichern des Eigenschaftensatzes ist ein Fehler aufgetreten."
"New Product Template","New Product Template"
"New Attribute Set","New Attribute Set"
"The attribute set has been removed.","The attribute set has been removed."
"An error occurred while deleting this set.","An error occurred while deleting this set."
"Search Terms","Search Terms"
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Catalog/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Empty,Empty
"Based On","Based On"
"Add New Attribute Set","Add New Attribute Set"
"Add New Set","Add New Set"
"Product Templates","Product Templates"
"Attribute Sets","Attribute Sets"
"Close Window","Close Window"
"New Product","New Product"
"Save & Edit","Save & Edit"
Expand Down Expand Up @@ -280,7 +280,7 @@ Categories,Categories
"This attribute set no longer exists.","This attribute set no longer exists."
"You saved the attribute set.","You saved the attribute set."
"An error occurred while saving the attribute set.","An error occurred while saving the attribute set."
"New Product Template","New Product Template"
"New Attribute Set","New Attribute Set"
"The attribute set has been removed.","The attribute set has been removed."
"An error occurred while deleting this set.","An error occurred while deleting this set."
"Search Terms","Search Terms"
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Catalog/i18n/es_ES.csv
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Empty,Vacío(a)
"Based On","Basado en"
"Add New Attribute Set","Agregar nuevo conjunto de atributos"
"Add New Set","Agregar nuevo conjunto"
"Product Templates","Product Templates"
"Attribute Sets","Attribute Sets"
"Close Window","Cerrar Ventana"
"New Product","Nuevo producto"
"Save & Edit","Save & Edit"
Expand Down Expand Up @@ -280,7 +280,7 @@ Categories,Categorías
"This attribute set no longer exists.","Este conjunto de atributos ya no existe."
"You saved the attribute set.","You saved the attribute set."
"An error occurred while saving the attribute set.","Se produjo un error mientras se guardaba el conjunto de atributos."
"New Product Template","New Product Template"
"New Attribute Set","New Attribute Set"
"The attribute set has been removed.","The attribute set has been removed."
"An error occurred while deleting this set.","An error occurred while deleting this set."
"Search Terms","Search Terms"
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Catalog/i18n/fr_FR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Empty,Vide
"Based On","Basé sur"
"Add New Attribute Set","Ajouter un nouveau jeu d'attributs"
"Add New Set","Ajouter une nouvelle série"
"Product Templates","Product Templates"
"Attribute Sets","Attribute Sets"
"Close Window","Fermer la fenêtre"
"New Product","Nouveau produit"
"Save & Edit","Save & Edit"
Expand Down Expand Up @@ -280,7 +280,7 @@ Categories,catégories
"This attribute set no longer exists.","La série d'attributs n'existe plus."
"You saved the attribute set.","You saved the attribute set."
"An error occurred while saving the attribute set.","Une erreur est survenue pendant la sauvegarde de la série d'attributs."
"New Product Template","New Product Template"
"New Attribute Set","New Attribute Set"
"The attribute set has been removed.","The attribute set has been removed."
"An error occurred while deleting this set.","An error occurred while deleting this set."
"Search Terms","Search Terms"
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Catalog/i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Empty,Leeg
"Based On","Gebaseerd op"
"Add New Attribute Set","Voeg Nieuwe Attribuut Set toe"
"Add New Set","Voeg Nieuwe Reeks Toe"
"Product Templates","Product Templates"
"Attribute Sets","Attribute Sets"
"Close Window","Venster Sluiten"
"New Product","Nieuw Product"
"Save & Edit","Save & Edit"
Expand Down Expand Up @@ -280,7 +280,7 @@ Categories,Categoriën
"This attribute set no longer exists.","Deze attribuutset bestaat niet meer."
"You saved the attribute set.","You saved the attribute set."
"An error occurred while saving the attribute set.","Er is een fout opgetreden tijdens het opslaan van de attribuut set."
"New Product Template","New Product Template"
"New Attribute Set","New Attribute Set"
"The attribute set has been removed.","The attribute set has been removed."
"An error occurred while deleting this set.","An error occurred while deleting this set."
"Search Terms","Search Terms"
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Catalog/i18n/pt_BR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Empty,Vazio
"Based On","Baseado Em"
"Add New Attribute Set","Adicionar Novo Conjunto de Atributos"
"Add New Set","Adicionar Novo Conjunto"
"Product Templates","Product Templates"
"Attribute Sets","Attribute Sets"
"Close Window","Fechar Janela"
"New Product","Novo Produto"
"Save & Edit","Save & Edit"
Expand Down Expand Up @@ -280,7 +280,7 @@ Categories,Categorias
"This attribute set no longer exists.","Este conjunto de atributos não existe mais."
"You saved the attribute set.","You saved the attribute set."
"An error occurred while saving the attribute set.","Ocorreu um erro ao salvar o conjunto de atributos."
"New Product Template","New Product Template"
"New Attribute Set","New Attribute Set"
"The attribute set has been removed.","The attribute set has been removed."
"An error occurred while deleting this set.","An error occurred while deleting this set."
"Search Terms","Search Terms"
Expand Down
Loading

0 comments on commit 1f0b802

Please sign in to comment.