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
Comment #1
avpadernoThe 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(), andhook_exit().If anybody can explain why this should happen, I would very glad of the help given in this, and similar issues.
Comment #2
avpadernoComment #3
avpadernoI 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:
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.
Comment #4
avpadernoThis 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.
Comment #5
avpadernoComment #6
antcw commentedI 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.
Comment #7
avpadernoWhen 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.
Comment #8
antcw commentedThank 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.
Comment #9
avpadernoI 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.