Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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?
Comment | File | Size | Author |
---|---|---|---|
#23 | xmlsitemap-missing_dependency-1392710-23.patch | 409 bytes | mrmikedewolf |
#14 | xmlsitemap.code_.1392710-14.patch | 6.73 KB | helmo |
#8 | include_inc_file-1392710.patch | 531 bytes | johan.gant |
#4 | patch_1392710.patch | 478 bytes | antoniogr |
Comments
Comment #1
mshick CreditAttribution: mshick commentedI'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.
Comment #2
mshick CreditAttribution: mshick commentedI 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.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedYou should check the 2.x-dev version to see if the issue is still present.
Comment #4
antoniogr CreditAttribution: antoniogr commentedThanks mshick!. Find attached a patch with the solution of comment #2
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedDoes 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.
Comment #6
AlexanderPop CreditAttribution: AlexanderPop commented#2 works for D7 as well
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedThen lets get a patch for D7.
Comment #8
johan.gant CreditAttribution: johan.gant commentedThe patch listed above didn't apply on 7.x-2.x or 7.x-2.0-rc1. Attaching a new patch file that should.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedOh, testbot, please check the patch.
Comment #10
Jonathan Webb CreditAttribution: Jonathan Webb commentedinclude_inc_file-1392710.patch worked for me.
Comment #11
Dave ReidI 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
Comment #12
Dave ReidCommitted the same to 6.x-2.x.
http://drupalcode.org/project/xmlsitemap.git/commit/366b29f
Comment #14
helmo CreditAttribution: helmo commentedSorry to re-open this, but the fix from #11 is not sufficient.
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.
Comment #15
Dave ReidNo, 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.
Comment #16
helmo CreditAttribution: helmo commentedFYI: I've opened #1968744: module_load_all_includes does not include xmlsitemap.xmlsitemap.inc as a follow-up.
Comment #17
saitanay CreditAttribution: saitanay commentedUsing 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
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commentedSee 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.
Comment #19
Exploratus CreditAttribution: Exploratus commentedinclude_inc_file-1392710.patch also worked for me. I was getting an error page using 7, RC2.
Comment #20
cmseasy CreditAttribution: cmseasy commentedI had the same issue with version 7.x-2.0 and current dev: ONLY(!) in a multisite drupal, not in a single site environment
Patch #14 solved it.
I use current dev with patch #14 in my multisite drupal.
Comment #21
cmseasy CreditAttribution: cmseasy commentedReopen because off #20
Fatal error: Call to undefined function xmlsitemap_link_frontpage_settings() in /home/public_html/drupal-7/sites/all/modules/xmlsitemap/xmlsitemap.admin.inc on line 375
Comment #23
mrmikedewolf CreditAttribution: mrmikedewolf commentedThere is a file missing. That is the problem.
Comment #24
Dave ReidThat file is already listed below in the .info file, so now you're duplicating it.