@@ -154,6 +154,9 @@ class Customer extends AbstractCustomer
154
154
CustomerInterface::GENDER ,
155
155
'rp_token ' ,
156
156
'rp_token_created_at ' ,
157
+ 'failures_num ' ,
158
+ 'first_failure ' ,
159
+ 'lock_expires ' ,
157
160
];
158
161
159
162
/**
@@ -370,20 +373,24 @@ protected function _prepareDataForUpdate(array $rowData)
370
373
if ($ newCustomer && !strlen ($ value )) {
371
374
continue ;
372
375
}
376
+
377
+ $ attributeParameters = $ this ->_attributes [$ attributeCode ];
378
+ if ('select ' == $ attributeParameters ['type ' ]) {
379
+ $ value = isset ($ attributeParameters ['options ' ][strtolower ($ value )])
380
+ ? $ attributeParameters ['options ' ][strtolower ($ value )]
381
+ : 0 ;
382
+ } elseif ('datetime ' == $ attributeParameters ['type ' ] && !empty ($ value )) {
383
+ $ value = (new \DateTime ())->setTimestamp (strtotime ($ value ));
384
+ $ value = $ value ->format (\Magento \Framework \Stdlib \DateTime::DATETIME_PHP_FORMAT );
385
+ }
386
+
373
387
if (!$ this ->_attributes [$ attributeCode ]['is_static ' ]) {
374
388
/** @var $attribute \Magento\Customer\Model\Attribute */
375
389
$ attribute = $ this ->_customerModel ->getAttribute ($ attributeCode );
376
390
$ backendModel = $ attribute ->getBackendModel ();
377
- $ attributeParameters = $ this ->_attributes [$ attributeCode ];
378
-
379
- if ('select ' == $ attributeParameters ['type ' ]) {
380
- $ value = isset ($ attributeParameters ['options ' ][strtolower ($ value )])
381
- ? $ attributeParameters ['options ' ][strtolower ($ value )]
382
- : 0 ;
383
- } elseif ('datetime ' == $ attributeParameters ['type ' ]) {
384
- $ value = (new \DateTime ())->setTimestamp (strtotime ($ value ));
385
- $ value = $ value ->format (\Magento \Framework \Stdlib \DateTime::DATETIME_PHP_FORMAT );
386
- } elseif ($ backendModel ) {
391
+ if ($ backendModel
392
+ && $ attribute ->getFrontendInput () != 'select '
393
+ && $ attribute ->getFrontendInput () != 'datetime ' ) {
387
394
$ attribute ->getBackend ()->beforeSave ($ this ->_customerModel ->setData ($ attributeCode , $ value ));
388
395
$ value = $ this ->_customerModel ->getData ($ attributeCode );
389
396
}
0 commit comments