سؤال

We've recently upgraded a site from CE 1.5.0.1 to CE 1.7.0.2, and now all product pages just resolve to a 404 page. This applies for direct links, with the product-url.html after the domain, and also full canonical links. It also applies when we try to access the product by using the full /catalog/product/view/id/1000 URL.

There is, and I imagine its related, an issue with indexing on the site. There are 72k products so indexing is slow at best, but I've still been unable to get all indexes to complete without errors, and currently the Catalog URL Rewrites index is stuck on Processing.

We've tried truncating the core_url_rewrites table, and obviously reindexing everything. We've also created simple plain test products which also don't work.

.htaccess file matches the live, working site, is there anything else we may have missed?


I've now discovered that the product object is still available for me on the 404 page - weird huh? I can access all of the product data using Mage::registry('current_product');, this led me to look at the product view controller, and I discovered that commenting out Mage::dispatchEvent('catalog_controller_product_view', array('product' => $product)); showed the product page.

So I can only think that something is hooked onto this event and causing the page to die - obviously leaving this line commented out isn't a solution as its causing other issues with the product, but should point us in the right direction?

Any ideas would be greatly appreciated, there are no custom modules that listen for this event.


Thanks.

هل كانت مفيدة؟

المحلول

I had a problem that responded well to commenting out the line you suggest too.:

Mage::dispatchEvent('catalog_controller_product_view', array('product' => $product));

so this got me thinking to look for anything using that event, so i did a grep on app/code for catalog_controller_product_view

my results:

not, much, considering the first one is just that which has the line we commented. then i see something in Reports, and that jogs my memory... i didnt think it was necessary but i had emptied the report_* tables during a database merge, this must have been it,

so after restoring those tables from a backup its working again even with the line uncommented... !

نصائح أخرى

Looks like the table report_event_types is empty. If yes, run the following query and it will work.

    CREATE TABLE IF NOT EXISTS `report_event_types` (
  `event_type_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Event Type Id',
  `event_name` varchar(64) NOT NULL COMMENT 'Event Name',
  `customer_login` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Customer Login',
  PRIMARY KEY (`event_type_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Reports Event Type Table' AUTO_INCREMENT=7 ;



INSERT INTO `report_event_types` (`event_type_id`, `event_name`, `customer_login`) VALUES
(1, 'catalog_product_view', 0),
(2, 'sendfriend_product', 0),
(3, 'catalog_product_compare_add_product', 0),
(4, 'checkout_cart_add_product', 0),
(5, 'wishlist_add_product', 0),
(6, 'wishlist_share', 0);

Thanks !!! I had the same problem after a reindex crash ! All product pages returned 404 error page !!

So i opened Mage_Reports_Model_Event_Observer and added a

return true;

In the begening of this observer method:

public function catalogProductView(Varien_Event_Observer $observer)

And it worked !!

You saved my day/life !!

For more better use, go to system->configuration->reports->general and change the setting for enabling report. Switch to No and your problem will be solved.

i have the same problem but now it's solved. I hope my experience can help others who have the same issue.

After truncated some log tables in database yesterday, all product detail pages were blank, not any errors, other pages works well. my hosting simplehelix disabled Compilation, pages loaded but all product pages returned to 404 page. simplehelix was not helpful at all, after 2 hours they asked me to pay 25usd to restore my site. today i searched in google and checked the exception.log and found the error, report_event table not exist, so i copied this table to the database, everything works well now. I also noticed that the privious database had report_event_types table, but after i imported report_event table, this table disappeared, i don't know why.

I also face same error 404 not found. I checked the exception.log and found the error:

main.CRITICAL: exception 'Magento\Framework\Exception\LocalizedException' with message 'Object DOMDocument should be created.' in C:\xampp\htdocs\camptest\vendor\magento\framework\View\Element\UiComponent\Config\DomMerger.php:408

One of my custom module was overriding catalog_product, so it includes catalog_product_price.xml in layout directory. but there was no block and other dependent things which I have declared in xml file. So I created each block, clear static content, upgrade the setup, clear the cache and it start working.

This error was also logged in system.log file also with more clarity of error.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top