Commit c04bc250 authored by Dave Reid's avatar Dave Reid

#562940 by Dave Reid: Added a requirements check if there is an existing...

#562940 by Dave Reid: Added a requirements check if there is an existing sitemap.xml file in the website root that will not allow the module to work.
parent 12a9af32
......@@ -561,7 +561,7 @@ function xmlsitemap_update_6150() {
function xmlsitemap_update_6151() {
$ret = array();
db_add_index($ret, 'xmlsitemap', 'type_id', array('type', 'id'));
return $ret;
return $ret;
}
/**
......@@ -577,11 +577,11 @@ function xmlsitempa_update_6152() {
/**
* Implementation of hook_requirements().
*/
function xmlsmitemap_requirements($phase) {
function xmlsitemap_requirements($phase) {
$requirements = array();
$path = drupal_get_path('module', 'xmlsitemap');
if (is_dir($path . '/xmlsitemap')) {
$t = get_t();
$t = get_t();
if (is_dir(drupal_get_path('module', 'xmlsitemap') . '/xmlsitemap')) {
watchdog('xmlsitemap', 'You have not correctly followed the installation instructions for this module. You must make certain that the old xmlsitemap/xmlsitemap diretory is removed. The xmlsitemap/xmlsitemap/xmlsitemap.* files have been moved back to the modules root directory. The install instructions were to removed the modules/xmlsitemap directory completely before extracting the update. If you had followed that step you would have prevented this message.', NULL, WATCHDOG_ERROR);
$requirements['xmlsitemap'] = array(
'title' => $t('xmlsitemap'),
......@@ -590,6 +590,14 @@ function xmlsmitemap_requirements($phase) {
'severity' => REQUIREMENT_ERROR,
);
}
if (variable_get('clean_url', 0) && file_exists('./sitemap.xml')) {
$requirements['xmlsitemap_file'] = array(
'title' => $t('XML sitemap'),
'value' => $t('Existing sitemap.xml file found.'),
'severity' => REQUIREMENT_ERROR,
'description' => $t('The XML sitemap module cannot display its XML output if there is an existing sitemap.xml file in your website root.'),
);
}
return $requirements;
}
......@@ -600,4 +608,3 @@ function xmlsitemap_uninstall() {
drupal_uninstall_schema('xmlsitemap');
db_query("DELETE FROM {variable} WHERE name LIKE 'xmlsitemap\_%'");
}
Markdown is supported
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