Hallo zusammen,
vorab als Info folgendes: Ich bin in einer neuen Firma und übernehme aktuell einen Shop eines ehemaligen Mitarbeiters.
Ich bin frisch mit der Ausbildung fertig und habe zuvor nie mit modified-shop gearbeitet.
Der Shop besteht zusammen gewürfelten aus verschiedenen modified-shop versionen, daher gebe ich hier die Version an, welche im Adminbereich unter "Infos" angegeben ist.
SHOP: v2.0.4.2 rev 11374 dated: 2018-07-23
DATENBANK: MOD_2.0.4.2
Ich arbeite an einer Kopie der Live-Version vom Shop auf meiner Lokalen Umgebung und nutze XAMPP.
Mein Ziel ist es, den Shop lauffähig für php8 zu machen, was ich bisher gut hinbekommen habe. Allerdings habe ich die Problematik im Adminbereich, dass ich beim versuchten löschen eines Artikels Ausgeloggt werde und somit auf die Login Seite(localhost/shop/login.php) verwiesen werde. Der Artikel wird auch nicht gelöscht bevor ich ausgeloggt werde.
Um genauer zu sein passiert das ganze beim bestätigen der Löschung("multi_delete_confirm" button).
Hier einmal der code zum multi_delete aus der categories_view.php(path: /shop/admin/include/modules/):
// multi_delete confirm // -------------------- if (xtc_not_null
($_POST['multi_delete'])) { $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ELEMENTS
. '</b>'); $contents[] = array('text' => '<a class="button" href="javascript:SwitchCheckDeleteConfirm()" onclick="this.blur()">' . BUTTON_REVERSE_SELECTION
. '</a>'); $contents[] = array('text' => '<table width="100%" border="0">'); if (is_array($_POST['multi_categories'])) { foreach ($_POST['multi_categories'] AS $multi_category) { $category_query = xtc_db_query
("SELECT c.categories_id,
cd.categories_name,
c.categories_image,
c.parent_id,
c.sort_order,
c.date_added,
c.last_modified,
c.categories_status
FROM " . TABLE_CATEGORIES
. " AS c,
" . TABLE_CATEGORIES_DESCRIPTION
. " AS cd
WHERE c.categories_id = '" . (int
)$multi_category . "'
AND c.categories_id = cd.categories_id
AND cd.language_id = '" . (int
)$_SESSION['languages_id'] . "'"); $category = xtc_db_fetch_array
($category_query); $category_childs = array('childs_count' => $catfunc->count_category_childs($multi_category)); $category_products = array('products_count' => $catfunc->count_category_products($multi_category, true)); $cInfo_array = xtc_array_merge
($category, $category_childs, $category_products); $cInfo = new objectInfo
($cInfo_array); $contents[] = array('text' => '<tr><td style="border-bottom: 1px solid #af417e; margin-bottom: 10px;" class="infoBoxContent"><b>' . $cInfo->categories_name . '</b></td></tr>'); if ($cInfo->childs_count > 0) { $contents[] = array('text' => '<tr><td class="infoBoxContent">' . sprintf(TEXT_DELETE_WARNING_CHILDS
, $cInfo->childs_count) . '</td></tr>'); } if ($cInfo->products_count > 0) { $contents[] = array('text' => '<tr><td class="infoBoxContent">' . sprintf(TEXT_DELETE_WARNING_PRODUCTS
, $cInfo->products_count) . '</td></tr>'); } } } if (is_array($_POST['multi_products'])) { foreach ($_POST['multi_products'] AS $multi_product) { $contents[] = array('text' => '<tr><td style="border-bottom: 1px solid #af417e; margin-bottom: 10px;" class="infoBoxContent"><b>' . xtc_get_products_name
($multi_product) . '</b></td></tr>'); $product_categories_string = ''; $product_categories = xtc_generate_category_path
($multi_product, 'product'); for ($i = 0, $n = sizeof($product_categories); $i < $n; $i++) { $category_path = ''; for ($j = 0, $k = sizeof($product_categories[$i]); $j < $k; $j++) { $category_path .= $product_categories[$i][$j]['text'] . ' > '; } $category_path = substr($category_path, 0, -16); $product_categories_string .= xtc_draw_checkbox_field
('multi_products_categories['.$multi_product.'][]', $product_categories[$i][sizeof($product_categories[$i])-1]['id'], true) . ' ' . $category_path . '<br />'; } $product_categories_string = substr($product_categories_string, 0, -4); $product_categories_string = '<tr><td class="infoBoxContent">' . $product_categories_string . '</td></tr>'; $contents[] = array('text' => $product_categories_string); } } //close list table $contents[] = array('text' => '</table>'); $contents[] = array('align' => 'center', 'text' => '<input class="button" type="submit" name="multi_delete_confirm" value="' . BUTTON_DELETE
. '"> <a class="button" href="' . xtc_href_link
(FILENAME_CATEGORIES
, xtc_get_all_get_params
(array('cPath', 'action', 'pID', 'cID')) . 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&cID=' . $cInfo->categories_id) . '">' . BUTTON_CANCEL
. '</a>'); } // multi_delete confirm ENDS Dazugehörig einmal der code aus der categries.php(path: /shop/admin/):
// --- MULTI DELETE --- if (isset ($_POST['multi_delete_confirm'])) { //delete multi_categories if (isset($_POST['multi_categories']) && is_array($_POST['multi_categories'])) { foreach ($_POST['multi_categories'] AS $category_id) { $catfunc->remove_categories($category_id); } } //delete multi_products if (isset($_POST['multi_products']) && is_array($_POST['multi_products']) && isset($_POST['multi_products_categories']) && is_array($_POST['multi_products_categories']) ) { foreach ($_POST['multi_products'] AS $product_id) { $catfunc->delete_product($product_id, $_POST['multi_products_categories'][$product_id]); } } } // --- MULTI DELETE ENDS --- Aufgefallen ist mir auf jeden fall schon einmal, dass der teil unter dem //delete multi_products (in categories.php) nicht aufgerufen wird, weiss aber nicht ganz wie ich weiter verfahren soll.
Eventuell hat ja jemand hier eine Idee o.ä.
VG Timo
Linkback: https://www.modified-shop.org/forum/index.php?topic=42888.0