A failed customer search offers the email erasure, which logs a deletion without deleting the customer account

Open
#261 0 comments 1 reaction 1 assignee View on GitHub

@mattgoud is already working on this.

Since Nov 9, 2026.

  • #262 by @mattgoud — open

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): the error callback of the SearchCustomers request only does console.log(err), so found keeps its initial false.
  • views/templates/admin/tabs/dataConfig.tpl: with found == 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.php deleteCustomer('email' | 'phone'): runs actionDeleteGDPRCustomer for the modules and writes a delete row with GDPRLog::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
  1. PrestaShop 9.x with psgdpr 1.4.4, a customer [email protected] exists.
  2. Back office > psgdpr > Personal data management, search [email protected].
  3. The search request answers 500, the page shows the "E-mail" card and the "no customer found" notice.
  4. Click "Remove data" on that card and confirm.
  5. ps_psgdpr_log has a delete row 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 the error callback, 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): for email, refuse the erasure when Customer::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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PrestaShop/psgdpr

All issues in PrestaShop/psgdpr

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.