Commit 84958a88 authored by Renato Gonçalves H's avatar Renato Gonçalves H Committed by Renato Gonçalves H
Browse files

Issue #3267968 by RenatoG: Fix XML Sitemap name capitalized

parent 00a39d1f
......@@ -35,8 +35,8 @@ UNINSTALLING
------------
Because Drupal does not uninstall modules in reverse order of their
dependencies, if you want to uninstall all the XML sitemap modules, be sure to
disable and uninstall all the sub-modules before the base XML sitemap module.
dependencies, if you want to uninstall all the XML Sitemap modules, be sure to
disable and uninstall all the sub-modules before the base XML Sitemap module.
To help fix this bug in Drupal core, visit https://www.drupal.org/node/151452.
......
{
"name": "drupal/xmlsitemap",
"description": "Creates XML sitemaps for the site",
"description": "Creates XML Sitemaps for the site",
"type": "drupal-module",
"license": "GPL-2.0-or-later",
"homepage": "https://www.drupal.org/project/xmlsitemap",
......
......@@ -2,7 +2,7 @@
xmlsitemap.settings:
type: config_object
label: 'XML sitemap settings'
label: 'XML Sitemap settings'
mapping:
minimum_lifetime:
type: integer
......@@ -49,7 +49,7 @@ xmlsitemap.settings:
xmlsitemap.settings.*.*:
type: config_object
label: 'XML sitemap entity bundle settings'
label: 'XML Sitemap entity bundle settings'
mapping:
status:
type: boolean
......
/**
* @file
* Default JavaScript file for XML sitemap.
* Default JavaScript file for XML Sitemap.
*/
(function ($, Drupal) {
......
......@@ -8,7 +8,7 @@ use Drupal\Core\Extension\ModuleHandlerInterface;
use Drush\Commands\DrushCommands;
/**
* Drush commands for XML sitemap.
* Drush commands for XML Sitemap.
*/
class XmlSitemapCommands extends DrushCommands {
......@@ -51,7 +51,7 @@ class XmlSitemapCommands extends DrushCommands {
}
/**
* Regenerate the XML sitemap files.
* Regenerate the XML Sitemap files.
*
* @validate-module-enabled xmlsitemap
*
......@@ -65,7 +65,7 @@ class XmlSitemapCommands extends DrushCommands {
}
/**
* Dump and re-process all possible XML sitemap data, then regenerate files.
* Dump and re-process all possible XML Sitemap data, then regenerate files.
*
* @validate-module-enabled xmlsitemap
*
......@@ -85,7 +85,7 @@ class XmlSitemapCommands extends DrushCommands {
}
/**
* Process un-indexed XML sitemap links.
* Process un-indexed XML Sitemap links.
*
* @param array $options
* An associative array of options obtained from cli, aliases, config, etc.
......@@ -106,10 +106,10 @@ class XmlSitemapCommands extends DrushCommands {
$count_after = $this->connection->select('xmlsitemap', 'x')->countQuery()->execute()->fetchField();
if ($count_after == $count_before) {
$this->output()->writeln(dt('No new XML sitemap links to index.'));
$this->output()->writeln(dt('No new XML Sitemap links to index.'));
}
else {
$this->output()->writeln(dt('Indexed @count new XML sitemap links.', ['@count' => $count_after - $count_before]));
$this->output()->writeln(dt('Indexed @count new XML Sitemap links.', ['@count' => $count_after - $count_before]));
}
}
......
......@@ -165,7 +165,7 @@ class XmlSitemapController extends ControllerBase {
// Make sure the strings in the XSL content are translated properly.
$replacements = [
'Sitemap file' => $this->t('Sitemap file'),
'Generated by the <a href="https://www.drupal.org/project/xmlsitemap">Drupal XML sitemap module</a>.' => $this->t('Generated by the <a href="@link-xmlsitemap">Drupal XML sitemap module</a>.', ['@link-xmlsitemap' => 'https://www.drupal.org/project/xmlsitemap']),
'Generated by the <a href="https://www.drupal.org/project/xmlsitemap">Drupal XML Sitemap module</a>.' => $this->t('Generated by the <a href="@link-xmlsitemap">Drupal XML Sitemap module</a>.', ['@link-xmlsitemap' => 'https://www.drupal.org/project/xmlsitemap']),
'Number of sitemaps in this index' => $this->t('Number of sitemaps in this index'),
'Click on the table headers to change sorting.' => $this->t('Click on the table headers to change sorting.'),
'Sitemap URL' => $this->t('Sitemap URL'),
......
......@@ -10,7 +10,7 @@ use Drupal\xmlsitemap\XmlSitemapInterface;
*
* @ConfigEntityType(
* id = "xmlsitemap",
* label = @Translation("XML sitemap"),
* label = @Translation("XML Sitemap"),
* handlers = {
* "storage" = "Drupal\xmlsitemap\XmlSitemapStorage",
* "list_builder" = "Drupal\xmlsitemap\XmlSitemapListBuilder",
......
......@@ -34,7 +34,7 @@ class XmlSitemapForm extends EntityForm {
'#title' => $this->t('Label'),
'#maxlength' => 255,
'#default_value' => $xmlsitemap->label(),
'#description' => $this->t('Label for the XML sitemap.'),
'#description' => $this->t('Label for the XML Sitemap.'),
'#required' => TRUE,
];
$form['context'] = [
......@@ -44,7 +44,7 @@ class XmlSitemapForm extends EntityForm {
if (!xmlsitemap_get_context_info()) {
$form['context']['empty'] = [
'#type' => 'markup',
'#markup' => '<p>' . $this->t('There are currently no XML sitemap contexts available.') . '</p>',
'#markup' => '<p>' . $this->t('There are currently no XML Sitemap contexts available.') . '</p>',
];
}
......
......@@ -72,7 +72,7 @@ class XmlSitemapLinkBundleSettingsForm extends ConfigFormBase {
$this->bundle_type = $bundle;
$request = $this->getRequest();
$form['#title'] = $this->t('@bundle XML sitemap settings', ['@bundle' => $bundle]);
$form['#title'] = $this->t('@bundle XML Sitemap settings', ['@bundle' => $bundle]);
xmlsitemap_add_link_bundle_settings($form, $form_state, $entity, $bundle);
$form['xmlsitemap']['#type'] = 'markup';
......@@ -118,7 +118,7 @@ class XmlSitemapLinkBundleSettingsForm extends ConfigFormBase {
$entity_info = $form['xmlsitemap']['#entity_info'];
if (!empty($form['xmlsitemap']['#show_message'])) {
$this->messenger()->addStatus($this->t('XML sitemap settings for the %bundle have been saved.', ['%bundle' => $entity_info['bundles'][$bundle]['label']]));
$this->messenger()->addStatus($this->t('XML Sitemap settings for the %bundle have been saved.', ['%bundle' => $entity_info['bundles'][$bundle]['label']]));
}
// Unset the form values since we have already saved the bundle settings and
......
......@@ -70,7 +70,7 @@ class XmlSitemapRebuildForm extends ConfigFormBase {
}
else {
$request->query->set('destination', 'admin/config/search/xmlsitemap');
$this->messenger()->addWarning($this->t('A rebuild is not necessary. If you are just wanting to regenerate the XML sitemap files, you can <a href="@link-cron">run cron manually</a>.', [
$this->messenger()->addWarning($this->t('A rebuild is not necessary. If you are just wanting to regenerate the XML Sitemap files, you can <a href="@link-cron">run cron manually</a>.', [
'@link-cron' => Url::fromRoute('system.run_cron', [], ['query' => $this->getDestinationArray()]),
]));
$this->setRequest($request);
......
......@@ -130,7 +130,7 @@ class XmlSitemapSettingsForm extends ConfigFormBase {
$form['xsl'] = [
'#type' => 'checkbox',
'#title' => $this->t('Include a stylesheet in the sitemaps for humans.'),
'#description' => $this->t('When enabled, this will add formatting and tables with sorting to make it easier to view the XML sitemap data instead of viewing raw XML output. Search engines will ignore this.'),
'#description' => $this->t('When enabled, this will add formatting and tables with sorting to make it easier to view the XML Sitemap data instead of viewing raw XML output. Search engines will ignore this.'),
'#default_value' => $config->get('xsl'),
];
$form['prefetch_aliases'] = [
......@@ -196,7 +196,7 @@ class XmlSitemapSettingsForm extends ConfigFormBase {
'#default_value' => $config->get('path'),
'#size' => 30,
'#maxlength' => 255,
'#description' => $this->t('Subdirectory where the sitemap data will be stored. This folder <strong>must not be shared</strong> with any other Drupal site or install using XML sitemap.'),
'#description' => $this->t('Subdirectory where the sitemap data will be stored. This folder <strong>must not be shared</strong> with any other Drupal site or install using XML Sitemap.'),
'#field_prefix' => file_build_uri(''),
'#required' => TRUE,
];
......
......@@ -205,7 +205,7 @@ class XmlSitemapGenerator implements XmlSitemapGeneratorInterface {
$this->setMemoryLimit();
if ($this->state->get('xmlsitemap_developer_mode')) {
$this->logger->notice('Starting XML sitemap generation. Memory usage: @memory-peak.', [
$this->logger->notice('Starting XML Sitemap generation. Memory usage: @memory-peak.', [
'@memory-peak' => format_size(memory_get_peak_usage(TRUE)),
]);
}
......@@ -318,7 +318,7 @@ class XmlSitemapGenerator implements XmlSitemapGeneratorInterface {
// Ensure every link starts with a slash.
// @see \Drupal\Core\Url::fromInternalUri()
if ($link['loc'][0] !== '/') {
trigger_error("The XML sitemap link path {$link['loc']} for {$link['type']} {$link['id']} is invalid because it does not start with a slash.", E_USER_ERROR);
trigger_error("The XML Sitemap link path {$link['loc']} for {$link['type']} {$link['id']} is invalid because it does not start with a slash.", E_USER_ERROR);
$link['loc'] = '/' . $link['loc'];
}
......@@ -496,7 +496,7 @@ class XmlSitemapGenerator implements XmlSitemapGeneratorInterface {
$this->messenger->addStatus($this->t('The sitemaps were regenerated.'));
// Show a watchdog message that the sitemap was regenerated.
$this->logger->notice('Finished XML sitemap generation in @elapsed. Memory usage: @memory-peak.', ['@elapsed' => $elapsed, '@memory-peak' => format_size(memory_get_peak_usage(TRUE))]);
$this->logger->notice('Finished XML Sitemap generation in @elapsed. Memory usage: @memory-peak.', ['@elapsed' => $elapsed, '@memory-peak' => format_size(memory_get_peak_usage(TRUE))]);
}
else {
$this->messenger->addError($this->t('The sitemaps were not successfully regenerated.'));
......
......@@ -61,7 +61,7 @@ interface XmlSitemapGeneratorInterface {
* Generate one page (chunk) of the sitemap.
*
* @param XmlSitemapInterface $sitemap
* An unserialized data array for an XML sitemap.
* An unserialized data array for an XML Sitemap.
* @param string $page
* An integer of the specific page of the sitemap to generate.
*/
......@@ -71,7 +71,7 @@ interface XmlSitemapGeneratorInterface {
* Generates one chunk of the sitemap.
*
* @param \Drupal\xmlsitemap\XmlSitemapInterface $sitemap
* The XML sitemap config entity.
* The XML Sitemap config entity.
* @param \Drupal\xmlsitemap\XmlSitemapWriter $writer
* XML writer object.
* @param int $chunk
......@@ -83,7 +83,7 @@ interface XmlSitemapGeneratorInterface {
* Generate the index sitemap.
*
* @param \Drupal\xmlsitemap\XmlSitemapInterface $sitemap
* The XML sitemap config entity.
* The XML Sitemap config entity.
* @param int|null $pages
* The number of pages to write in the sitemap. Defaults to the value of
* $sitemap->getChunks().
......
......@@ -138,7 +138,7 @@ interface XmlSitemapInterface extends ConfigEntityInterface {
* Returns the sitemap with the context specified as parameter.
*
* @param array $context
* An optional XML sitemap context array to use to find the correct XML
* An optional XML Sitemap context array to use to find the correct XML
* sitemap. If not provided, the current site's context will be used.
*
* @return \Drupal\xmlsitemap\XmlSitemapInterface
......
......@@ -155,17 +155,17 @@ class XmlSitemapLinkStorage implements XmlSitemapLinkStorageInterface {
// Temporary validation checks.
// @todo Remove in final?
if ($link['priority'] < 0 || $link['priority'] > 1) {
trigger_error("The XML sitemap link for {$link['type']} {$link['id']} has an invalid priority of {$link['priority']}.<br/>" . var_export($link, TRUE), E_USER_ERROR);
trigger_error("The XML Sitemap link for {$link['type']} {$link['id']} has an invalid priority of {$link['priority']}.<br/>" . var_export($link, TRUE), E_USER_ERROR);
}
if ($link['changecount'] < 0) {
trigger_error("The XML sitemap link for {$link['type']} {$link['id']} has a negative changecount value. Please report this to https://www.drupal.org/node/516928.<br/>" . var_export($link, TRUE), E_USER_ERROR);
trigger_error("The XML Sitemap link for {$link['type']} {$link['id']} has a negative changecount value. Please report this to https://www.drupal.org/node/516928.<br/>" . var_export($link, TRUE), E_USER_ERROR);
$link['changecount'] = 0;
}
// Throw an error with the link does not start with a slash.
// @see \Drupal\Core\Url::fromInternalUri()
if ($link['loc'][0] !== '/') {
trigger_error("The XML sitemap link path {$link['loc']} for {$link['type']} {$link['id']} is invalid because it does not start with a slash.", E_USER_ERROR);
trigger_error("The XML Sitemap link path {$link['loc']} for {$link['type']} {$link['id']} is invalid because it does not start with a slash.", E_USER_ERROR);
}
// Check if this is a changed link and set the regenerate flag if necessary.
......
......@@ -7,7 +7,7 @@ use Drupal\Core\Template\Attribute;
use Drupal\Core\Url;
/**
* Extended class for writing XML sitemap files.
* Extended class for writing XML Sitemap files.
*/
class XmlSitemapWriter extends \XMLWriter {
......@@ -50,7 +50,7 @@ class XmlSitemapWriter extends \XMLWriter {
* Constructors and XmlSitemapWriter object.
*
* @param \Drupal\xmlsitemap\XmlSitemapInterface $sitemap
* The XML sitemap.
* The XML Sitemap.
* @param int|string $page
* The current page of the sitemap being generated.
*
......@@ -61,7 +61,7 @@ class XmlSitemapWriter extends \XMLWriter {
*/
public function __construct(XmlSitemapInterface $sitemap, $page) {
if ($page !== 'index' && !filter_var($page, FILTER_VALIDATE_INT)) {
throw new \InvalidArgumentException("Invalid XML sitemap page $page.");
throw new \InvalidArgumentException("Invalid XML Sitemap page $page.");
}
$this->sitemap = $sitemap;
......@@ -185,7 +185,7 @@ class XmlSitemapWriter extends \XMLWriter {
}
/**
* Writes an full XML sitemap element tag.
* Writes an full XML Sitemap element tag.
*
* @param string $name
* The element name.
......
......@@ -86,7 +86,7 @@ class XmlSitemapFunctionalTest extends XmlSitemapTestBase {
$this->drupalLogin($this->admin_user);
$this->state->set('xmlsitemap_generated_last', $this->time->getRequestTime());
$this->state->set('xmlsitemap_rebuild_needed', TRUE);
$this->assertXMLSitemapProblems('The XML sitemap data is out of sync and needs to be completely rebuilt.');
$this->assertXMLSitemapProblems('The XML Sitemap data is out of sync and needs to be completely rebuilt.');
$this->clickLink('completely rebuilt');
$this->assertSession()->statusCodeEquals(200);
$this->state->set('xmlsitemap_rebuild_needed', FALSE);
......
......@@ -6,7 +6,7 @@ use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\xmlsitemap\Entity\XmlSitemap;
/**
* Common base test class for XML sitemap internationalization tests.
* Common base test class for XML Sitemap internationalization tests.
*/
abstract class XmlSitemapMultilingualTestBase extends XmlSitemapTestBase {
......
......@@ -42,7 +42,7 @@ class XmlSitemapRebuildTest extends XmlSitemapTestBase {
$this->drupalLogin($this->admin_user);
$this->drupalGet('admin/config/search/xmlsitemap/rebuild');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains("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.");
$this->assertSession()->pageTextContains("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.");
$this->drupalPostForm(NULL, [], 'Save configuration');
$this->assertSession()->pageTextContains('The sitemap links were rebuilt.');
......
......@@ -159,10 +159,10 @@ abstract class XmlSitemapTestBase extends BrowserTestBase {
}
/**
* Retrieves an XML sitemap.
* Retrieves an XML Sitemap.
*
* @param array $context
* An optional array of the XML sitemap's context.
* An optional array of the XML Sitemap's context.
* @param array $options
* Options to be forwarded to Url::fromUri(). These values will be merged
* with, but always override $sitemap->uri['options'].
......@@ -189,7 +189,7 @@ abstract class XmlSitemapTestBase extends BrowserTestBase {
$this->state->set('xmlsitemap_regenerate_needed', TRUE);
$this->state->set('xmlsitemap_generated_last', 0);
$this->cronRun();
$this->assertTrue($this->state->get('xmlsitemap_generated_last') && !$this->state->get('xmlsitemap_regenerate_needed'), t('XML sitemaps regenerated and flag cleared.'));
$this->assertTrue($this->state->get('xmlsitemap_generated_last') && !$this->state->get('xmlsitemap_regenerate_needed'), t('XML Sitemaps regenerated and flag cleared.'));
}
/**
......@@ -371,7 +371,7 @@ abstract class XmlSitemapTestBase extends BrowserTestBase {
protected function assertXMLSitemapProblems($problem_text = FALSE) {
// @codingStandardsIgnoreEnd
$this->drupalGet('admin/config/search/xmlsitemap');
$this->assertSession()->pageTextContains('One or more problems were detected with your XML sitemap configuration');
$this->assertSession()->pageTextContains('One or more problems were detected with your XML Sitemap configuration');
if ($problem_text) {
$this->clickLink('status report');
$this->assertSession()->pageTextContains($problem_text);
......@@ -386,7 +386,7 @@ abstract class XmlSitemapTestBase extends BrowserTestBase {
protected function assertNoXMLSitemapProblems() {
// @codingStandardsIgnoreEnd
$this->drupalGet('admin/config/search/xmlsitemap');
$this->assertSession()->pageTextNotContains('One or more problems were detected with your XML sitemap configuration');
$this->assertSession()->pageTextNotContains('One or more problems were detected with your XML Sitemap configuration');
}
/**
......
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