Commit 38853e89 authored by Dave Reid's avatar Dave Reid

#921644 by Dave Reid: Fixed sitemap arrays being passed to xmlsitemap_sitemap_save().

parent e9c91cb8
......@@ -218,10 +218,10 @@ function xmlsitemap_sitemap_edit_form_validate($form, &$form_state) {
function xmlsitemap_sitemap_edit_form_submit($form, &$form_state) {
form_state_values_clean($form_state);
xmlsitemap_sitemap_save($form_state['values']);
$sitemap = (object) $form_state['values'];
xmlsitemap_sitemap_save($sitemap);
drupal_set_message(t('The sitemap has been saved.'));
$form_state['redirect'] = 'admin/config/search/xmlsitemap';
// @todo If context was changed, needs to be regenerated.
}
function xmlsitemap_sitemap_delete_form(array $form, array &$form_state, stdClass $sitemap) {
......
......@@ -422,12 +422,14 @@ function xmlsitemap_update_6202() {
if (module_exists('xmlsitemap_i18n') && $languages = variable_get('xmlsitemap_languages', array())) {
foreach ($languages as $language) {
$sitemap = array('context' => array('language' => $language));
$sitemap = new stdClass();
$sitemap->context = array('language' => $language);
xmlsitemap_sitemap_save($sitemap);
}
}
else {
$sitemap = array('context' => array());
$sitemap = new stdClass();
$sitemap->context = array();
xmlsitemap_sitemap_save($sitemap);
}
}
......
......@@ -31,8 +31,11 @@ class XMLSitemapI18nWebTestCase extends XMLSitemapTestHelper {
// Create the two different language-context sitemaps.
db_query("DELETE FROM {xmlsitemap_sitemap}");
xmlsitemap_sitemap_save(array('context' => array('language' => 'en')));
xmlsitemap_sitemap_save(array('context' => array('language' => 'fr')));
$sitemap = new stdClass();
$sitemap->context = array('language' => 'en');
xmlsitemap_sitemap_save($sitemap);
$sitemap->context['language'] = 'fr';
xmlsitemap_sitemap_save($sitemap);
}
}
......
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