Skip to content

Commit b743d7f

Browse files
author
Dmytro Voskoboinikov
committed
Merge branch 'MAGETWO-28012' of https://github.corp.ebay.com/magento-firedrakes/magento2ce into MAGETWO-28012
2 parents 43784a6 + 95cc96d commit b743d7f

File tree

3 files changed

+35
-7
lines changed

3 files changed

+35
-7
lines changed

app/code/Magento/CustomerImportExport/Model/Import/Address.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,8 @@ protected function _prepareDataForUpdate(array $rowData)
539539
'entity_row_new' => $entityRowNew,
540540
'entity_row_update' => $entityRowUpdate,
541541
'attributes' => $attributes,
542-
'defaults' => $defaults];
542+
'defaults' => $defaults
543+
];
543544
}
544545

545546
/**

app/code/Magento/CustomerImportExport/Model/Import/Customer.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,6 @@ protected function _saveCustomerEntities(array $entitiesToCreate, array $entitie
222222
'suffix',
223223
'dob',
224224
'password_hash',
225-
'default_billing',
226-
'default_shipping',
227225
'taxvat',
228226
'confirmation',
229227
'gender',

app/code/Magento/ImportExport/Model/Export.php

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Export model
1313
*
1414
* @author Magento Core Team <core@magentocommerce.com>
15+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1516
*/
1617
class Export extends \Magento\ImportExport\Model\AbstractModel
1718
{
@@ -213,16 +214,44 @@ public static function getAttributeFilterType(\Magento\Eav\Model\Entity\Attribut
213214
return self::FILTER_TYPE_DATE;
214215
} elseif ('decimal' == $attribute->getBackendType() || 'int' == $attribute->getBackendType()) {
215216
return self::FILTER_TYPE_NUMBER;
216-
} elseif ($attribute->isStatic() ||
217-
'varchar' == $attribute->getBackendType() ||
218-
'text' == $attribute->getBackendType()
219-
) {
217+
} elseif ('varchar' == $attribute->getBackendType() || 'text' == $attribute->getBackendType()) {
220218
return self::FILTER_TYPE_INPUT;
219+
} elseif ($attribute->isStatic()) {
220+
return self::getStaticAttributeFilterType($attribute);
221221
} else {
222222
throw new \Magento\Framework\Exception\LocalizedException(__('Cannot determine attribute filter type'));
223223
}
224224
}
225225

226+
/**
227+
* Determine filter type for static attribute.
228+
*
229+
* @static
230+
* @param \Magento\Eav\Model\Entity\Attribute $attribute
231+
* @return string
232+
*/
233+
public static function getStaticAttributeFilterType(\Magento\Eav\Model\Entity\Attribute $attribute)
234+
{
235+
if ($attribute->getAttributeCode() == 'category_ids') {
236+
return self::FILTER_TYPE_INPUT;
237+
}
238+
$columns = $attribute->getFlatColumns();
239+
switch ($columns[$attribute->getAttributeCode()]['type']) {
240+
case \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER:
241+
case \Magento\Framework\DB\Ddl\Table::TYPE_BIGINT:
242+
$type = self::FILTER_TYPE_NUMBER;
243+
break;
244+
case \Magento\Framework\DB\Ddl\Table::TYPE_DATE:
245+
case \Magento\Framework\DB\Ddl\Table::TYPE_DATETIME:
246+
case \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP:
247+
$type = self::FILTER_TYPE_DATE;
248+
break;
249+
default:
250+
$type = self::FILTER_TYPE_INPUT;
251+
}
252+
return $type;
253+
}
254+
226255
/**
227256
* MIME-type for 'Content-Type' header.
228257
*

0 commit comments

Comments
 (0)