In order to rectify this issue, in your admin/controller/cron/gdpr.php file,
replace the entire file with the following, instead:
Code: Select all
<?php
class ControllerCronGdpr extends Controller {
public function index($cron_id, $code, $cycle, $date_added, $date_modified) {
$this->load->model('customer/gdpr');
$this->model_customer_gdpr->deleteExpiredCustomers();
}
}
find:
Code: Select all
public function deleteGdpr($customer_id) {
$this->db->query("DELETE FROM `" . DB_PREFIX . "customer_gdpr` WHERE customer_id = '" . (int)$customer_id . "'");
}
Code: Select all
public function deleteExpiredCustomers() {
$expiry = (time() - 60 * 60 * 24 * (int)$this->config->get('config_gdpr_limit'));
$this->db->query("DELETE FROM `" . DB_PREFIX . "customer`, `" . DB_PREFIX . "customer_gdpr` USING `customer`,`customer_gdpr` WHERE `customer_gdpr`.`customer_id` = `customer`.`customer_id` AND UNIX_TIMESTAMP(`customer_gdpr`.`date_added`) < '" . (int)$expiry . "' AND `customer_gdpr`.`status` = '1'");
}