Fatal error: Call to undefined function xmlsitemap_helper_link_count() in E:\devshop\www\xxxxxx\htdocs\sites\all\modules\xmlsitemap\xmlsitemap\xmlsitemap.module on line 164

Comments

avpaderno’s picture

The function is defined at line 90 of xmlsitemap_helper.module.

webchick’s picture

Yeah, I think I got this the other day, too.

The issue is that if you uninstall the module as you do other modules (check off everything and click "Uninstall"), due to alphabetical sorting, xmlsitemap_helper.module comes before modules like xmlsitemap_node and xmlsitemap_user. Therefore, the module's already uninstalled at the point that these modules are running their hook_uninstall()s.

I believe there's a way to invoke a function call even in disabled modules or, failing that, the correct .inc file or whatever could just be included from the uninstall hooks for extra insurance.

webchick’s picture

Oh, hrm. Except it was in xmlsitemap.module?

Oh, I see. The xmlsitemap_helper module obviously has to be disabled in order to uninstall xmlsitemap, and therefore none of the function calls to it in uninstall hooks will work.

avpaderno’s picture

The xmlsitemap_helper_link_count() function should only be called from the functions that generate the site map content; the error message can be ignored while uninstalling the project modules.

I can add some code lines to verify the module is enabled. Would the code help in someway?

Anonymous’s picture

@webchick: Yes, you are correct.

@Kiam: This is a complete uninstall. The xmlsitemap_helper module has been deactivated. The hook_uninstall functions require functions from xmlsitemap_helper but Drupal doesn't load them because it has been deactivated. Reactivating the module wouldn't be nice to the user expecting it to have been uninstalled.

avpaderno’s picture

I checked the code as it is after my last commits, and I don't find any call to functions declared in xmlsitemap_helper.module. The function reported in the error message you wrote is only called from the menu callback for sitemap.xml (or from a function called from that menu callback).

avpaderno’s picture

Status: Active » Fixed

I am changing the status, as the uninstall code doesn't call any functions defined in another module.
If I am missing something, please re-open the issue.

Anonymous’s picture

The uninstall code might not but the sitemap.module does causing the whole uninstall process to just quit. I think that the fix might be as easy as changing the weight of the xmlsitemap_helper module to be lower higher than the rest of the modules so it is uninstalled last; but that is just an assumption.

EkaMei’s picture

Status: Fixed » Active

Is there anyway to resolves this issue at the moment? Or is this uninstallation issue a 'harmless' bug that I can safely ignore?

Anonymous’s picture

The workaround I've used is to reinstall the xmlsitemap_helper module, uninstall the modules not uninstalled by this bug and then uninstall xmlsitemap_helper again.

avpaderno’s picture

I think your assumption is correct; if the module is the last to be uninstalled, the functions it declares will be still be available when the other modules are uninstalled.

avpaderno’s picture

Status: Active » Needs review

I added the code to change the module weight to 15. I hope this helps.

avpaderno’s picture

- Duplicated comment -

EkaMei’s picture

This certainly helped. Thank you!

avpaderno’s picture

Status: Needs review » Fixed

I think the issue can be considerate fixed.

Status: Fixed » Closed (fixed)

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