Closed (outdated)
Project:
Simple XML sitemap
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
15 Nov 2016 at 16:14 UTC
Updated:
5 Dec 2016 at 20:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
bryandenijsI created a simple fix that first checks for the $custom_path['path'] to be set.
Comment #3
gbyteI have not encountered this yet and I cannot see why 'path' would be empty, as it is required when providing custom paths through the interface. The service method addCustomLink actually doesn't allow an empty path. Could you please describe how to reproduce this?
Comment #4
bryandenijsI did a bit of debugging and I figured this out:
At the moment when the warning occurs, the key ($i) in the foreach loop is: 'langcode'
The value ($custom_path) is 'nl'.
I have a multilingual website and it seems this entry comes from the configuration.
You can either fix this from the root (inside the getCurtomLinks() method or deeper), or just place a 'if isset' statement here to also prevent future errors. Or do both, maybe that's even better to be sure.
Comment #5
gbyteThanks, but debugging is not the problem. I too have a multilingual site and the links are saved and retrieved correctly to and from configuration. What I am trying to ask you is for you to find out how I could reproduce this error on my installation. This error should never happen, as data input into simple_sitemap.custom should be an array of paths:
$ishould be just an index and$custom_path['path']should be the path.Could you please paste the contents of your admin/config/search/simplesitemap/custom here?
If this seems correct, can you also paste the content of your exported simple_sitemap.custom.yml here?
If possible, please try to reproduce this error on a fresh Drupal install, or after reinstalling the module on your site.
I can only debug this if I know how erroneous data came into your configuration. Did you maybe mess with the configuration? Have you run update.php after updating the module?
Thanks!
Comment #6
bryandenijsI will try to do that!
Comment #7
kevinvb commentedI have the same issue on a multilingual project.
This is my configuration
simple_sitemap.settings.yml
And simple_sitemap.custom.yml
This happens whenever I regenerate the xml sitemap.
Note: I use the api because the project has multiple links for one node. Maybe adding extra links to the sitemap through the api is the cause of this warning.
The warning is fixed after I applied the patch.
Comment #8
gbyteApparently the 'langcode' key is a key added by core and is being erroneously processed by the link generator as another custom link. This has been already fixed with #2826556: Schema issues introduced, so please use the dev version.
Comment #9
kevinvb commentedWhen will there be a new version of the module?
Because it's not recommended to use dev versions for production sites.
Comment #10
gbyteThere will be a new version of the module as soon as there are enough fixes and added functionality to justify one. Until then using the dev version is perfectly OK, especially because the only change in dev ATM is the fix for this issue. Just grab the dev now and do not update it until the next stable is available.
As a side note, the community not using the dev version of modules leads to a poorly tested dev versions which in turn leads to buggier stable releases.
Comment #11
sachariew commentedHad the same problem, switched to dev-version, problem is fixed. Thanks!
Comment #12
flocondetoileSame issue. Dev version fix it too.