Skip to content
Snippets Groups Projects
Commit 51a5de8a authored by Ghislain Loas's avatar Ghislain Loas
Browse files

hotline #43264 fix error in sitemap batch

parent 17b2544e
Branches
Tags
1 merge request!1673Hotline#43264 batch sitemap error
- ticket #43264 : Cosmogramme : Correction du batch de génération de sitemap
\ No newline at end of file
......@@ -19,15 +19,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Batch_BuildSiteMap extends Class_Batch_Abstract {
const TYPE = 'BUILD_SITE_MAP';
public function getLabel() {
return $this->_('Régénère le sitemap XML');
}
public function run() {
$router = Zend_Controller_Front::getInstance()->getRouter();
$router->route(new ZendAfi_Controller_Request_Http(Zend_Uri_Http::fromString(Class_Url::rootUrl())));
$sitemap = new Class_Sitemap();
$profiles = $this->sitemapProfiles();
......@@ -44,6 +47,7 @@ class Class_Batch_BuildSiteMap extends Class_Batch_Abstract {
$sitemap->save();
}
protected function sitemapProfiles() {
$profiles = Class_Profil::findAll();
$sitemap_profiles = [];
......
......@@ -174,6 +174,10 @@ class BatchBuildSitemapTest extends Storm_Test_ModelTestCase {
protected $_profiles;
public function setUp() {
parent::setup();
Zend_Controller_Front::getInstance()->setRouter(new ZendAfi_Controller_Router_RewriteWithoutBaseUrl());
$this->_profiles[1] = $this->fixture('Class_Profil', ['id' => 1,
'libelle' => 'Portail',
'cfg_accueil' => ZendAfi_Filters_Serialize::serialize(['sitemap' => 1])]);
......@@ -200,7 +204,6 @@ class BatchBuildSitemapTest extends Storm_Test_ModelTestCase {
Class_Sitemap::setFileSystem($this->_file_system);
$this->fixture('Class_AdminVar', ['id' => 'NOM_DOMAINE',
'clef' => 'NOM_DOMAINE',
'valeur' => 'http://wiki.bokeh-library-portal.org']);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment