Skip to content

Commit 488cd04

Browse files
committed
Merge pull request #603 from magento-south/BUGS
[South] Bug fixes
2 parents 4cc81e9 + 1252b9c commit 488cd04

File tree

10 files changed

+90
-11
lines changed

10 files changed

+90
-11
lines changed

app/code/Magento/Customer/Api/Data/CustomerInterface.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface CustomerInterface extends \Magento\Framework\Api\CustomAttributesDataI
1616
const ID = 'id';
1717
const CONFIRMATION = 'confirmation';
1818
const CREATED_AT = 'created_at';
19+
const UPDATED_AT = 'updated_at';
1920
const CREATED_IN = 'created_in';
2021
const DOB = 'dob';
2122
const EMAIL = 'email';
@@ -137,6 +138,23 @@ public function getCreatedAt();
137138
*/
138139
public function setCreatedAt($createdAt);
139140

141+
/**
142+
* Get updated at time
143+
*
144+
* @api
145+
* @return string|null
146+
*/
147+
public function getUpdatedAt();
148+
149+
/**
150+
* Set updated at time
151+
*
152+
* @api
153+
* @param string $updatedAt
154+
* @return $this
155+
*/
156+
public function setUpdatedAt($updatedAt);
157+
140158
/**
141159
* Get created in area
142160
*

app/code/Magento/Customer/Block/Form/Login.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(
4040
array $data = []
4141
) {
4242
parent::__construct($context, $data);
43-
$this->_isScopePrivate = true;
43+
$this->_isScopePrivate = false;
4444
$this->_customerUrl = $customerUrl;
4545
$this->_customerSession = $customerSession;
4646
}

app/code/Magento/Customer/Block/Form/Register.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function __construct(
6363
$countryCollectionFactory,
6464
$data
6565
);
66-
$this->_isScopePrivate = true;
66+
$this->_isScopePrivate = false;
6767
}
6868

6969
/**

app/code/Magento/Customer/Model/Data/Customer.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
/**
1212
* Class Customer
13-
*
13+
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
1414
*/
1515
class Customer extends \Magento\Framework\Api\AbstractExtensibleObject implements
1616
\Magento\Customer\Api\Data\CustomerInterface
@@ -97,6 +97,16 @@ public function getCreatedIn()
9797
return $this->_get(self::CREATED_IN);
9898
}
9999

