Commit 9156167e authored by Dave Reid's avatar Dave Reid
Browse files

by Dave Reid: Convert to using objects for XML sitemaps instead of arrays.

parent b3d12466
......@@ -171,7 +171,7 @@ function hook_xmlsitemap_sitemap_operations() {
* sitemap has been removed from the table in the database.
*
* @param $sitemap
* The XML sitemap array that was deleted.
* The XML sitemap object that was deleted.
*/
function hook_xmlsitemap_sitemap_delete(stdClass $sitemap) {
db_query("DELETE FROM {mytable} WHERE smid = '%s'", $sitemap->smid);
......
......@@ -366,7 +366,7 @@ function xmlsitemap_update_last_removed() {
* Create the {xmlsitemap_sitemap} table and add the sitemap context data.
*/
function xmlsitemap_update_6202() {
if (db_table_exists('xmlsitemap_sitemap')) {
if (!db_table_exists('xmlsitemap_sitemap')) {
$schema['xmlsitemap_sitemap'] = array(
'fields' => array(
'smid' => array(
......
......@@ -46,20 +46,19 @@ class XMLSitemapEnginesFunctionalTest extends XMLSitemapTestHelper {
}
function testSubmitSitemaps() {
$sitemaps = array(
array(
'uri' => array(
'path' => 'http://example.com/sitemap.xml',
'options' => array(),
),
),
array(
'uri' => array(
'path' => 'http://example.com/sitemap-2.xml',
'options' => array(),
),
),
$sitemaps = array();
$sitemap = new stdClass();
$sitemap->uri = array(
'path' => 'http://example.com/sitemap.xml',
'options' => array(),
);
$sitemaps[] = $sitemap;
$sitemap = new stdClass();
$sitemap->uri = array(
'path' => 'http://example.com/sitemap-2.xml',
'options' => array(),
);
$sitemaps[] = $sitemap;
xmlsitemap_engines_submit_sitemaps($this->submit_url, $sitemaps);
$this->assertWatchdogMessage(array('type' => 'xmlsitemap', 'message' => 'Recieved ping for @sitemap.', 'variables' => array('@sitemap' => 'http://example.com/sitemap.xml')));
......
......@@ -110,7 +110,7 @@ function xmlsitemap_engines_submit_access() {
*/
function xmlsitemap_engines_submit_engines(array $smids = array()) {
if (empty($smids)) {
$smids = db_query("SELECT smid FROM {xmlsitemap_sitemap}")->fetchCol();
$smids = FALSE;
}
$sitemaps = xmlsitemap_sitemap_load_multiple($smids);
......
......@@ -40,7 +40,7 @@ function xmlsitemap_i18n_form_xmlsitemap_sitemap_edit_form_alter(&$form, $form_s
'#type' => 'select',
'#title' => t('Language'),
'#options' => locale_language_list(),
'#default_value' => isset($form['#sitemap']['context']['language']) ? $form['#sitemap']['context']['language'] : LANGUAGE_NONE,
'#default_value' => isset($form['#sitemap']->context['language']) ? $form['#sitemap->context['language'] : LANGUAGE_NONE,
);
}
......
Supports Markdown
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