Skip to content

Commit 4577722

Browse files
committed
Revert "AC-13335: Customer group code saved does not match the input when using multibyte characters"
This reverts commit 44fd77e.
1 parent d84a141 commit 4577722

File tree

5 files changed

+8
-538
lines changed

5 files changed

+8
-538
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
*/
1818
class Group extends \Magento\Framework\Model\AbstractModel
1919
{
20-
public const NOT_LOGGED_IN_ID = 0;
20+
const NOT_LOGGED_IN_ID = 0;
2121

22-
public const CUST_GROUP_ALL = 32000;
22+
const CUST_GROUP_ALL = 32000;
2323

24-
public const ENTITY = 'customer_group';
24+
const ENTITY = 'customer_group';
2525

26-
public const GROUP_CODE_MAX_LENGTH = 32;
26+
const GROUP_CODE_MAX_LENGTH = 32;
2727

2828
/**
2929
* Prefix of model events names
@@ -92,8 +92,6 @@ public function __construct(
9292
}
9393

9494
/**
95-
* Initialize model
96-
*
9795
* @return void
9896
*/
9997
protected function _construct()
@@ -174,7 +172,7 @@ public function beforeSave()
174172
*/
175173
protected function _prepareData()
176174
{
177-
$this->setCode(mb_substr($this->getCode(), 0, self::GROUP_CODE_MAX_LENGTH));
175+
$this->setCode(substr($this->getCode(), 0, self::GROUP_CODE_MAX_LENGTH));
178176
return $this;
179177
}
180178
}

app/code/Magento/Customer/Model/ResourceModel/Group.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ protected function _createCustomersCollection()
124124
protected function _beforeSave(\Magento\Framework\Model\AbstractModel $group)
125125
{
126126
/** @var \Magento\Customer\Model\Group $group */
127-
$group->setCode(mb_substr($group->getCode(), 0, $group::GROUP_CODE_MAX_LENGTH));
127+
$group->setCode(substr($group->getCode(), 0, $group::GROUP_CODE_MAX_LENGTH));
128128
return parent::_beforeSave($group);
129129
}
130130

app/code/Magento/Customer/Test/Unit/Model/GroupTest.php

Lines changed: 0 additions & 333 deletions
This file was deleted.

0 commit comments

Comments
 (0)