Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Seeing this error on a site constructed by someone else:
warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in ...xmlsitemap.module on line 585.
Do not see a similar error reported elsewhere.
Comment | File | Size | Author |
---|---|---|---|
#3 | 554364-D5.patch | 915 bytes | Dave Reid |
#2 | issue-554364.patch | 965 bytes | Anonymous (not verified) |
Comments
Comment #1
Dave ReidI double checked to make sure this was the 5.x-1.6 version and not the 6.x-2.x version where I also call array_key_exists, and sure enough, line 585 of 5.x-1.6 is the problem:
Sounds like it's being passed invalid data, but without more information it's hard to know what's going wrong.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedThe use of _xmlsitemap_frequency in _xmlsitemap_format could cause the $interval value to be NULL if the array element $entry['#changefreq'] is NULL. Or perhaps this is a buggy PHP version. What is the PHP version being used? What should the default frequency be? Oh, never mind I see that _xmlsitemap_frequency already takes care of the default.
What about this patch?
Comment #3
Dave ReidDid some testing and it's when the function is passed a float value is when this happens, because array_key_exists() in PHP 4.4.0 the $key value needs to be either a string or integer. Committed the following patch to CVS.