100+
/**
101+
* Get updated at time
102+
*
103+
* @return string|null
104+
*/
105+
public function getUpdatedAt()
106+
{
107+
return $this->_get(self::UPDATED_AT);
108+
}
109+
100110
/**
101111
* Get date of birth
102112
*
@@ -313,6 +323,17 @@ public function setCreatedAt($createdAt)
313323
return $this->setData(self::CREATED_AT, $createdAt);
314324
}
315325

326+
/**
327+
* Set updated at time
328+
*
329+
* @param string $updatedAt
330+
* @return $this
331+
*/
332+
public function setUpdatedAt($updatedAt)
333+
{
334+
return $this->setData(self::UPDATED_AT, $updatedAt);
335+
}
336+
316337
/**
317338
* Set created in area
318339
*

app/code/Magento/Customer/Setup/UpgradeData.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,23 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
210210
];
211211
$this->upgradeAttributes($entityAttributes, $customerSetup);
212212
}
213+
214+
if (version_compare($context->getVersion(), '2.0.4', '<')) {
215+
$customerSetup->addAttribute(
216+
Customer::ENTITY,
217+
'updated_at',
218+
[
219+
'type' => 'static',
220+
'label' => 'Updated At',
221+
'input' => 'date',
222+
'required' => false,
223+
'sort_order' => 87,
224+
'visible' => false,
225+
'system' => false,
226+
]
227+
);
228+
}
229+
213230
$indexer = $this->indexerRegistry->get(Customer::CUSTOMER_GRID_INDEXER_ID);
214231
$indexer->reindexAll();
215232
$this->eavConfig->clear();

app/code/Magento/Customer/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
9-
<module name="Magento_Customer" setup_version="2.0.3">
9+
<module name="Magento_Customer" setup_version="2.0.4">
1010
<sequence>
1111
<module name="Magento_Eav"/>
1212
<module name="Magento_Directory"/>

app/code/Magento/Deploy/Model/Deployer.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,29 @@ public function deploy(ObjectManagerFactory $omFactory, array $locales)
114114
$this->output->writeln("=== {$area} -> {$themePath} -> {$locale} ===");
115115
$this->count = 0;
116116
$this->errorCount = 0;
117+
118+
/** @var \Magento\Theme\Model\View\Design $design */
119+
$design = $this->objectManager->create('Magento\Theme\Model\View\Design');
120+
$design->setDesignTheme($themePath, $area);
121+
$fileManager = $this->objectManager->create(
122+
'Magento\RequireJs\Model\FileManager',
123+
[
124+
'config' => $this->objectManager->create(
125+
'Magento\Framework\RequireJs\Config',
126+
[
127+
'assetRepo' => $this->objectManager->create(
128+
'Magento\Framework\View\Asset\Repository',
129+
[
130+
'design' => $design,
131+
]
132+
),
133+
'design' => $design,
134+
]
135+
),
136+
]
137+
);
138+
$fileManager->createRequireJsConfigAsset();
139+
117140
foreach ($appFiles as $info) {
118141
list($fileArea, $fileTheme, , $module, $filePath) = $info;
119142
if (($fileArea == $area || $fileArea == 'base') &&

app/code/Magento/Deploy/composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"magento/framework": "1.0.0-beta",
77
"magento/module-developer": "1.0.0-beta",
88
"magento/module-store": "1.0.0-beta",
9+
"magento/module-theme": "1.0.0-beta",
10+
"magento/module-require-js": "1.0.0-beta",
911
"magento/magento-composer-installer": "*"
1012
},
1113
"type": "magento2-module",

dev/tests/integration/testsuite/Magento/Customer/Model/AccountManagementTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ protected function tearDown()
136136
public function testLogin()
137137
{
138138
// Customer email and password are pulled from the fixture customer.php
139-
$customer = $this->accountManagement->authenticate('customer@example.com', 'password', true);
139+
$customer = $this->accountManagement->authenticate('customer@example.com', 'password');
140140

141141
$this->assertSame('customer@example.com', $customer->getEmail());
142142
}
@@ -150,7 +150,7 @@ public function testLogin()
150150
public function testLoginWrongPassword()
151151
{
152152
// Customer email and password are pulled from the fixture customer.php
153-
$this->accountManagement->authenticate('customer@example.com', 'wrongPassword', true);
153+
$this->accountManagement->authenticate('customer@example.com', 'wrongPassword');
154154
}
155155

156156
/**
@@ -160,7 +160,7 @@ public function testLoginWrongPassword()
160160
public function testLoginWrongUsername()
161161
{
162162
// Customer email and password are pulled from the fixture customer.php
163-
$this->accountManagement->authenticate('non_existing_user', 'password', true);
163+
$this->accountManagement->authenticate('non_existing_user', 'password');
164164
}
165165

166166
/**
@@ -606,8 +606,7 @@ public function testCreateNonexistingCustomer()
606606
$this->assertEquals('Admin', $customerAfter->getCreatedIn());
607607
$this->accountManagement->authenticate(
608608
$customerAfter->getEmail(),
609-
'aPassword',
610-
true
609+
'aPassword'
611610
);
612611
$attributesBefore = $this->extensibleDataObjectConverter->toFlatArray(
613612
$existingCustomer,
@@ -716,7 +715,6 @@ public function testCreateCustomerInServiceVsInModel()
716715
}
717716
$this->assertEquals($email2, $dataInService['email']);
718717
$this->assertArrayNotHasKey('is_active', $dataInService);
719-
$this->assertArrayNotHasKey('updated_at', $dataInService);
720718
$this->assertArrayNotHasKey('password_hash', $dataInService);
721719
}
722720

dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function testGetCustomAttributesMetadataWithAttributeNamedCustomAttribute
9393
public function testGetCustomerAttributeMetadata()
9494
{
9595
// Expect these attributes to exist but do not check the value
96-
$expectAttrsWOutVals = ['created_at'];
96+
$expectAttrsWOutVals = ['created_at', 'updated_at'];
9797

9898
// Expect these attributes to exist and check the value - values come from _files/customer.php
9999
$expectAttrsWithVals = [

0 commit comments

Comments
 (0)