Commit e2a1e818 authored by tadityar's avatar tadityar

Issue #2469293 by tadityar: No commas after last multiline array item

parent b10e151b
......@@ -89,7 +89,7 @@ class XmlSitemapController extends ControllerBase {
'sitemap' => print_r($sitemap, TRUE),
'chunk' => $chunk,
'cache_file_location' => $file,
'cache_file_exists' => file_exists($file) ? 'Yes' : 'No'
'cache_file_exists' => file_exists($file) ? 'Yes' : 'No',
);
return new Response($template->render($elements));
}
......
......@@ -117,7 +117,7 @@ class XmlSitemapEntitiesSettingsForm extends ConfigFormBase implements Container
'types' => array(
'#type' => 'table',
'#tableselect' => true,
'#tableselect' => TRUE,
'#default_value' => array(),
'#header' => array(
array(
......@@ -144,17 +144,17 @@ class XmlSitemapEntitiesSettingsForm extends ConfigFormBase implements Container
'#markup' => String::checkPlain($bundle_info['label']),
),
'operations' => [
'#type' => 'operations',
'#links' => [
'configure' => [
'title' => $this->t('Configure'),
'url' => Url::fromRoute('xmlsitemap.admin_settings_bundle', array(
'#type' => 'operations',
'#links' => [
'configure' => [
'title' => $this->t('Configure'),
'url' => Url::fromRoute('xmlsitemap.admin_settings_bundle', array(
'entity' => $entity_type_id,
'bundle' => $bundle,
'query' => drupal_get_destination(),
)),
]
]
]
]
],
);
$form['settings'][$entity_type_id]['types']['#default_value'][$bundle] = xmlsitemap_link_bundle_check_enabled($entity_type_id, $bundle);
......
......@@ -100,7 +100,7 @@ class XmlSitemapLinkBundleSettingsForm extends ConfigFormBase implements Contain
'#type' => 'link',
'#title' => $this->t('Cancel'),
'#href' => isset($destination) ? $destination : 'admin/config/search/xmlsitemap/settings',
'#weight' => 10
'#weight' => 10,
);
$form = parent::buildForm($form, $form_state);
......
......@@ -52,7 +52,7 @@ class XmlSitemapEntityFunctionalTest extends XmlSitemapTestBase {
$this->assertField('settings[entity_test][entity_test][settings][bundle]');
$edit = array(
'entity_types[entity_test]' => 1,
'settings[entity_test][entity_test][settings][bundle]' => 1
'settings[entity_test][entity_test][settings][bundle]' => 1,
);
$this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertText(t('The configuration options have been saved.'));
......@@ -78,11 +78,11 @@ class XmlSitemapEntityFunctionalTest extends XmlSitemapTestBase {
$edit = array(
'xmlsitemap[status]' => 0,
'xmlsitemap[priority]' => 0.3,
'xmlsitemap[changefreq]' => XMLSITEMAP_FREQUENCY_WEEKLY
'xmlsitemap[changefreq]' => XMLSITEMAP_FREQUENCY_WEEKLY,
);
$this->drupalPostForm(NULL, $edit, t('Save configuration'));
$entity = entity_create('entity_test', array(
'bundle' => 'entity_test'
'bundle' => 'entity_test',
));
$entity->save();
$this->assertSitemapLinkValues('entity_test', $entity->id(), array('status' => 0, 'priority' => 0.3, 'changefreq' => XMLSITEMAP_FREQUENCY_WEEKLY, 'access' => 1));
......@@ -99,11 +99,11 @@ class XmlSitemapEntityFunctionalTest extends XmlSitemapTestBase {
$edit = array(
'xmlsitemap[status]' => 1,
'xmlsitemap[priority]' => 0.6,
'xmlsitemap[changefreq]' => XMLSITEMAP_FREQUENCY_YEARLY
'xmlsitemap[changefreq]' => XMLSITEMAP_FREQUENCY_YEARLY,
);
$this->drupalPostForm('admin/config/search/xmlsitemap/settings/entity_test/entity_test', $edit, t('Save configuration'));
$entity = entity_create('entity_test', array(
'bundle' => 'entity_test'
'bundle' => 'entity_test',
));
$entity->save();
$this->assertSitemapLinkValues('entity_test', $entity->id(), array('status' => 1, 'priority' => 0.6, 'changefreq' => XMLSITEMAP_FREQUENCY_YEARLY, 'access' => 1));
......@@ -127,7 +127,7 @@ class XmlSitemapEntityFunctionalTest extends XmlSitemapTestBase {
xmlsitemap_link_bundle_enable('entity_test', 'entity_test');
$entity = entity_create('entity_test', array(
'bundle' => 'entity_test'
'bundle' => 'entity_test',
));
$entity->save();
$this->assertSitemapLinkValues('entity_test', $entity->id(), array('status' => 0, 'priority' => 0.5, 'changefreq' => 0, 'access' => 0));
......
......@@ -84,7 +84,7 @@ class XmlSitemapListBuilderTest extends XmlSitemapTestBase {
$this->drupalLogin($this->admin_user);
$edit = array(
'label' => 'English',
'context[language]' => 'en'
'context[language]' => 'en',
);
$this->drupalPostForm('admin/config/search/xmlsitemap/add', $edit, t('Save'));
$context = array('language' => 'en');
......@@ -94,7 +94,7 @@ class XmlSitemapListBuilderTest extends XmlSitemapTestBase {
$edit = array(
'label' => 'French',
'context[language]' => 'fr'
'context[language]' => 'fr',
);
$this->drupalPostForm('admin/config/search/xmlsitemap/add', $edit, t('Save'));
$context = array('language' => 'fr');
......@@ -107,7 +107,7 @@ class XmlSitemapListBuilderTest extends XmlSitemapTestBase {
$edit = array(
'label' => 'Undefined',
'context[language]' => 'und'
'context[language]' => 'und',
);
$this->drupalPostForm('admin/config/search/xmlsitemap/add', $edit, t('Save'));
$this->assertText(t('There is another sitemap saved with the same context.'));
......
......@@ -37,14 +37,16 @@ class XmlSitemapMenuFunctionalTest extends XmlSitemapTestBase {
parent::setUp();
if ($this->profile != 'standard') {
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page', 'settings' => array(
$this->drupalCreateContentType(array(
'type' => 'page',
'name' => 'Basic page',
'settings' => array(
// Set proper default options for the page content type.
'node' => array(
'options' => array('promote' => FALSE),
'submitted' => FALSE,
),
)));
$this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
'node' => array(
'options' => array('promote' => FALSE),
'submitted' => FALSE,
), )));
$this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
}
// allow anonymous user to administer menu links
......
......@@ -23,7 +23,7 @@ class XmlSitemapMultilingualNodeTest extends XmlSitemapMultilingualTestBase {
return array(
'name' => 'XML sitemap i18n node tests',
'description' => 'Functional and integration tests for the XML sitemap node and internationalization modules.',
'group' => 'XML sitemap'
'group' => 'XML sitemap',
);
}
......@@ -34,14 +34,16 @@ class XmlSitemapMultilingualNodeTest extends XmlSitemapMultilingualTestBase {
parent::setUp();
if ($this->profile != 'standard') {
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page', 'settings' => array(
$this->drupalCreateContentType(array(
'type' => 'page',
'name' => 'Basic page',
'settings' => array(
// Set proper default options for the page content type.
'node' => array(
'options' => array('promote' => FALSE),
'submitted' => FALSE,
),
)));
$this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
'node' => array(
'options' => array('promote' => FALSE),
'submitted' => FALSE,
), )));
$this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
}
$this->admin_user = $this->drupalCreateUser(array('administer nodes', 'administer languages', 'administer content types', 'access administration pages', 'create page content', 'edit own page content'));
......
......@@ -43,14 +43,16 @@ class XmlSitemapNodeFunctionalTest extends XmlSitemapTestBase {
parent::setUp();
if ($this->profile != 'standard') {
$this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page', 'settings' => array(
$this->drupalCreateContentType(array(
'type' => 'page',
'name' => 'Basic page',
'settings' => array(
// Set proper default options for the page content type.
'node' => array(
'options' => array('promote' => FALSE),
'submitted' => FALSE,
),
)));
$this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
'node' => array(
'options' => array('promote' => FALSE),
'submitted' => FALSE,
), )));
$this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
}
$this->admin_user = $this->drupalCreateUser(array('administer nodes', 'bypass node access', 'administer content types', 'administer xmlsitemap', 'administer taxonomy'));
......@@ -161,7 +163,7 @@ class XmlSitemapNodeFunctionalTest extends XmlSitemapTestBase {
$edit = array(
'title[0][value]' => 'Test node title',
'body[0][value]' => 'Test node body'
'body[0][value]' => 'Test node body',
);
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
$this->assertText('Basic page Test node title has been updated.');
......@@ -175,7 +177,7 @@ class XmlSitemapNodeFunctionalTest extends XmlSitemapTestBase {
$edit = array(
'xmlsitemap[status]' => 1,
'xmlsitemap[priority]' => 0.9,
'xmlsitemap[changefreq]' => XMLSITEMAP_FREQUENCY_ALWAYS
'xmlsitemap[changefreq]' => XMLSITEMAP_FREQUENCY_ALWAYS,
);
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published'));
$this->assertText('Basic page Test node title has been updated.');
......@@ -183,7 +185,7 @@ class XmlSitemapNodeFunctionalTest extends XmlSitemapTestBase {
$edit = array(
'xmlsitemap[status]' => 'default',
'xmlsitemap[priority]' => 'default'
'xmlsitemap[priority]' => 'default',
);
$this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published'));
$this->assertText('Basic page Test node title has been updated.');
......@@ -210,7 +212,7 @@ class XmlSitemapNodeFunctionalTest extends XmlSitemapTestBase {
$this->assertSitemapLinkValues('node', $node_old->id(), array('status' => 0, 'priority' => 0.0));
$edit = array(
'type' => 'page2'
'type' => 'page2',
);
$this->drupalPostForm('admin/structure/types/manage/page', $edit, t('Save content type'));
$this->assertText('Changed the content type of 2 posts from page to page2.');
......
......@@ -247,7 +247,6 @@ class XmlSitemapUnitTest extends XmlSitemapTestBase {
// 1 | testing | group1 | '' | 1 | 1 | 0.5
// 2 | testing | group1 | '' | 1 | 1 | 0.5
// 3 | testing | group2 | '' | 1 | 1 | 0.5
$updated = $this->linkStorage->updateMultiple(array('status' => 0), array('type' => 'testing', 'subtype' => 'group1', 'status_override' => 0));
$this->assertEqual($updated, 2);
$this->assertFlag('xmlsitemap_regenerate_needed', TRUE);
......@@ -255,7 +254,6 @@ class XmlSitemapUnitTest extends XmlSitemapTestBase {
// 1 | testing | group1 | '' | 0 | 0.5
// 2 | testing | group1 | '' | 0 | 0.5
// 3 | testing | group2 | '' | 1 | 0.5
$updated = $this->linkStorage->updateMultiple(array('priority' => 0.0), array('type' => 'testing', 'subtype' => 'group1', 'priority_override' => 0));
$this->assertEqual($updated, 2);
$this->assertFlag('xmlsitemap_regenerate_needed', FALSE);
......@@ -263,7 +261,6 @@ class XmlSitemapUnitTest extends XmlSitemapTestBase {
// 1 | testing | group1 | '' | 0 | 0.0
// 2 | testing | group1 | '' | 0 | 0.0
// 3 | testing | group2 | '' | 1 | 0.5
$updated = $this->linkStorage->updateMultiple(array('subtype' => 'group2'), array('type' => 'testing', 'subtype' => 'group1'));
$this->assertEqual($updated, 2);
$this->assertFlag('xmlsitemap_regenerate_needed', FALSE);
......@@ -271,7 +268,6 @@ class XmlSitemapUnitTest extends XmlSitemapTestBase {
// 1 | testing | group2 | '' | 0 | 0.0
// 2 | testing | group2 | '' | 0 | 0.0
// 3 | testing | group2 | '' | 1 | 0.5
$updated = $this->linkStorage->updateMultiple(array('status' => 1), array('type' => 'testing', 'subtype' => 'group2', 'status_override' => 0, 'status' => 0));
$this->assertEqual($updated, 2);
$this->assertFlag('xmlsitemap_regenerate_needed', TRUE);
......
......@@ -11,5 +11,5 @@ namespace Drupal\xmlsitemap;
* Basic XmlSitemapException class
*/
class XmlSitemapException extends \Exception {
}
......@@ -11,5 +11,5 @@ namespace Drupal\xmlsitemap;
* Exception thrown at sitemap generation
*/
class XmlSitemapGenerationException extends XmlSitemapException {
}
......@@ -78,7 +78,7 @@ interface XmlSitemapGeneratorInterface {
* An unserialized data array for an XML sitemap.
* @param \Drupal\xmlsitemap\XmlSitemapWriter $writer
* XML writer object
* @param integer $page
* @param int $pageAn integer of the specific page of the sitemap to generate.
* An integer of the specific page of the sitemap to generate.
*/
public function generateChunk(XmlSitemapInterface $sitemap, XmlSitemapWriter $writer, $chunk);
......@@ -120,7 +120,7 @@ interface XmlSitemapGeneratorInterface {
* Results for the regeneration process.
* @param array $operations
* Operations performed.
* @param integer $elapsed
* @param int $elapsedTime elapsed.
* Time elapsed.
*/
public function regenerateBatchFinished($success, $results, $operations, $elapsed);
......@@ -156,7 +156,7 @@ interface XmlSitemapGeneratorInterface {
* Results for the regeneration process.
* @param array $operations
* Operations performed.
* @param integer $elapsed
* @param int $elapsedTime elapsed.
* Time elapsed.
*/
public function rebuildBatchFinished($success, $results, $operations, $elapsed);
......
......@@ -74,7 +74,7 @@ class XmlSitemapLinkStorage implements XmlSitemapLinkStorageInterface {
'priority' => $settings['priority'],
'priority_default' => $settings['priority'],
'priority_override' => 0,
'changefreq' => isset($settings['changefreq']) ? $settings['changefreq'] : 0
'changefreq' => isset($settings['changefreq']) ? $settings['changefreq'] : 0,
);
$url = $entity->url();
......@@ -235,7 +235,6 @@ class XmlSitemapLinkStorage implements XmlSitemapLinkStorageInterface {
}
// @todo Add a hook_xmlsitemap_link_delete() hook invoked here.
$query = db_delete('xmlsitemap');
foreach ($conditions as $field => $value) {
$query->condition($field, $value);
......
......@@ -53,7 +53,7 @@ function hook_xmlsitemap_link_info() {
'rebuild callback' => '',
// Callback function called from the XML sitemap settings page.
'settings callback' => '',
)
),
),
);
}
......@@ -112,7 +112,7 @@ function hook_xmlsitemap_link_update(array $link) {
* Index links for the XML sitemaps.
*/
function hook_xmlsitemap_index_links($limit) {
}
/**
......@@ -167,14 +167,14 @@ function hook_xmlsitemap_context_alter(&$context) {
* Provide options for the url() function based on an XML sitemap context.
*/
function hook_xmlsitemap_context_url_options(array $context) {
}
/**
* Alter the url() options based on an XML sitemap context.
*/
function hook_xmlsitemap_context_url_options_alter(array &$options, array $context) {
}
/**
......@@ -204,7 +204,7 @@ function hook_query_xmlsitemap_generate_alter(QueryAlterableInterface $query) {
* Provide information about XML sitemap bulk operations.
*/
function hook_xmlsitemap_sitemap_operations() {
}
/**
......
......@@ -27,8 +27,8 @@ function xmlsitemap_drush_command() {
'callback' => 'drush_xmlsitemap_index',
'drupal dependencies' => array('xmlsitemap'),
'options' => array(
'limit' => 'The limit of links of each type to process.'
)
'limit' => 'The limit of links of each type to process.',
),
);
return $items;
}
......@@ -56,7 +56,7 @@ function drush_xmlsitemap_rebuild() {
// Build a list of rebuildable link types.
$rebuild_types = xmlsitemap_get_rebuildable_link_types();
if (empty($rebuild_types)) {
return drush_set_error("No link types are rebuildable.");
return drush_set_error("No link types are rebuildable.");
}
// Run the batch process.
......
......@@ -40,11 +40,16 @@ const XMLSITEMAP_MAX_SITEMAP_FILESIZE = 10485760;
/**
* Xmlsitemap Frequencies
*/
const XMLSITEMAP_FREQUENCY_YEARLY = 31449600; // 60 * 60 * 24 * 7 * 52
const XMLSITEMAP_FREQUENCY_MONTHLY = 2419200; // 60 * 60 * 24 * 7 * 4
const XMLSITEMAP_FREQUENCY_WEEKLY = 604800; // 60 * 60 * 24 * 7
const XMLSITEMAP_FREQUENCY_DAILY = 86400; // 60 * 60 * 24
const XMLSITEMAP_FREQUENCY_HOURLY = 3600; // 60 * 60
const XMLSITEMAP_FREQUENCY_YEARLY = 31449600;
// 60 * 60 * 24 * 7 * 52
const XMLSITEMAP_FREQUENCY_MONTHLY = 2419200;
// 60 * 60 * 24 * 7 * 4
const XMLSITEMAP_FREQUENCY_WEEKLY = 604800;
// 60 * 60 * 24 * 7
const XMLSITEMAP_FREQUENCY_DAILY = 86400;
// 60 * 60 * 24
const XMLSITEMAP_FREQUENCY_HOURLY = 3600;
// 60 * 60
const XMLSITEMAP_FREQUENCY_ALWAYS = 60;
/**
......@@ -116,10 +121,13 @@ function xmlsitemap_help($route_name, RouteMatchInterface $route_match) {
case 'entity.xmlsitemap.edit_form':
case 'entity.xmlsitemap.delete_form':
return;
case 'xmlsitemap.admin_search':
break;
case 'xmlsitemap.admin_search_list':
break;
case 'xmlsitemap.admin_rebuild':
$output .= '<p>' . t("This action rebuilds your site's XML sitemap and regenerates the cached files, and may be a lengthy process. If you just installed XML sitemap, this can be helpful to import all your site's content into the sitemap. Otherwise, this should only be used in emergencies.") . '</p>';
}
......@@ -226,7 +234,7 @@ function xmlsitemap_config_variables() {
'regenerate_last' => NULL,
'custom_links' => NULL,
'priority_default' => NULL,
'languages' => NULL
'languages' => NULL,
);
}
......@@ -244,7 +252,7 @@ function xmlsitemap_state_variables() {
'xmlsitemap_generated_last' => 0,
'xmlsitemap_developer_mode' => 0,
'max_chunks' => NULL,
'max_filesize' => NULL
'max_filesize' => NULL,
);
}
......@@ -442,7 +450,7 @@ function xmlsitemap_sitemap_uri(XmlSitemapInterface $sitemap) {
\Drupal::moduleHandler()->alter('xmlsitemap_context_url_options', $uri['options'], $context);
$uri['options'] += array(
'absolute' => TRUE,
'base_url' => \Drupal::state()->get('xmlsitemap_base_url')
'base_url' => \Drupal::state()->get('xmlsitemap_base_url'),
);
return $uri;
}
......@@ -521,7 +529,7 @@ function xmlsitemap_clear_directory(XmlSitemapInterface $sitemap = NULL, $delete
* A string specifying the filepath or URI of the original directory.
* @param string $new_dir
* A string specifying the filepath or URI of the new directory.
* @param integer $replace
* @param int $replaceReplace behavior when the destination file already exists.
* Replace behavior when the destination file already exists.
*
* @return bool
......@@ -621,7 +629,7 @@ function xmlsitemap_get_link_info($type = NULL, $reset = FALSE) {
'label' => $entity_type->getLabel(),
'type' => $entity_type->id(),
'base table' => $entity_type->getBaseTable(),
'bundles' => \Drupal::entityManager()->getBundleInfo($entity_type->id())
'bundles' => \Drupal::entityManager()->getBundleInfo($entity_type->id()),
);
$uri_callback = $entity_type->getUriCallback();
if (empty($uri_callback) || !isset($entity_type->xmlsitemap)) {
......@@ -797,7 +805,7 @@ function xmlsitemap_link_bundle_rename($entity, $bundle_old, $bundle_new) {
*
* @param string $entity_old
* Old entity type id.
* @param type $entity_new
* @param string or int or object... $entity_newNew entity type id.
* New entity type id.
* @param array $bundles
* Bundles to be updated.
......@@ -849,7 +857,7 @@ function xmlsitemap_link_bundle_load($entity, $bundle, $load_bundle_info = TRUE)
$info += array(
'status' => XMLSITEMAP_STATUS_DEFAULT,
'priority' => XMLSITEMAP_PRIORITY_DEFAULT,
'changefreq' => 0
'changefreq' => 0,
);
return $info;
}
......@@ -1084,7 +1092,7 @@ function xmlsitemap_form_submit_flag_regenerate(array $form, FormStateInterface
}
if ($stored_value != 'not_a_variable' && $stored_value != $value) {
\Drupal::state()->set('xmlsitemap_regenerate_needed', TRUE);
drupal_set_message(t('XML sitemap settings have been modified and the files should be regenerated. You can <a href="@run-cron">run cron manually</a> to regenerate the cached files.', array('@run-cron' => Url::fromRoute('system.run_cron', [], array('query' => drupal_get_destination()))->toString())), 'warning', FALSE);
drupal_set_message(t('XML sitemap settings have been modified and the files should be regenerated. You can <a href="@run-cron">run cron manually</a> to regenerate the cached files.', array('@run-cron' => Url::fromRoute('system.run_cron', [], array('query' => drupal_get_destination()))->toString())), 'warning', FALSE);
return;
}
}
......@@ -1119,7 +1127,7 @@ function xmlsitemap_add_form_link_options(array &$form, $entity, $bundle, $id) {
'priority' => $bundle_info['priority'],
'priority_default' => $bundle_info['priority'],
'priority_override' => 0,
'changefreq' => $bundle_info['changefreq']
'changefreq' => $bundle_info['changefreq'],
);
$currentUser = \Drupal::currentUser();
......@@ -1293,7 +1301,7 @@ function xmlsitemap_get_changefreq_options() {
/**
* Load a language object by its language code.
*
* @param string $language
* @param string $language
* A language code. If not provided the default language will be returned.
*
* @return \Drupal\core\Language\LanguageInterface
......@@ -1505,7 +1513,7 @@ function theme_xmlsitemap_content_settings_table($variables) {
* entity form.
*/
function xmlsitemap_form_controller(FormStateInterface $form_state) {
return (null != $form_state->getFormObject()) && $form_state->getFormObject() instanceof EntityForm ? $form_state->getFormObject() : FALSE;
return (NULL != $form_state->getFormObject()) && $form_state->getFormObject() instanceof EntityForm ? $form_state->getFormObject() : FALSE;
}
/**
......@@ -1771,14 +1779,17 @@ function xmlsitemap_query_xmlsitemap_generate_alter(AlterableInterface $query) {
// Current language and language neutral.
$query->condition('language', array($current, LanguageInterface::LANGCODE_NOT_SPECIFIED));
break;
case 'mixed':
// Mixed current language (if available) or default language (if not) and language neutral.
$query->condition('language', array($current, $default, LanguageInterface::LANGCODE_NOT_SPECIFIED));
break;
case 'default':
// Only default language and language neutral.
$query->condition('language', array($default, LanguageInterface::LANGCODE_NOT_SPECIFIED));
break;
case 'strict':
// Only current language (for nodes), simple for all other types.
$node_condition = db_and();
......@@ -1792,6 +1803,7 @@ function xmlsitemap_query_xmlsitemap_generate_alter(AlterableInterface $query) {
$condition->condition($normal_condition);
$query->condition($condition);
break;
case 'off':
// All content. No language conditions apply.
break;
......@@ -2247,7 +2259,7 @@ function xmlsitemap_file_transfer(Response $response, $uri, $headers) {
* @static string $blurb
* Blurb message.
*
* @param type $check_version
* @param string or int or object... $check_version
* @return string
*/
function _xmlsitemap_get_blurb($check_version = TRUE) {
......@@ -2329,7 +2341,7 @@ function xmlsitemap_check_status() {
if ($messages) {
$messages = array(
'#type' => 'item_list',
'#items' => array($messages)
'#items' => array($messages),
);
$message = t('One or more problems were detected with your XML sitemap configuration: !messages', array('!messages' => \Drupal::service('renderer')->render($messages)));
drupal_set_message($message, 'warning', FALSE);
......@@ -2343,7 +2355,6 @@ function xmlsitemap_check_status() {
}
// BATCH OPERATIONS ------------------------------------------------------------
/**
* Perform operations before rebuilding the sitemap.
*/
......@@ -2426,7 +2437,7 @@ function xmlsitemap_regenerate_batch_generate_index($smid, array &$context = arr
* Results for the regeneration process.
* @param array $operations
* Operations performed.
* @param integer $elapsed
* @param int $elapsedTime elapsed.
* Time elapsed.
*/
function xmlsitemap_regenerate_batch_finished($success, $results, $operations, $elapsed) {
......@@ -2564,7 +2575,7 @@ function xmlsitemap_rebuild_batch_fetch($entity, &$context) {
* Results for the regeneration process.
* @param array $operations
* Operations performed.
* @param integer $elapsed
* @param int $elapsedTime elapsed.
* Time elapsed.
*/
function xmlsitemap_rebuild_batch_finished($success, $results, $operations, $elapsed) {
......@@ -2615,7 +2626,7 @@ function xmlsitemap_link_bundle_enable($entity_type_id, $bundle_id) {
$settings = array(
'status' => XMLSITEMAP_STATUS_DEFAULT,
'priority' => XMLSITEMAP_PRIORITY_DEFAULT,
'changefreq' => 0
'changefreq' => 0,
);
xmlsitemap_link_bundle_settings_save($entity_type_id, $bundle_id, $settings);
}
......
......@@ -56,7 +56,7 @@ class XmlSitemapCustomListController extends ControllerBase {
$build['xmlsitemap_add_custom'] = array(
'#type' => 'link',
'#title' => t('Add custom link'),
'#href' => 'admin/config/search/xmlsitemap/custom/add'
'#href' => 'admin/config/search/xmlsitemap/custom/add',
);
$header = array(
'loc' => array('data' => t('Location'), 'field' => 'loc', 'sort' => 'asc'),
......@@ -89,15 +89,15 @@ class XmlSitemapCustomListController extends ControllerBase {
'title' => t('Edit'),
'route_name' => 'xmlsitemap_custom.edit',
'route_parameters' => array(
'link' => $link->id
)
'link' => $link->id,
),
);
$operations['delete'] = array(
'title' => t('Delete'),
'route_name' => 'xmlsitemap_custom.delete',
'route_parameters' => array(
'link' => $link->id
)
'link' => $link->id,
),
);
$row['operations'] = array(
'data' => array(
......@@ -116,7 +116,7 @@ class XmlSitemapCustomListController extends ControllerBase {
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
'#empty' => $this->t('No custom links available. <a href="@custom_link">Add custom link</a>', array('@custom_link' => Url::fromRoute('xmlsitemap_custom.add', [], array('query' => $destination))))
'#empty' => $this->t('No custom links available. <a href="@custom_link">Add custom link</a>', array('@custom_link' => Url::fromRoute('xmlsitemap_custom.add', [], array('query' => $destination)))),
);