Currently variable names are like social_stats.cron_settings.social_stats_url_root, since in Drupal 8 config variable names starts with module name, so we can safely name variable social_stats.cron_settings.url_root.
Added default values to some config variables in config schema file, $config->get() takes only one argument, removed second arg from get calls, default values for those variables is stored in config schema file.
Removed old settings form code.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sharique created an issue. See original summary.

vijaycs85’s picture

+++ b/config/install/social_stats.settings.yml
@@ -0,0 +1,10 @@
+content_types_article:

I would go with

content_types:
  article:
    fb: true
    twitter: true
  page:
    fb: true
    twitter: true
Sharique’s picture

vijaycs85’s picture

+++ b/social_stats.module
@@ -25,20 +25,20 @@ function social_stats_help($route_name, RouteMatchInterface $route_match) {
+      $content_type_settings = $settings->get('content_types.' . $types->id());

nitpick: $content_type_settings = \Drupal::config('social_stats.settings).get('content_types);

then
we can check if (isset($content_type_settings[$type->id()]))

This will make the if condition lighter.

vijaycs85’s picture

Status: Needs review » Reviewed & tested by the community

Anyway, it looks much better.

Sharique’s picture

Did that nitpick and bit more.

AjitS’s picture

Thank you @vijaycs85 for the reviews!

@Sharique : Could you please attach an interdiff so that the review is easy?

Sharique’s picture

FileSize
2.6 KB

@Ajit here is interdiff, I already committed this code, don't know why it is not showing here, also not showing in commit list page https://www.drupal.org/node/2080003/commits.

AjitS’s picture

Status: Reviewed & tested by the community » Fixed

Thank you! I'd assume that the commit not showing up here should be a temporary issue. However, if this continues we should create an issue in the webmasters issue queue.

Marking this issue as fixed, with appropriate credits. Thank you again!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.