All categories and products are deleted after deleting a category or product.
Cause: This problem was found when the browser's BACK button is used to return to the product list after deleting a product or category. After backing up pages, "categories_id" is set to 0 which is the catalog's root location.
Fix: I wrote a simple check to make sure you can never delete the entire catalog in one action. ($categories_id can never equal 0)
** FILE: catalog/admin/categories.php
** FIND code beginning with...
case 'delete_category_confirm':
if (isset($HTTP_POST_VARS['categories_id'])) {
$categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);
** ADD immediately AFTER with this code...
// BEGIN Prevent categories_id = 0
if($categories_id == 0) {
tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));
break;
}
// END Prevent categories_id = 0
** SAVE the file and you are finished!
Top 4 Download periodically updates information of Fix for admin catalog - delete products issue script from the developer, but some information may be slightly out-of-date.
Our script download links are directly from our mirrors or publisher's website. Fix for admin catalog - delete products issue torrent files or shared files from free file sharing and free upload services, including Rapidshare, MegaUpload, YouSendIt, MailBigFile, DropSend, HellShare, HotFile, FileServe, MediaMax, zUpload, MyOtherDrive, SendSpace, DepositFiles, Letitbit, LeapFile, DivShare or MediaFire, are not allowed!