Running update.php after installing the latest XML Sitemap fails with:

An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference. Please continue to the error page.

Going to the "error page" shows:

Fatal error: Call to undefined function xmlsitemap_helper_update_sitemap() in /home/prodosh/public_html/drupal/sites/prodosh.com/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module on line 179

The error message is:

An error occurred. http://example.com/update.php?id=22&op=do <br /> <b>Fatal error</b>: Call to undefined function xmlsitemap_helper_update_sitemap() in <b>/home/example/public_html/drupal/sites/example.com/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.install</b> on line <b>399</b><br /> 

Comments

conniec’s picture

I can confirm this error. Happened to me, too

Connie

sistegraf’s picture

Confiming same error.

Fatal error: Call to undefined function xmlsitemap_helper_update_sitemap() in /home/EXAMPLE/public_html/EXAMPLE.COM/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module on line 179

Tino

avpaderno’s picture

Status: Active » Postponed (maintainer needs more info)

Do you see a directory named xmlsitemap_helper into the directory where the project code is copied?

lmw94002’s picture

I can confirm the same error. Note the error now prevents me from opening the Modules admin page so I cannot disable / remove the module.

I do see the directory listed with the others.

avpaderno’s picture

Status: Postponed (maintainer needs more info) » Active

The module is automatically enabled by xmlsitemap.module during the update; if you didn't run update.php, or update.php didn't enable the module, you can run update.php, and select one of the last updates available for xmlsitemap.module.

lmw94002’s picture

I tried dropping all the tables & deleting all the xmlsitemap* variables & removed the module. Re-ran update.php, restarted the box and tried to start fresh...

I placed a new copy of the module in. Tried to enable it and received the error. I tried to run update.php and received the error. Now I can no longer access the modules admin page and receive the error.

all saying the xmlsitemap_helper_update_sitemap() function is bad.

avpaderno’s picture

Category: support » bug

Running update.php doesn't help, if you don't select the right update number
For the archive generated by Drupal on March 10, the correct update number is 6128; for the archive Drupal will generate at midnight UTC, the correct update number is 6131.

The function is defined in xmlsitemap_helper, as the CVS repository shows.

avpaderno’s picture

I am changing the category, as I cannot reproduce this issue on two web sites I run.

avpaderno’s picture

Category: bug » support

I am changing the category, as I cannot reproduce this issue on two web sites I run.

conniec’s picture

Category: bug » support

