Opened 3 years ago

Closed 3 years ago

#1536 closed Bug/Fehler (fixed)

Memory Limit überschritten in admin/mail.php

Reported by: vr Owned by: somebody
Priority: normal Milestone: modified-shop-2.0.5.0
Component: Admin Version: 2.0.4.2

Description (last modified by vr)

Die admin/mail.php überschreitet das memory limit, wenn der shop eine große Anzahl Kunden hat, bei meinen Tests ab 100000 Kunden. Das ist natürlich konfigurationsabhängig, sollte aber trotzdem nicht datenabhängig ein Limit erreichen.

Versendet man aus dem Adminbereich eine Mail an einen ausgewählten Kunden (über die Kundenliste), so wird neben den Kundengruppen die gesamte Kundentabelle abgefragt und ins Dropdown des Mailformulars übertragen.

Da der Kunde bereits ausgewählt ist, sollte dessen Mailadresse (sofern sie übergeben wurde) an dieser Stelle als Filter benutzt werden - und sonst keine weitere Liste für $customers erzeugen. Zeile 207, statt

// End customers Status 1.x
$mail_query = xtc_db_query("select customers_email_address, customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " order by customers_lastname");
while($customers_values = xtc_db_fetch_array($mail_query)) {
  $customers[] = array('id' => $customers_values['customers_email_address'],
                                   'text' => $customers_values['customers_lastname'] . ', ' . $customers_values['customers_firstname'] . ' (' . $customers_values['customers_email_address'] . ')');
}

zb so:

// End customers Status 1.x
$selected_customer = isset($_GET['customer']) ? $_GET['customer'] : $_POST['customers_email_address'];
if (!empty($selected_customer)) {
  $mail_query = xtc_db_query("select customers_email_address, customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " 
                where customers_email_address = '$selected_customer'
                order by customers_lastname");
  while($customers_values = xtc_db_fetch_array($mail_query)) {
    $customers[] = array('id' => $customers_values['customers_email_address'],
                                     'text' => $customers_values['customers_lastname'] . ', ' . $customers_values['customers_firstname'] . ' (' . $customers_values['customers_email_address'] . ')');
  }
}  

Attachments (0)

Change History (4)

comment:1 Changed 3 years ago by Tomcraft

  • Milestone set to modified-shop-2.0.5.0
  • Version set to 2.0.4.2

comment:2 Changed 3 years ago by vr

  • Description modified (diff)

comment:3 Changed 3 years ago by vr

  • Description modified (diff)

comment:4 Changed 3 years ago by GTB

  • Resolution set to fixed
  • Status changed from new to closed

In 11769:

fix #1536

Add Comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.