simple_sitemap queries the database for entities to add to the sitemap. In the case of menu links, not all the menu entries are entities, as menu entries can be defined in module.links.menu.yml files or dynamically by other modules.
Though technically not a bug, this may generate some confusion as a simple_sitemap user can generate a sitemap including a menu, and only having some of the menu link items appearing in the resulting sitemap.
To reproduce this behavior, install a new Drupal 8.2.7 site using the Standard profile then install simple_sitemap 8.x-2.9. The Standard profile has a links.menu definition for the front page defined in core/profiles/standard/standard.links.menu.yml which adds a 'Home' menu link item that is not used by the simple_sitemap module. To make this obvious, delete the default custom link generated by simple_sitemap for frontpage and enable the simple sitemap indexing on the 'main' menu. The resulting sitemap.xml will contain no links.
A possible solution would be to create a special case for the menu link item bundle in which to load the menu links from the MenuTree instead of querying the database, as MenuTree keeps track of menu link items added from all sources.
Comments
Comment #2
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedSounds reasonable, would you like to have a go at patching the latest dev of the module? :)
Comment #3
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedClose to solving this now through implementing #2931911: Allow overriding entity generator plugin for specific entity types.
Comment #5
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedThis is implemented now. Please bear in mind, that
default menu links
cannot override menu link sitemap settings, likecustom menu links
are able to.Please test it for me and look out for any potential menu link indexation bugs.