fix(kundencenter): SQL-Fatal beim Adresse speichern (leerer parent_id)
- main_widget_menu_2: !empty statt isset, sonst 'parent_id in(10636,)' - add_address: exit nach dem Location-Header - get_this_url: leere Parameter nicht anhaengen
This commit is contained in:
@@ -155,10 +155,12 @@ class website {
|
||||
function main_widget_menu_2() {
|
||||
$structure_object = new Structure($this->base_object);
|
||||
$selected_ids = array();
|
||||
if (isset($_GET['menu_id'])) {
|
||||
// 22.09.2026: !empty statt isset -- das Kundencenter postet auf "...&parent_id=" (leer),
|
||||
// isset war dann wahr und get_all_tree() baute "parent_id in(10636,)" -> SQL-Fatal.
|
||||
if (!empty($_GET['menu_id'])) {
|
||||
$selected_ids[] = $_GET['menu_id'];
|
||||
}
|
||||
if (isset($_GET['parent_id'])) {
|
||||
if (!empty($_GET['parent_id'])) {
|
||||
$selected_ids[] = $_GET['parent_id'];
|
||||
}
|
||||
$data = $structure_object->get_all_tree(5, $selected_ids, $this->base_object->customer_group->id);
|
||||
|
||||
@@ -250,6 +250,8 @@ class website_customercenter {
|
||||
}
|
||||
|
||||
header('location: ' . $_SERVER["HTTP_REFERER"]);
|
||||
// 22.09.2026: nach dem Redirect nicht weiterrendern (lief sonst in die Widgets und den SQL-Fatal).
|
||||
exit();
|
||||
}
|
||||
|
||||
private function edit_base_data($customer_id) {
|
||||
@@ -332,7 +334,12 @@ class website_customercenter {
|
||||
$base_url .= ':' . $_SERVER['SERVER_PORT'];
|
||||
}
|
||||
|
||||
return $base_url . '/index.php?menu_id=' . $_GET['menu_id'] . '&parent_id=' . $_GET['parent_id'];
|
||||
// 22.09.2026: leere Parameter nicht anhaengen (Seite kommt per short_uri /Kundencenter/ ohne parent_id).
|
||||
$url = $base_url . '/index.php?menu_id=' . (int) ($_GET['menu_id'] ?? 0);
|
||||
if (!empty($_GET['parent_id'])) {
|
||||
$url .= '&parent_id=' . (int) $_GET['parent_id'];
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
private function get_invoice_pdf() {
|
||||
|
||||
Reference in New Issue
Block a user