If I activate Simple sitemap for a content type and do a drush config-export and drush config-import, the settings are not transfered, and Simple sitemap not enabled for the content type.

To recreate: Go to Content types > Article > Menu settings > Simple XML sitemapExcluded from sitemap and enable and save:

  Do not index entities of this type
x Index entities of this type

Content of simple_sitemap.settings.yml:

custom:
  -
    path: /
    priority: !!float 1
entity_types:
  node:
    article:
      index: 1
      priority: 0.5
  taxonomy_term: {  }
  menu_link_content: {  }
settings:
  max_links: 2000
  cron_generate: true
  remove_duplicates: true
  skip_untranslated: false
  batch_process_limit: 1500
_core:
  default_config_hash: Gzm-Hm6hFi622JTbULwDXMxPi33rj_mF0pi1ggq6sFQ

On import it says:
simple_sitemap.settings create

Yet, if I go to Content types > Article > Menu settings > Simple XML sitemapExcluded from sitemap it says:

x Do not index entities of this type
   Index entities of this type 

Comments

ressa created an issue. See original summary.

ressa’s picture

I've narrowed the problem down to this bit: priority: !!float 1.
If I change it to priority: 1.0 and do a Single item import, it works fine.

So the problem is that the root path priority value isn't exported correctly.

  • gbyte.co committed a4e2097 on 8.x-2.x
    Issue #2817145 by ressa: Configuration isn't imported with config-import
    
gbyte’s picture

Version: 8.x-2.6 » 8.x-2.x-dev
Status: Active » Fixed

Thanks, this is fixed now. Please update the 1.0 priority setting by re-saving the bundle edit or bundle instance edit page in question.

ressa’s picture

Status: Fixed » Active

I just tested the latest dev-release and the problem is still there - the configuration is not imported. Content of simple_sitemap.bundle_settings.node.article.yml

index: 1
priority: '1.0'

But it still says " Do not index entities of this type" ...

gbyte’s picture

I have just tested it by indexing the bundle, exporting the config to sync, unindexing the bundle and chaning the priority and importing config from sync. Here everything is working as expected... Can you try on a fresh install? Also please do not forget to revisit the URL, as purely refreshing the page may not change form fields.

ressa’s picture

You're right, it does seem to work. I just tested it over at https://simplytest.me/ - configured the article content type for Simple Sitemap, did a full export, un-installed the module, imported the full configuration and the article content type was activated for indexing. So that's great. But for some reason, it doesn't seem to get picked up in my workflow... I will try to dig a bit more, and see if I can figure out what's going on.

ressa’s picture

Theory: Could it be because the content type is deleted and re-created during a complete config-import, and the settings are thereby lost in the process? What if we try setting the weight of the Simple XML sitemap to something "heavy", so that it is imported as late as possible in the config-import process, if that's possible?

ressa’s picture

I just did a full config-export -> config-import on a fresh install, and then ran drush config-import deploy --preview=diff an extra time (I define the "deploy" folder in my settings.php):

Only in ../deploy: .htaccess
Only in ../deploy: .include_in_git
Only in ../deploy: simple_sitemap.bundle_settings.node.article.yml

After running config-import a second time Simple Sitemap is now enabled for the Article content type, so changing the order of config-import's would probably solve this, if it is possible.

gbyte’s picture

Category: Bug report » Support request

That's strange, the sitemap's config should be imported regardless of whether the article type exists or not and should work as soon as the article type exists. You have to make sure to also import simple_sitemap.settings.yml.
If you find a solution to this, please share, until then I will set this to 'support request', as it doesn't strike me as a bug.

ressa’s picture

Everything, including simple_sitemap.settings.yml, is imported during the first config-import - only simple_sitemap.bundle_settings.node.article.yml is left out. It is really odd ...

gbyte’s picture

@ressa

Can you check if perhaps exporting/reimporting the config changes '0.1' back to !!float? Apparently this happened at least once here. Thanks.

ressa’s picture

Thanks for remembering this issue @gbyte.co :-)

These are the three Simple XML sitemap files I have in my config-import folder, together with 462 other files. Like I wrote above, Simple XML sitemap configuration is only imported if I import twice...

simple_sitemap.bundle_settings.node.article.yml

index: 1
priority: '0.5'

simple_sitemap.custom.yml

links:
  -
    path: /
    priority: '1.0'
_core:
default_config_hash: Gp8bobHmx-DuBPQoAb8KqKZXBqnca2flPqbNerZl0xQ

simple_sitemap.settings.yml

max_links: 2000
cron_generate: true
remove_duplicates: true
skip_untranslated: false
batch_process_limit: 1500
enabled_entity_types:
  - node
_core:
  default_config_hash: 8k2nJ3kHjGVhNYkfxevQzneu__VHph2Nb1LrZVV9fms
base_url: 'https://example.com'
gbyte’s picture

Status: Active » Closed (outdated)

It's been over a year and many releases of this module. If this is still a thing, feel free to reopen.