Skip to content

Commit a1806e7

Browse files
committed
ACPT-1191: Fix Quote related issues on Application Server
1 parent 08c2a0f commit a1806e7

File tree

3 files changed

+32
-16
lines changed

3 files changed

+32
-16
lines changed

app/code/Magento/Config/Model/ResourceModel/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class Config extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb implem
2424
private $pillPut;
2525

2626
/**
27-
*
2827
* Define main table
28+
*
2929
* @param PoisonPillPutInterface|null $pillPut
3030
* @return void
3131
*/

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@
77

88
use Magento\Catalog\Api\Data\EavAttributeInterface;
99
use Magento\Framework\Api\AttributeValueFactory;
10-
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1110
use Magento\Framework\Stdlib\DateTime\DateTimeFormatterInterface;
12-
use Magento\Quote\Api\Data\AddressInterface;
1311

1412
/**
1513
* Customer attribute model
1614
*
1715
* @method int getSortOrder()
1816
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1917
*/
20-
class Attribute extends \Magento\Eav\Model\Attribute implements ResetAfterRequestInterface
18+
class Attribute extends \Magento\Eav\Model\Attribute
2119
{
2220
/**
2321
* Name of the module
@@ -223,14 +221,4 @@ public function __wakeup()
223221
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
224222
$this->indexerRegistry = $objectManager->get(\Magento\Framework\Indexer\IndexerRegistry::class);
225223
}
226-
227-
/**
228-
* @inheritDoc
229-
*/
230-
public function _resetState(): void
231-
{
232-
if ($this->getName() === AddressInterface::KEY_TELEPHONE) {
233-
$this->unsetData();
234-
}
235-
}
236224
}

app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute.php

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Magento\Framework\DB\Select;
1818
use Magento\Framework\Exception\CouldNotDeleteException;
1919
use Magento\Framework\Exception\LocalizedException;
20+
use Magento\Framework\MessageQueue\PoisonPill\PoisonPillPutInterface;
2021
use Magento\Framework\Model\AbstractModel;
2122
use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
2223
use Magento\Framework\Model\ResourceModel\Db\Context;
@@ -53,23 +54,32 @@ class Attribute extends AbstractDb
5354
*/
5455
private $config;
5556

57+
/**
58+
* @var PoisonPillPutInterface
59+
*/
60+
private $pillPut;
61+
5662
/**
5763
* Class constructor
5864
*
5965
* @param Context $context
6066
* @param StoreManagerInterface $storeManager
6167
* @param Type $eavEntityType
6268
* @param string $connectionName
69+
* @param PoisonPillPutInterface|null $pillPut
6370
* @codeCoverageIgnore
6471
*/
6572
public function __construct(
6673
Context $context,
6774
StoreManagerInterface $storeManager,
6875
Type $eavEntityType,
69-
$connectionName = null
76+
$connectionName = null,
77+
PoisonPillPutInterface $pillPut = null
7078
) {
7179
$this->_storeManager = $storeManager;
7280
$this->_eavEntityType = $eavEntityType;
81+
$this->pillPut = $pillPut ?: \Magento\Framework\App\ObjectManager::getInstance()
82+
->get(PoisonPillPutInterface::class);
7383
parent::__construct($context, $connectionName);
7484
}
7585

@@ -199,6 +209,24 @@ protected function _beforeSave(AbstractModel $object)
199209
return parent::_beforeSave($object);
200210
}
201211

212+
/**
213+
* @inheritDoc
214+
*/
215+
public function save(\Magento\Framework\Model\AbstractModel $object)
216+
{
217+
$this->pillPut->put();
218+
return parent::save($object);
219+
}
220+
221+
/**
222+
* @inheritDoc
223+
*/
224+
public function delete(\Magento\Framework\Model\AbstractModel $object)
225+
{
226+
$this->pillPut->put();
227+
return parent::delete($object);
228+
}
229+
202230
/**
203231
* @inheritdoc
204232
*
@@ -390,7 +418,7 @@ protected function _saveOption(AbstractModel $object)
390418
if ($object->getDefaultValue()) {
391419
$defaultValue[] = $object->getDefaultValue();
392420
}
393-
421+
394422
$this->_saveDefaultValue($object, $defaultValue);
395423
return $this;
396424
}

0 commit comments

Comments
 (0)