An error occurred. http://vindstille.net/update.php?id=35&op=do <br /> <b>Fatal error</b>: Call to undefined function xmlsitemap_add_database_batch_operation() in <b>/home/cl-k/web/base/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.install</b> on line <b>367</b><br /> 

Comments

avpaderno’s picture

Category: bug » support
Issue tags: +Installation hooks

xmlsitemap_add_database_batch_operation() is defined at line 18 of xmlsitemap/xmlsitemap/includes/xmlsitemap.install.inc (the path is relative to the archive root directory).

The code in xmlsitemap_node.module is the following:

function xmlsitemap_node_update_6113() {
  module_load_include('inc', 'xmlsitemap', 'includes/xmlsitemap.install');
  xmlsitemap_add_database_batch_operation(
    drupal_get_path('module', 'xmlsitemap_node') .'/xmlsitemap_node.install',
    '_xmlsitemap_node_update_database_batch'
  );
}

The code first load the required file, and then it calls the function.

I am changing the category of the report, as I don't have this issue in the test site I use; I don't have it even on my web site.

avpaderno’s picture

See also #385104: Division by zero when the database table is empty, which describes an error that should not be possible to have, if Drupal would not be able to find the xmlsitemap_add_database_batch_operation() function.

nickbits’s picture

Hi,

I get the same error on my site:

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
An error occurred. http://**********/update.php?id=33&op=do 
Fatal error: Call to undefined function xmlsitemap_add_database_batch_operation() in /home/*****************/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.install on line 367 

Nick

avpaderno’s picture

Status: Active » Postponed (maintainer needs more info)

Are you sure that all files have been copied on the server?

reinis’s picture

Hi!

Same error here:

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
An error occurred. http://sitename.com/update.php?id=14&op=do <br /> <b>Fatal error</b>: Call to undefined function xmlsitemap_update_sitemap() in <b>/var/www/html/sites/all/modules/xmlsitemap/xmlsitemap_file/xmlsitemap_file.install</b> on line <b>59</b><br />

When I go to the error page, it show differently:

Fatal error: Call to undefined function xmlsitemap_update_sitemap() in /var/www/html/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module on line 154

Update:
I cleared my website cache and reinstalled the module - same result.

Is it possible to get previous version of dev module - that one worked fine.

avpaderno’s picture

xmlsitemap_update_sitemap() is defined at line 454 of xmlsitemap.module.
I cannot tell you why your PHP installation doesn't see a function that is defined. It can be because some cache system used by the web server, or for some any other reason. I installed the project modules on my web site, and they work.

CharlieHipHop’s picture

Same problem here, and now my sitemap is toast.

nickbits’s picture

Are you sure that all files have been copied on the server?

Yes, have done it twice and checked. Have cleared Drupals cache, the server cache (well I am told that has been cleared), but no joy.

I have not installed any other modules so I assume it is not a conflict with any other module.

Cheers,
Nick

drfuzetto’s picture

I am having the same problem and I don't see the xmlsitemap_add_database_batch_operation function defined anywhere.

avpaderno’s picture

If you don't see the function, maybe you didn't copy all the files. The function is present, as you can see in the CVS repository.

I downloaded the tarball archive from Drupal, and installed it on my web site; if it would not work, I would have the same problem you have, but I don't have the problem.

mikeytown2’s picture

Disable all xmlsitemap modules
Delete the xmlsitemap dir from sites/all/modules
Re-Upload
Re-Enable

That usually fixes strange errors with modules.

stanley78’s picture

doesn't help. the same error.

eagereyes’s picture

Same problem here. I definitely copied all the files, I simply untarred the archive, as I always do. The function is defined in xmlsitemap/includes/xmlsitemap.install.inc, but perhaps that doesn't get included? It's not clear to me how this works, since I don't see a reference to the file anywhere.

mikeytown2’s picture

@stanley76 and eagereyes, what version/date shows up when you go to admin/reports/updates ?

avpaderno’s picture

The file is loaded with a call to module_load_include('inc', 'xmlsitemap', 'includes/xmlsitemap.install'). You will see that function call before the call to xmlsitemap_add_database_batch_operation().

My guess is that Drupal doesn't update the data about the module it saves, or caches in some database tables. I still have to understand why I don't have this problem in two sites where I am using XML Sitemap.

eagereyes’s picture

Okay, this is interesting. It was showing 6.x-1.x-dev (2009-Feb-08) before, which had bothered me because I think my last update is from Thursday or Friday. I untarred the new version again and it didn't change. So I deleted the entire directory and now it's showing 2009-Mar-01 and the update worked! I don't understand this.

But in any case, problem solved for me! Hope that also helps others who might still have the problem.

Edit: Actually, it looks like a whole bunch of files have been moved around, so perhaps Drupal was picking up the wrong files.

mikeytown2’s picture

eagereyes’s picture

Yeah I know, I thought I had done that - but between reverting files and digging around for that function, I guess I screwed something up again.

stanley78’s picture

i've already uninstalled module. will try to install from scratch

stanley78’s picture

definetely interesting. uninstalling and removing directory didn't help. but one day later it has worked...

maybe some magic with cache?

shuklasp’s picture

I have the same problem on my site. I removed the old code and reinstalled it. But the problem persists.

The error message is:

An error occurred. http://www.vshiksha.com/update.php?id=18&op=do <br /> <b>Fatal error</b>: Call to undefined function xmlsitemap_update_sitemap() in <b>/home/to/website/modules/xmlsitemap/xmlsitemap/xmlsitemap.install</b> on line <b>613</b><br /> 

Please look into the matter.

Regards

josh@pixael.com’s picture

same problem here!

josh@pixael.com’s picture

deleting directory and uploading new tarball update work correctly

avpaderno’s picture

Status: Postponed (maintainer needs more info) » Active
avpaderno’s picture

This error should not appear anymore, as the code has been moved to a different module; the problem of Drupal still using the outdated xmlsitemap.module path should be resolved in this way.

avpaderno’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Issue needs confirmation
eule’s picture

hi

latest dev. on the database update: XML Sitemap revision 1.1.2.27

* warning: array_merge(): Argument #2 is not an array in /srv/www/vhosts/example.com/httpdocs/update.php on line 174.
* warning: Invalid argument supplied for foreach() in /srv/www/vhosts/example.com/httpdocs/update.php on line 339.

gbrussel’s picture

I can confirm ekn33's error. Digging around, it looks like the $ret variable was changed in the 6131 update, but there is no return $ret; line as in previous updates where that same var was changed. The first error:

* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/destinationdiabetes.americandiabeteswholesale.com/html/update.php on line 174. relates to the function update_do_one wherein this line exists: $context['results'][$module][$number] = array_merge($context['results'][$module][$number], $ret);.

My guess is that the $ret variable was not defined as an array or was never passed to the update_do_one function, thereby throwing the error.

avpaderno’s picture

Category: support » bug
Status: Postponed (maintainer needs more info) » Active

I am changing the category as the last error is clearly caused by a bug.

avpaderno’s picture

Status: Active » Fixed

This has been fixed on CVS.

Thanks for your report, and for your help in tracing the cause of the bug.

Status: Fixed » Closed (fixed)
Issue tags: -Installation hooks, -Issue needs confirmation

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