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: ...@@ -3,14 +3,14 @@ simplesitemap.sitemap:
defaults: defaults:
_controller: '\Drupal\simplesitemap\Controller\SimplesitemapController::get_sitemap' _controller: '\Drupal\simplesitemap\Controller\SimplesitemapController::get_sitemap'
requirements: requirements:
_permission: 'access content' _permission: 'TRUE'
simplesitemap.chunk: simplesitemap.chunk:
path: '/sitemaps/{sitemap_id}/sitemap.xml' path: '/sitemaps/{sitemap_id}/sitemap.xml'
defaults: defaults:
_controller: '\Drupal\simplesitemap\Controller\SimplesitemapController::get_sitemap' _controller: '\Drupal\simplesitemap\Controller\SimplesitemapController::get_sitemap'
requirements: requirements:
_permission: 'access content' _permission: 'TRUE'
simplesitemap.settings: simplesitemap.settings:
path: '/admin/config/search/simplesitemap' path: '/admin/config/search/simplesitemap'
......
...@@ -57,7 +57,7 @@ class SimplesitemapCustomLinksForm extends ConfigFormBase { ...@@ -57,7 +57,7 @@ class SimplesitemapCustomLinksForm extends ConfigFormBase {
'#type' => 'textarea', '#type' => 'textarea',
'#title' => t('Relative Drupal paths'), '#title' => t('Relative Drupal paths'),
'#default_value' => $setting_string, '#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( $form['simplesitemap_custom']['simplesitemap_regenerate_now'] = array(
......
...@@ -86,11 +86,13 @@ abstract class LinkGeneratorBase extends PluginBase implements LinkGeneratorInte ...@@ -86,11 +86,13 @@ abstract class LinkGeneratorBase extends PluginBase implements LinkGeneratorInte
* @param array $substitutions (optional) * @param array $substitutions (optional)
* Substitutions (placeholder => substitution) which will replace placeholders * Substitutions (placeholder => substitution) which will replace placeholders
* with strings. * 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); $message = strtr(t($message), $substitutions);
\Drupal::logger('simplesitemap')->notice($message); \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 ...@@ -184,7 +186,7 @@ abstract class LinkGeneratorBase extends PluginBase implements LinkGeneratorInte
protected function get_multilang_urls_from_user_input($user_input, $options = array()) { protected function get_multilang_urls_from_user_input($user_input, $options = array()) {
$user_input = $user_input[0] === '/' ? $user_input : '/' . $user_input; $user_input = $user_input[0] === '/' ? $user_input : '/' . $user_input;
if (!\Drupal::service('path.validator')->isValid($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; 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