Commit e183994e authored by gbyte.co's avatar gbyte.co Committed by gbyte.co

Chaning permission for viewing sitemap to true (everyone can view).

parent 2504bce4
......@@ -3,14 +3,14 @@ simplesitemap.sitemap:
defaults:
_controller: '\Drupal\simplesitemap\Controller\SimplesitemapController::get_sitemap'
requirements:
_permission: 'access content'
_permission: 'TRUE'
simplesitemap.chunk:
path: '/sitemaps/{sitemap_id}/sitemap.xml'
defaults:
_controller: '\Drupal\simplesitemap\Controller\SimplesitemapController::get_sitemap'
requirements:
_permission: 'access content'
_permission: 'TRUE'
simplesitemap.settings:
path: '/admin/config/search/simplesitemap'
......
......@@ -57,7 +57,7 @@ class SimplesitemapCustomLinksForm extends ConfigFormBase {
'#type' => 'textarea',
'#title' => t('Relative Drupal paths'),
'#default_value' => $setting_string,
'#description' => t("Please specify drupal internal (relative) paths, one per line. Do not forget to prepend the paths with a '/' You can optionally add a priority (0.0 - 1.0) by appending it to the path after a space. The home page with the highest priority would be <em>/ 1</em>, the contact page with a medium priority would be <em>/contact 0.5</em>."),
'#description' => t("Please specify drupal internal (relative) paths, one per line. Do not forget to prepend the paths with a '/'. You can optionally add a priority (0.0 - 1.0) by appending it to the path after a space. The home page with the highest priority would be <em>/ 1</em>, the contact page with a medium priority would be <em>/contact 0.5</em>."),
);
$form['simplesitemap_custom']['simplesitemap_regenerate_now'] = array(
......
......@@ -86,11 +86,13 @@ abstract class LinkGeneratorBase extends PluginBase implements LinkGeneratorInte
* @param array $substitutions (optional)
* Substitutions (placeholder => substitution) which will replace placeholders
* with strings.
* @param string $type (optional)
* Message type (status/warning/error).
*/
protected function register_error($message, $substitutions = array()) {
protected function register_error($message, $substitutions = array(), $type = 'error') {
$message = strtr(t($message), $substitutions);
\Drupal::logger('simplesitemap')->notice($message);
drupal_set_message($message, 'error');
drupal_set_message($message, $type);
}
/**
......@@ -184,7 +186,7 @@ abstract class LinkGeneratorBase extends PluginBase implements LinkGeneratorInte
protected function get_multilang_urls_from_user_input($user_input, $options = array()) {
$user_input = $user_input[0] === '/' ? $user_input : '/' . $user_input;
if (!\Drupal::service('path.validator')->isValid($user_input)) {
$this->register_error(self::PATH_DOES_NOT_EXIST, array('@faulty_path' => $user_input));
$this->register_error(self::PATH_DOES_NOT_EXIST, array('@faulty_path' => $user_input), 'warning');
return FALSE;
}
......
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