I can now replicate this problem so I now think I know the cause.
If a product has been copied (linked) from one category to another and it is decided to delete the product from the master category but not from the secondary category then in Admin
Catalog>Categories/Products>Master Category>Product
if you click on the delete button (red x) you are then given a choice of which copy of the product you wish to delete. If you choose to delete the copy in the Master Category (tick the box) but not the copy in the secondary category (un-tick the box) and then click 'Delete' the copy of your product in the Master Category will be deleted but the copy in the secondary category will still be there. If you now go to the secondary category and try to edit it you will get the following error:
Code:
Warning: reset(): Passed variable is not an array or object in /home/1256/tester/rcm.testingit.net/public_html/admin/includes/classes/object_info.php on line 29
Warning: Variable passed to each() is not an array or object in /home/1256/tester/rcm.testingit.net/public_html/admin/includes/classes/object_info.php on line 30
and none of your product details will appear in the edit product screen.
Fortunately the product will still appear in the catalog and customers will still be able to purchase it.
In the database you will find that in the 'products' table the 'master_categories_id' is set to the categories_id of the category the product has just been deleted from whereas in the products_to_categories table you will find that the products_id is only linked to the secondary categories_id, the entry linking the product to the master categories_id having been deleted by the above action.
Changing the master_categories_id in the products table to match the categories_id linked to the product_id in the products_to_categories table does not solve the problem. Neither does resetting all Products Master Categories and Products Price Sorter in the Store Manager which in essence does the same thing.
I know that the above action should not be carried out - and there are plenty of warnings in big red letters - but that hasn't stopped my client!
Anyone any idea how to put this right?
Regards,
Alan
Bookmarks