got it to keep from failing by deleting module from server, which unlocks drupal site. Then run update.php without it. Then reinstall and run update.php. Doesn't lock up drupal site anymore, but doesn't creat xmlsitemap either. :{

Connie

avpaderno’s picture

If you keep to get such error, the only solution is to uninstall all the XML Sitemap modules, delete all the files, re-copy them, and enable the modules (including xmlsitemap_helper.module).

gateone’s picture

It is what it says:

There is no xmlsitemap_helper_update_sitemap() function in xmlsitemap_helper.module !

lmw94002’s picture

Category: support » bug

I got it to work... sorta...

I had to drop tables and variabes and move the module out. Ran update.php. Moved the module back in. Then I did the module uninstall. Restarted everything for good measure.

Copied the module back in. Re-enabled them one at a time. No more errors.

However, my sitemap that is generated seems to be empty.

avpaderno’s picture

See my previous comment; the function exists, and it's also present in the code committed to CVS.

avpaderno’s picture

Category: bug » support

I am changing the category, as I am not having the issue on two web sites I installed XML Sitemap on.

alpinejag’s picture

I had the same problem.

Robert de Bock’s picture

Same problem here;

  • Can't run update.php, the error shown: An error occurred. http://example.com/update.php?id=19&op=do
    Fatal error: Call to undefined function xmlsitemap_helper_update_sitemap() in /var/www/example/html/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.install on line 399
  • Can't disable the module; blank screen.
  • Can't add content; blank screen.
  • Can't access the admit item XML Sitemap; blank screen.
alpinejag’s picture

I had basically do what Kiam suggested to get my site working again. After I removed all the module files I was able to access the admin/modules menu again and uninstall the module. Uploaded the module again, installed it and all seems well.

Not sure why the problem started in the first place though as I went through all the normal steps to update the module.

Robert de Bock’s picture

Status: Active » Fixed

Fixed by overwriting the latest release over the existing module files.

druvision’s picture

Version: 6.x-1.x-dev » 5.x-2.x-dev
Status: Fixed » Active

It also happens with the latest Drupal 5 dev. Can you apply the same fix?

avpaderno’s picture

If you are having the same problem, uninstall all the XML Sitemap modules, and then re-install them (checking that all the files are overridden); re-enable them, and be sure to also select xmlsitemap_helper.module.

avpaderno’s picture

Component: xmlsitemap_node.module » Code
Anonymous’s picture

When I upgraded i had exactly the same issue as originally reported.

Original files were deleted before loading new files

From what I remember, as i was unable to disable the module, I removed the module from the server, refreshed the screen which allowed me to get back to the modules page, then dropped the module back to the server and all worked well. I have a sitemap. If their is any info I can provide...

rootwork’s picture

Category: support » bug

This happened to me as well. Original files were deleted, ran update.php, still got the errors.

I was able to comment out the function in xmlsitemap_menu.module in order to re-load the module page. When I scrolled down to the bottom "XML Sitemap: Helper" was DISABLED and also greyed out. Submitting the page anyway seemed to enable it.

Then I un-commented out that line and everything seems to work. But this seems to clearly be a bug.

avpaderno’s picture

Category: bug » support

If it would be a bug, then I would have had the same problem on the web sites I am running XML Sitemap.
The report was open for an issue about a not defined function being called by the code; as the function (xmlsitemap_helper_update_sitemap()) is defined in a module, the report doesn't describe a code bug.

rootwork’s picture

Kiam: I won't change the status back. But in my experience, bugs are inconsistent all the time; just because they don't show up in every instance doesn't mean they're not bugs. There are rendering bugs, for instance, that show up in IE and not Firefox; PHP bugs that show up in some versions of PHP and not others, etc. That a bug happens unexpectedly is sort of the definition of a bug. But let's dispense with the semantics and try to address the issue.

So far I count 9 people in this thread who have experienced this support request. It may be that we all simply munged the installation in some crucial way to produce this support request, though several people say they followed the instructions (remove old directory, unpack new directory, run update.php) exactly. It could also be that in combination with some other module, Drupal configuration, server setup or other outside parameters, a support request pops up.

Several people have now provided the required steps for reporting a support request (from /node/add/project-issue/drupal):

* What are the steps required to reproduce the [support request]?
* What behavior were you expecting?
* What happened instead?

What additional information can we provide that would help you address this critical support request that several people seem to be having with the most recent update? I for one am happy to test out patches and run tests to see under what conditions this support request arises.

N.Simpson’s picture

I ran into the same issue when I added this to my multi-site installation.

I did notice in build/modules that the 'helper' module was not enabled on my version yet was listed as a prerequisite for sitemap-node. I hadn't spotted the helper module previously, is this new? If so, is there any possibility that this issue is caused by people upgrading from a version prior to the introduction of this module?

N.Simpson’s picture

It may be unrelated but I get the following error after reinstalling and reactivating the module:
user warning: Unknown column 'xsm.changed' in 'where clause' query: SELECT COUNT(xsm.loc) FROM sitename_xmlsitemap xsm INNER JOIN sitename_system s ON s.name = xsm.module WHERE s.type = 'module' AND s.status = 1 AND xsm.changefreq <> 0 AND xsm.changed <> 0 AND (xsm.priority >= 0 AND xsm.priority <= 1) in /home/public_html/drupal-sites/all/modules/xmlsitemap/xmlsitemap/xmlsitemap.module on line 596.

rootwork’s picture

N.Simpson: I had the same experience as you with the helper being disabled even though it was required, and getting a similar error popping up -- and yes, the helper module is new. Submitting the module page (for me at least) seemed to enable the required module that wasn't enabled in the update.

N.Simpson’s picture

As per my initial suspicion, if I edit the database of the site and change the status of the xmlsitemap_helper module from 0 to 1 the error disappears and the site (mostly) functions again.

The SQL I used was something like:
UPDATE `dbname`.`system` SET `status` = '1' WHERE CONVERT( `system`.`filename` USING utf8 ) = 'sites/all/modules/xmlsitemap/xmlsitemap_helper/xmlsitemap_helper.module' LIMIT 1 ;

I still see the warning I added in post #28 but this should at least be a step in the right direction for resolving this problem.

N.Simpson’s picture

Also, I get an 'Access Denied' page when I try to view sitemap.xml

avpaderno’s picture

Status: Active » Postponed (maintainer needs more info)

Are you referring to the 6.x-1 branch, or the 5.x-2 branch?

Anonymous’s picture

First I have put the version back to 6.x-1.x-dev which was the version originally reported against but was changed in #20

I wonder if the sequence of upgrades makes a difference.

I came from a drupal 5.x-1.6 version back in December to 6.x-0.x-dev and then onwards, in various steps in January and then my last update which was the 12th march release if i remember correctly where i saw the issue in #23

N.Simpson’s picture

Version: 5.x-2.x-dev » 6.x-1.x-dev
Status: Postponed (maintainer needs more info) » Active

I'm referring to the 6.x-1 branch. Was there an update when the helper module was created which enabled it by default? If so, was the enabling of this module at install time removed in a future release? This is just one possible cause of the issue that I could think of, apologies if it can't happen that way but I'm not intimately familiar with the whole drupal module development/installation process.

rootwork’s picture

Yes, this was all about the 6 branch (didn't see that it had been changed above). It does seem to be fixed in the most recent (April 1) dev release. I'm pretty sure the cause was that the required helper module wasn't being turned on by running update.php. It seems to be getting turned on now, at least in my tests.

N.Simpson and midkemia if the newest dev version works for you too then we can mark this as fixed. Make sure you remove the old directory before unpacking the new one (though I think we were all doing that already anyway).

avpaderno’s picture

the last release just introduced the French translation of the modules strings that has not been submitted by me.
I am not working on the module in these days as I am not at home.

N.Simpson’s picture

Looks like the version gets rid of the error message. I am still stuck with the 'Access Denied' page when I try to view sitemap.xml. Any suggestions? I am using XML Sitemap revision 1.1.2.30

avpaderno’s picture

See the project page for the access denied error.

avpaderno’s picture

Status: Active » Fixed

See the project page on how to update to the last development snapshots; if you still have the problem, uninstall the modules, and then reinstall them.

Renee S’s picture

I can confirm I'm getting this too.

Race.it’s picture

I removed the module, ran update, then put the module back in and ran update, then I get this

The following queries were executed
xmlsitemap module
Update #6000
DROP TABLE {xmlsitemap_additional}
Failed: CREATE TABLE {xmlsitemap} ( `lid` INT NOT NULL auto_increment, `loc` VARCHAR(255) NOT NULL DEFAULT '', `module` VARCHAR(255) NOT NULL DEFAULT '', `type` VARCHAR(32) NOT NULL DEFAULT '', `id` INT unsigned NOT NULL DEFAULT 0, `sid` INT unsigned NOT NULL DEFAULT 0, `language` VARCHAR(12) NOT NULL DEFAULT '', `changed` INT unsigned NOT NULL DEFAULT 0, `changefreq` INT unsigned NOT NULL DEFAULT 0, `priority` FLOAT NOT NULL DEFAULT 0.5, PRIMARY KEY (lid), INDEX link_module (module(25)), INDEX link_type (Array()), INDEX link_language (language), INDEX link_changed (changed), INDEX link_priority (priority) ) /*!40100 DEFAULT CHARACTER SET UTF8 */
Update #6100
No queries
Update #6101
No queries
Update #6102
No queries
Update #6103
No queries
Update #6104
No queries
Update #6105
No queries
Update #6106
No queries
Update #6107
No queries
Update #6108
No queries
Update #6109
No queries
Update #6110
No queries
Update #6111
No queries
Update #6112
No queries
Update #6113
No queries
Update #6114
No queries
Update #6115
No queries
Update #6116
UPDATE XMLSITEMAP_CHUNK_SIZE
Update #6117
No queries
Update #6118
UPDATE MODULE SETTINGS
UPDATE {system} SET weight = 2 WHERE name = 'xmlsitemap'
Update #6119
No queries
Update #6120
No queries
Update #6121
No queries
Update #6122
No queries
Update #6123
No queries
Update #6124
No queries
Update #6125
No queries
Update #6126
Failed: DELETE FROM {xmlsitemap}
Update #6127
No queries
Update #6128
No queries
Update #6129
No queries
Update #6130
No queries
Update #6131
No queries
Update #6132
Failed: CREATE TABLE {xmlsitemap} ( `lid` INT NOT NULL auto_increment, `loc` VARCHAR(255) NOT NULL DEFAULT '', `module` VARCHAR(255) NOT NULL DEFAULT '', `type` VARCHAR(32) NOT NULL DEFAULT '', `id` INT unsigned NOT NULL DEFAULT 0, `sid` INT unsigned NOT NULL DEFAULT 0, `language` VARCHAR(12) NOT NULL DEFAULT '', `changed` INT unsigned NOT NULL DEFAULT 0, `changefreq` INT unsigned NOT NULL DEFAULT 0, `priority` FLOAT NOT NULL DEFAULT 0.5, PRIMARY KEY (lid), INDEX link_module (module(25)), INDEX link_type (Array()), INDEX link_language (language), INDEX link_changed (changed), INDEX link_priority (priority) ) /*!40100 DEFAULT CHARACTER SET UTF8 */
ENABLE 'xmlsitemap_helper' MODULE
FORCE SITEMAP UPDATE

If i try to uninstall I get this

Fatal error: Call to undefined function xmlsitemap_helper_link_count() in /usr/local/drupal/sites/all/modules/xmlsitemap/xmlsitemap/xmlsitemap.module on line 177

Race.it’s picture

Ok, got it working, what I needed to do was uninstall the xml site map modules in the same order as they are enabled, (i.e. if one depends on another you could not try to uninstall them both at the same time) thus the last one to be uninstalled was xmlsitemap, then I reenabled it and did the update.php, this worked fine.

DanielJohnston’s picture

Same issue, on latest 6.x-1.x-dev, on a site upgraded from Drupal 5. Am going to try deleting all tables and variables then reinstalling. However, advice on which variables I need to delete from which table would be handy - I can see the xmlsitemap tables but variables in other tables are a tad more tricky to find.

avpaderno’s picture

The variable names all start with xmlsitemap.

avpaderno’s picture

Status: Fixed » Active
googletorp’s picture

StatusFileSize
new5.26 KB

I've run into most of the bugs described here during a D5->D6 site upgrade, and I believe and have found the reason and fix to the upgrade bug from drupal 5 to drupal 6.x-1.x-dev version.

There are two scenarios when upgrading from D5, either disabling the XMLsitemap module before running update.php or after. I received different php fails disabling XMLsitemap or not. Both update attempts fails in a similar way, the call to an undefined function.

#1 with XMLsitemap active it fails over xmlsitemap_helper_link_count
#2 with XMLsite disabled before update.php in run, it fails over xmlsitemap_helper_update_sitemap

As you can see both functions is defined in the xmlsitemap_helper module. My guess is that #1 is not a bug, but just a problem with XMLsitemap not loading the function because it hasn't been upgrade, so you should just disabled the module before upgrade. #2 is a bug. The problem is, that when running the update script while the module is disabled, the helper functions wont be loaded so when they are called, it result in php fail. The solution is simply to load the helper module before calling the function. I've tested this on a single site, and it seems to fix the issue #2. You do, however, need to disabled the module first, to avoid error #1.

I have uploaded a patch with the fix

~Jakob

DanielJohnston’s picture

@Jakob: Thanks for the suggestions and the patch. I ended up deleting all xmlsitemap module and storage files, removing xmlsitemap tables and variables from the database, running update.php a few times to make sure nothing was lurking, then reinstalling from absolute scratch.

Sadly, even then I quickly ran into problems, possibly related to it wanting me to run update.php straight after a clean install. Table errors were logged on every page view and every sitemap entry creation, making site access intermittent for anonymous users (but not for me, strangely). I've now removed xmlsitemap, deleted the details from Google Webmaster Tools, and will only come back to this module when it reaches at least RC status. I suspect I've been rather spoiled by using other dev-status modules on live sites without problem.

Anonymous’s picture

You might want to keep an eye on all the activity in the issue queue. There is a major rewrite happening and I would suggest not even trying at the moment unless you're actively wanting to help develop the code. There have been many commits today so you can try again tomorrow if you want but I don't think you'll find it working quite right just yet.

oldphotos’s picture

I've done this twice now - and still have the same error. I get it whenever I try to enable any of the xml sitemap modules.

avpaderno’s picture

Status: Active » Fixed

The original issue should have been resolved in the last commits.

Renee S’s picture

@oldphotos: have you tried deleting the entire directory contents and then uploading the new release? That fixed it for me - seems there was something in there that was making it angry, possibly a corrupt file.

Status: Fixed » Closed (fixed)

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