Commit a651a346 authored by Dave Reid's avatar Dave Reid
Browse files

by Dave Reid: Renamed xmlsitemap_update_links() to...

by Dave Reid: Renamed xmlsitemap_update_links() to xmlsitemap_link_update_multiple() for consistency.
parent 76e709e9
...@@ -677,7 +677,7 @@ function xmlsitemap_link_save(array $link) { ...@@ -677,7 +677,7 @@ function xmlsitemap_link_save(array $link) {
* @return * @return
* The number of links that were updated. * The number of links that were updated.
*/ */
function xmlsitemap_update_links($updates = array(), $conditions = array()) { function xmlsitemap_link_update_multiple($updates = array(), $conditions = array()) {
// If we are going to modify a visible sitemap link, we will need to set // If we are going to modify a visible sitemap link, we will need to set
// the regenerate needed flag. // the regenerate needed flag.
if (!variable_get('xmlsitemap_regenerate_needed', FALSE)) { if (!variable_get('xmlsitemap_regenerate_needed', FALSE)) {
...@@ -1088,10 +1088,10 @@ function xmlsitemap_link_bundle_settings_save($entity, $bundle, array $settings, ...@@ -1088,10 +1088,10 @@ function xmlsitemap_link_bundle_settings_save($entity, $bundle, array $settings,
if ($update_links) { if ($update_links) {
$old_settings = xmlsitemap_link_bundle_load($entity, $bundle); $old_settings = xmlsitemap_link_bundle_load($entity, $bundle);
if ($settings['status'] != $old_settings['status']) { if ($settings['status'] != $old_settings['status']) {
xmlsitemap_update_links(array('status' => $settings['status']), array('type' => $entity, 'subtype' => $bundle, 'status_override' => 0)); xmlsitemap_link_update_multiple(array('status' => $settings['status']), array('type' => $entity, 'subtype' => $bundle, 'status_override' => 0));
} }
if ($settings['priority'] != $old_settings['priority']) { if ($settings['priority'] != $old_settings['priority']) {
xmlsitemap_update_links(array('priority' => $settings['priority']), array('type' => $entity, 'subtype' => $bundle, 'priority_override' => 0)); xmlsitemap_link_update_multiple(array('priority' => $settings['priority']), array('type' => $entity, 'subtype' => $bundle, 'priority_override' => 0));
} }
} }
...@@ -1105,7 +1105,7 @@ function xmlsitemap_link_bundle_rename($entity, $bundle_old, $bundle_new) { ...@@ -1105,7 +1105,7 @@ function xmlsitemap_link_bundle_rename($entity, $bundle_old, $bundle_new) {
$settings = xmlsitemap_link_bundle_load($entity, $bundle_old); $settings = xmlsitemap_link_bundle_load($entity, $bundle_old);
variable_del("xmlsitemap_settings_{$entity}_{$bundle_old}"); variable_del("xmlsitemap_settings_{$entity}_{$bundle_old}");
xmlsitemap_link_bundle_settings_save($entity, $bundle_new, $settings, FALSE); xmlsitemap_link_bundle_settings_save($entity, $bundle_new, $settings, FALSE);
xmlsitemap_update_links(array('subtype' => $bundle_new), array('type' => $entity, 'subtype' => $bundle_old)); xmlsitemap_link_update_multiple(array('subtype' => $bundle_new), array('type' => $entity, 'subtype' => $bundle_old));
} }
} }
......
...@@ -533,7 +533,7 @@ class XMLSitemapUnitTest extends XMLSitemapTestHelper { ...@@ -533,7 +533,7 @@ class XMLSitemapUnitTest extends XMLSitemapTestHelper {
} }
/** /**
* Tests for xmlsitemap_update_links(). * Tests for xmlsitemap_link_update_multiple().
*/ */
function testUpdateLinks() { function testUpdateLinks() {
// Add our testing data. // Add our testing data.
...@@ -547,7 +547,7 @@ class XMLSitemapUnitTest extends XMLSitemapTestHelper { ...@@ -547,7 +547,7 @@ class XMLSitemapUnitTest extends XMLSitemapTestHelper {
// 2 | testing | group1 | '' | 1 | 1 | 0.5 // 2 | testing | group1 | '' | 1 | 1 | 0.5
// 3 | testing | group2 | '' | 1 | 1 | 0.5 // 3 | testing | group2 | '' | 1 | 1 | 0.5
$updated = xmlsitemap_update_links(array('status' => 0), array('type' => 'testing', 'subtype' => 'group1', 'status_override' => 0)); $updated = xmlsitemap_link_update_multiple(array('status' => 0), array('type' => 'testing', 'subtype' => 'group1', 'status_override' => 0));
$this->assertEqual($updated, 2); $this->assertEqual($updated, 2);
$this->assertFlag('regenerate_needed', TRUE); $this->assertFlag('regenerate_needed', TRUE);
// id | type | subtype | language | status | priority // id | type | subtype | language | status | priority
...@@ -555,7 +555,7 @@ class XMLSitemapUnitTest extends XMLSitemapTestHelper { ...@@ -555,7 +555,7 @@ class XMLSitemapUnitTest extends XMLSitemapTestHelper {
// 2 | testing | group1 | '' | 0 | 0.5 // 2 | testing | group1 | '' | 0 | 0.5
// 3 | testing | group2 | '' | 1 | 0.5 // 3 | testing | group2 | '' | 1 | 0.5
$updated = xmlsitemap_update_links(array('priority' => 0.0), array('type' => 'testing', 'subtype' => 'group1', 'priority_override' => 0)); $updated = xmlsitemap_link_update_multiple(array('priority' => 0.0), array('type' => 'testing', 'subtype' => 'group1', 'priority_override' => 0));
$this->assertEqual($updated, 2); $this->assertEqual($updated, 2);
$this->assertFlag('regenerate_needed', FALSE); $this->assertFlag('regenerate_needed', FALSE);
// id | type | subtype | language | status | priority // id | type | subtype | language | status | priority
...@@ -563,7 +563,7 @@ class XMLSitemapUnitTest extends XMLSitemapTestHelper { ...@@ -563,7 +563,7 @@ class XMLSitemapUnitTest extends XMLSitemapTestHelper {
// 2 | testing | group1 | '' | 0 | 0.0 // 2 | testing | group1 | '' | 0 | 0.0
// 3 | testing | group2 | '' | 1 | 0.5 // 3 | testing | group2 | '' | 1 | 0.5
$updated = xmlsitemap_update_links(array('subtype' => 'group2'), array('type' => 'testing', 'subtype' => 'group1')); $updated = xmlsitemap_link_update_multiple(array('subtype' => 'group2'), array('type' => 'testing', 'subtype' => 'group1'));
$this->assertEqual($updated, 2); $this->assertEqual($updated, 2);
$this->assertFlag('regenerate_needed', FALSE); $this->assertFlag('regenerate_needed', FALSE);
// id | type | subtype | language | status | priority // id | type | subtype | language | status | priority
...@@ -571,7 +571,7 @@ class XMLSitemapUnitTest extends XMLSitemapTestHelper { ...@@ -571,7 +571,7 @@ class XMLSitemapUnitTest extends XMLSitemapTestHelper {
// 2 | testing | group2 | '' | 0 | 0.0 // 2 | testing | group2 | '' | 0 | 0.0
// 3 | testing | group2 | '' | 1 | 0.5 // 3 | testing | group2 | '' | 1 | 0.5
$updated = xmlsitemap_update_links(array('status' => 1), array('type' => 'testing', 'subtype' => 'group2', 'status_override' => 0, 'status' => 0)); $updated = xmlsitemap_link_update_multiple(array('status' => 1), array('type' => 'testing', 'subtype' => 'group2', 'status_override' => 0, 'status' => 0));
$this->assertEqual($updated, 2); $this->assertEqual($updated, 2);
$this->assertFlag('regenerate_needed', TRUE); $this->assertFlag('regenerate_needed', TRUE);
// id | type | subtype | language | status | priority // id | type | subtype | language | status | priority
......
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