I open a report for a user that added a comment about this in another report.

While running update.php the following error message appear:

An error occurred. http://www.mysite.com/update.php?id=45&op=do <br /> <b>Fatal error</b>: Call to undefined function xmlsitemap_add_database_batch_operation() in <b>/home/public_html/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.install</b> on line <b>383</b><br />

Comments

avpaderno’s picture

Title: Undefined function called during update of the project modules » Undefined function called during update of the project modulse
Issue tags: +Installation hooks

The function is present in CVS, and the modules which require that functions contains a call to module_load_include('inc', 'xmlsitemap', 'includes/xmlsitemap.install') (which loads the file containing the function definition).

This is very similar to #375111: Call to undefined function xmlsitemap_update_sitemap(), with the difference of the called function, and that that function is contained in xmlsitemap.module which is always loaded from Drupal (because the module implements hook_boot(), and hook_exit().

If anybody can explain why this should happen, I would very glad of the help given in this, and similar issues.

avpaderno’s picture

Title: Undefined function called during update of the project modulse » Undefined function called during update of the project module
Issue tags: +Drupal core hooks
avpaderno’s picture

Title: Undefined function called during update of the project module » Undefined functions
Issue tags: -Installation hooks, -Drupal core hooks

I add also this report, and I make a unique report out of two.

The error message that appears (reported from somebody else) is the following:

An error occurred. http://www.asela.info/update.php?id=7&op=do 
Fatal error: Call to undefined function: xmlsitemap_update_sitemap() in /home/content/a/s/e/asela/html/sites/all/modules/xmlsitemap/xmlsitemap_file/xmlsitemap_file.install on line 58

Also in this case, the function is defined, as it's possible to see in the code present in the CVS repository; it was also present in the code committed 7 days ago, and it was defined even before I started to co-maintain this project.

avpaderno’s picture

Issue tags: +Installation hooks, +Drupal core hooks

This error message 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.

avpaderno’s picture

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

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

I got this error with the 6.x-1.x-dev version dated 24 March. I then went back and enabled xmlsitemap helper and uninstalled without any errors.

Thank you for all the work on this module - it is such a useful module, so your efforts are really appreciated!

Additional info:
I'd wanted to uninstall test another problem I had and then reinstall.
The first time I got the error above, I tried uninstalling by hand - i.e. dropping the tables xmlsitemap and xmlsitemap_node and deleting the menu xmlsitemap.
It seemed to work, but then when I reinstalled xmlsitemap and enabled 'XML Sitemap' and 'XML Sitemap Helper', I got the error:
* user warning: Table '.xmlsitemap' doesn't exist query: SELECT COUNT(xsm.loc) FROM xmlsitemap xsm INNER JOIN 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
/sites/all/modules/xmlsitemap/xmlsitemap/xmlsitemap.module on line 596.
I then disabled 'XML Sitemap' (leaving 'XML Sitemap Helper' enabled). I was then able to run Uninstall without the Fatal error and then re-enabled the modules successfully.

avpaderno’s picture

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

When you uninstall a module by hand, you should also remove the table row for that module present in the {system} table; differently, Drupal will not run the update functions it would.

antcw’s picture

Thank you for letting me know about that - useful information.

Just to say though, the main point I was making was I had to have the xmlsitemap helper module enabled in order to uninstall the other modules.

avpaderno’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Fixed
Issue tags: -Issue needs confirmation

I am setting this report as fixed; if you still have the problem, uninstall the modules, and re-install them. The functions reported are declared in the modules; therefore, it's not a bug of the modules.

Status: Fixed » Closed (fixed)
Issue tags: -Installation hooks, -Drupal core hooks

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