A failed customer search offers the email erasure, which logs a deletion without deleting the customer account
Assessment
This issue has not been assessed yet.
Description
Description
When the customer search of "Personal data management" fails, the page treats the failure as "no customer found". For an email or a phone number, it then offers to continue the erasure without a customer account. Confirming that erasure logs a deletion in psgdpr_log while the customer account, its addresses and carts are left in place.
views/js/back.js(searchCustomers): theerrorcallback of theSearchCustomersrequest only doesconsole.log(err), sofoundkeeps its initialfalse.views/templates/admin/tabs/dataConfig.tpl: withfound == false, the "E-mail" (or "Phone") card is shown with its "Remove data" button, next to the notice that no customer was found and that "you can continue the erasure process for this address".psgdpr.phpdeleteCustomer('email' | 'phone'): runsactionDeleteGDPRCustomerfor the modules and writes adeleterow withGDPRLog::addLog(), nothing on the PrestaShop side.
The merchant ends up with an erasure recorded for a person whose account still exists.
On PrestaShop 9.x with psgdpr 1.4.4 or earlier, the search always fails (ajaxDie() fatal, #245), so every email search goes down this path. #256 removes that fatal on the 1.4.5 branch, but any other failure of the search (500, expired employee session, invalid token, timeout) still leads to the same result.
Reported by @seederp2p in https://github.com/PrestaShop/psgdpr/issues/245#issuecomment-6746256982, checked against the 1.4.5 branch.
Steps to reproduce
- PrestaShop 9.x with psgdpr 1.4.4, a customer
[email protected]exists. - Back office > psgdpr > Personal data management, search
[email protected]. - The search request answers 500, the page shows the "E-mail" card and the "no customer found" notice.
- Click "Remove data" on that card and confirm.
ps_psgdpr_loghas adeleterow for[email protected], the customer still exists in Customers > Customers.
On the 1.4.5 branch, the same happens if the search request fails for any other reason (for instance, make ajaxProcessSearchCustomers throw).
Expected behavior
A failed search shows an error and offers no erasure. The email/phone erasure is only offered when the search actually answered that no customer matches.
Additional information
Possible directions for 1.4.5:
back.js: in theerrorcallback, set an error state and show an error message; hide the email/phone cards and the "continue the erasure" notice while it is set, and reset it on the next search.deleteCustomer()(defence in depth): foremail, refuse the erasure whenCustomer::getCustomersByEmail()returns an account, so the log can never claim a deletion the shop did not do.
- Dominant language
- JavaScript
- Stars
- 34
- Forks
- 77
- Avg merge
- 12h 50m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PrestaShop/psgdpr
-
[BUG] Deprecated: sha1(): Passing null to parameter #1 ($string) of type string is deprecated in psgdpr/psgdpr.php on line 701Possibly taken @boo-code claimed this 66 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PrestaShop/psgdpr#239 · 5 comments ·
-
[BUG] PHP Deprecated: sha1(): Passing null to parameter #1 ($string) of type string is deprecatedPossibly taken @boo-code claimed this 66 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
PrestaShop/psgdpr#236 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
PrestaShop/psgdpr#263 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
PrestaShop/psgdpr#260 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
PrestaShop/psgdpr#259 ·
All issues in PrestaShop/psgdpr
Similar issues
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
0xPolygon/polygon-token-list#851 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cline/mcp-marketplace#4171 ·
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Add a languageOpengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100