Skip to content

Commit 3b42fee

Browse files
committed
#145 - Fix Column 'state' in where clause is ambiguous
1 parent d2eed19 commit 3b42fee

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Model/Customer/CustomerChecker.php

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
namespace Opengento\Gdpr\Model\Customer;
99

1010
use Magento\Customer\Api\CustomerRepositoryInterface;
11+
use Magento\Framework\Exception\LocalizedException;
12+
use Magento\Framework\Exception\NoSuchEntityException;
1113
use Magento\Sales\Api\Data\OrderInterface;
1214
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory;
1315
use Opengento\Gdpr\Model\Config\Entity\Erasure as ErasureConfig;
@@ -21,6 +23,10 @@ public function __construct(
2123
private ErasureConfig $erasureConfig
2224
) {}
2325

26+
/**
27+
* @throws NoSuchEntityException
28+
* @throws LocalizedException
29+
*/
2430
public function canErase(int $entityId): bool
2531
{
2632
$customer = $this->customerRepository->getById($entityId);

Model/Order/SourceProvider/GuestFilterModifier.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function apply(AbstractDb $collection, WebsiteInterface $website): void
2222
$collection->addFieldToFilter(OrderInterface::CUSTOMER_ID, ['null' => true]);
2323
$collection->addFieldToFilter(OrderInterface::CUSTOMER_IS_GUEST, ['eq' => 1]);
2424
$collection->addFieldToFilter(
25-
OrderInterface::STATE,
25+
'main_table.' . OrderInterface::STATE,
2626
['in' => $this->erasureConfig->getAllowedStatesToErase($website->getId())]
2727
);
2828
}

0 commit comments

Comments
 (0)