I'm on a vanilla d6 install with XML Sitemap (and all included modules) turned on. When I go to node/add/page, I get:

* warning: in_array() [function.in-array]: Wrong datatype for second argument in {path to modules dir}/xmlsitemap/xmlsitemap.admin.inc on line 402.
* warning: array_unshift() [function.array-unshift]: The first argument should be an array in {path to modules dir}/xmlsitemap/xmlsitemap.admin.inc on line 403.

Taking a look at those lines, I see:

401   // Add the submit handler to adjust the default values if selected.
402   if (!in_array('xmlsitemap_process_form_link_options', $form['#submit'])) {
403     array_unshift($form['#submit'], 'xmlsitemap_process_form_link_options');
404   }

If I change it to the code below, all is fine. Not sure how this would affect other functionality, but it seems to work.

401   // Add the submit handler to adjust the default values if selected.
402   if (is_array($form['#submit'])) {
403     if (!in_array('xmlsitemap_process_form_link_options', $form['#submit'])) {
404       array_unshift($form['#submit'], 'xmlsitemap_process_form_link_options');
405     }
406   }

See patch, attached.

CommentFileSizeAuthor
#1 xmlsitemap_admin_inc.patch639 bytesphillamb168

Comments

phillamb168’s picture

StatusFileSize
new639 bytes
rickvug’s picture

Tracking.

dave reid’s picture

Status: Patch (to be ported) » Postponed (maintainer needs more info)

I can't duplicate this with the latest code. There should be no way that form['#submit'] is not an array by the form-alter stage. Is something else altering your node forms?

rickvug’s picture

@phil - Can you give any more information for debugging? Can you confirm that this issue occurs when other modules are not enabled? I'd like to track down the root cause of the problem if this is actually being caused by another module.

dave reid’s picture

Can anyone confirm you've still had this problem with the latest code at all? If not, feel free to mark the issue as fixed.

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Fixed

Must be fixed.

Status: Fixed » Closed (fixed)

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