Sitemap突然停止生成 开始显示“无法创建XML站点地图。” 请帮忙
答案 0 :(得分:3)
快速解决问题。
我在这里使用fishpig扩展。
观察到fishpig覆盖了magento核心站点地图控制器
所以添加了以下代码:/app/code/community/Fishpig/Wordpress/controllers/Adminhtml/SitemapController.php
在以下之前添加此代码:
$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.'));
}
希望能帮助遇到相同问题的人。
礼貌:lukecollymore