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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | xmlsitemap_admin_inc.patch | 639 bytes | phillamb168 |
Comments
Comment #1
phillamb168 commentedComment #2
rickvug commentedTracking.
Comment #3
dave reidI 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?
Comment #4
rickvug commented@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.
Comment #5
dave reidCan anyone confirm you've still had this problem with the latest code at all? If not, feel free to mark the issue as fixed.
Comment #6
Anonymous (not verified) commentedMust be fixed.