When hitting admin/settings/xmlsitemap/settings, I get the following error:

Fatal error: Call to undefined function xmlsitemap_link_frontpage_settings() in /srv/drupal/sites/example.com/modules/xmlsitemap/xmlsitemap.admin.inc on line 387

It seems that the function definitions in xmlsitemap.xmlsitemap.inc are not being picked up by Drupal 6. It is also bad form to mix several class and function definitions in the same file.

Moving the function definitions (including xmlsitemap_link_frontpage_settings() ) to the .module file seems to fix things at first glance.

Does anyone the exact cause of the problem, and whether that is a valid fix?

Files: 
CommentFileSizeAuthor
#14 xmlsitemap.code_.1392710-14.patch6.73 KBhelmo
#8 include_inc_file-1392710.patch531 bytesjohan.gant
PASSED: [[SimpleTest]]: [MySQL] 525 pass(es).
[ View ]
#4 patch_1392710.patch478 bytesantoniogr
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch patch_1392710.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

I'm having the same problem. On one site things are working fine, on two others I get a whitescreen. In a different environment the same code for those sites is fine.

Very odd issue.

I added the following to line 281, just after "function xmlsitemap_settings_form()":

module_load_include('inc', 'xmlsitemap', 'xmlsitemap.xmlsitemap');

And it solved the problem.

I suspect that files included in the info file are perhaps not reliably included... Really not sure about that one.

Status:Active» Postponed (maintainer needs more info)

You should check the 2.x-dev version to see if the issue is still present.

StatusFileSize
new478 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch patch_1392710.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Thanks mshick!. Find attached a patch with the solution of comment #2

Status:Postponed (maintainer needs more info)» Needs work

Does this only affect 6.x or do we need a patch for 7.x? The patch file name isn't formatted correctly is the reason I flagged it as needs work. See http://drupal.org/node/707484 which explains how to create a patch.

#2 works for D7 as well

Version:6.x-2.0-rc1» 7.x-2.x-dev

Then lets get a patch for D7.

StatusFileSize
new531 bytes
PASSED: [[SimpleTest]]: [MySQL] 525 pass(es).
[ View ]

The patch listed above didn't apply on 7.x-2.x or 7.x-2.0-rc1. Attaching a new patch file that should.

Status:Needs work» Needs review

Oh, testbot, please check the patch.

Status:Needs review» Reviewed & tested by the community

Version:7.x-2.x-dev» 6.x-2.x-dev
Status:Reviewed & tested by the community» Patch (to be ported)

I committed a similar patch that uses module_load_all_includes('inc', 'xmlsitemap') so that it works for any other modules that implement hook_xmlsitemap_link_info(). http://drupalcode.org/project/xmlsitemap.git/commit/031bae4

Version:6.x-2.x-dev» 7.x-2.x-dev
Status:Patch (to be ported)» Fixed

Status:Fixed» Closed (fixed)

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

Status:Closed (fixed)» Needs work
StatusFileSize
new6.73 KB

Sorry to re-open this, but the fix from #11 is not sufficient.

<?php
module_load_include
('inc', 'xmlsitemap', 'xmlsitemap.xmlsitemap');
?>

This code will look for a file called xmlsitemap.inc in the directory of every module.
ref: http://api.drupal.org/api/drupal/includes%21module.inc/function/module_l...

But instead the function we're seeking is in xmlsitemap.xmlsitemap.inc.

So I think the title in #1316822: Move xmlsitemap.xmlsitemap.inc functions() to correct location was a good one, I think the patch in http://drupal.org/node/1316822#comment-6765530 would do the job.

That patch no-longer applied, and I think moving the funcitons to xmlsitemap.inc would be slightly better then to xmlsitemap.module

Please review.

Status:Needs work» Closed (fixed)

This code will look for a file called xmlsitemap.inc in the directory of every module.
ref: http://api.drupal.org/api/drupal/includes%21module.inc/function/module_l...
But instead the function we're seeking is in xmlsitemap.xmlsitemap.inc.

No, you misunderstand that function. It's loading a file with the extension .inc, from the module 'xmlsitemap', and with the name 'xmlsitemap.xmlsitemap'. So in result it will load sites/all/modules/xmlsitemap/xmlsitemap.xmlsitemap.inc as designed.

Please file a new follow-up issue rather than re-opening a closed issue if you do not think this is correct.

Status:Closed (fixed)» Needs work

Using version 7.x-2.0-rc2 , which seems to have the fix for this issue included.

But still seeing the error when settings for the module are saved:
[xx-xxx-2013 xx:xx:xx] PHP Fatal error: Call to undefined function xmlsitemap_link_frontpage_settings() in /xxx/xxx/xxxx/xxxx/xxx/sites/all/modules/xmlsitemap/xmlsitemap.admin.inc on line 375

Status:Needs work» Closed (fixed)

See Dave's comment in #15 and helmo's comment in #16. You'll need to test with the -dev version to determine if it is fixed or not.

include_inc_file-1392710.patch also worked for me. I was getting an error page using 7, RC2.