I got 2 errors during xmlsitemap installation

first:
Fatal error: Call to undefined function xmlsitemap_helper_link_count() in .../sites/all/modules/xmlsitemap/xmlsitemap/xmlsitemap.module on line 91

after running update.php

second:
Fatal error: Call to undefined function xmlsitemap_helper_flag_sitemap() in .../sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module on line 204

after attempts to go to admin or front page of my site

Some previous dev versions of xmlsitemap were installed and werked normally

Comments

avpaderno’s picture

The functions exist, so it's not a bug of the module.

avpaderno’s picture

Title: 2 Errors - xmlsitemap_helper_link_count() and xmlsitemap_helper_flag_sitemap() during module installation » xmlsitemap_helper_link_count() and xmlsitemap_helper_flag_sitemap() are not found
Assigned: ravik » Unassigned
Anonymous’s picture

Could it be the change in weight of the xmlsitemap_helper module? I see a catch 22 here.

dave reid’s picture

If module code hasn't been *loaded* by PHP yet, it will say a function is not found.

googletorp’s picture

This is pretty much the same bug described in #397158: Update.php fails with "unrecoverable error"
The problem is that the helper module is not necessarily loaded during upgrade, so that causes the fail. You can just add some drupal_load('module', 'xmlsitemap_helper') calls at the top of the install files. It seems there are lots of calls to the helper functions in the install files of 6.x-1 without the helper module being loaded. At least it's easy to fix.

~Jakob

avpaderno’s picture

By update, do you mean an update from Drupal 5 to Drupal 6?

ravik’s picture

Kiam@avpnet.org if this is not a bug, what is the reason of this two errors?

Anonymous’s picture

You can just add some drupal_load('module', 'xmlsitemap_helper') calls at the top of the install files.

Or raise the value of the weight for the xmlsitemap_helper module to be the first to load but then we're back to #438194: Error during uninstall and thus the catch 22. The module .install files cannot get away with not manually loading the xmlsitemap_helper module.

dave reid’s picture

Or, implement #429598: Remove xmlsitemap_helper.module, and move the code to xmlsitemap.module and #441732: WSOD on sitemap.xml, getting rid of xmlsitemap_helper altogether and the catch-22.

avpaderno’s picture

The functions are defined, and the module containing them should be loaded at the time the update functions are called from Drupal.
I am talking of updates made in Drupal 6, when passing from an old version of the development snapshot, to the newer, and made when passing from a version with xmlsitemap_helper.module to a version still containing that module.

If then xmlsitemap_helper.module is not loaded from some reasons, I would like to understand why this happens, and if that is caused by external factors.
I can report I have never had that problem; that is the reason I am not sure it's a bug of the module.

avpaderno’s picture

Anonymous’s picture

It won't catch the rabbit; it just moves the rabbit's nest.

avpaderno’s picture

Status: Active » Fixed

This problem should be fixed in the last commits made in CVS.

avpaderno’s picture

Status: Fixed » Closed (duplicate)

This issue describes, even if the involved functions are different, the same problem described in #397158: Update.php fails with "unrecoverable error".

I am setting this report as duplicate of that report.