Question

Sitemap stopped generating suddenly.
Started displaying 'Unable to create XML sitemap.'
Please help

Was it helpful?

Solution

A quick fix to it .
Here I am using fishpig extension .
Observed that fishpig is overridding magento core sitemap controller .
So added the following code : /app/code/community/Fishpig/Wordpress/controllers/Adminhtml/SitemapController.php

Add this code before :

$this->_redirectReferer();


$id = $this->getRequest()->getParam('sitemap_id');
        $sitemap = Mage::getModel('sitemap/sitemap');
        /* @var $sitemap Mage_Sitemap_Model_Sitemap */
        $sitemap->load($id);
        // if sitemap record exists
        if ($sitemap->getId()) {
            try {
                $sitemap->generateXml();

                $this->_getSession()->addSuccess(
                    Mage::helper('sitemap')->__('The sitemap "%s" has been generated.', $sitemap->getSitemapFilename()));
            }
            catch (Mage_Core_Exception $e) {
                $this->_getSession()->addError($e->getMessage());
            }
            catch (Exception $e) {
                $this->_getSession()->addException($e,
                    Mage::helper('sitemap')->__('Unable to generate the sitemap.'));
            }
        } else {
            $this->_getSession()->addError(
                Mage::helper('sitemap')->__('Unable to find a sitemap to generate.'));
        }

Hope it helps someone experiencing with same issue .

Courtesy : lukecollymore

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top