Enabling of the module fails with following message:

user warning: Table 'database.prefix_xmlsitemap' doesn't exist query: SELECT COUNT(xsm.loc) FROM prefix_xmlsitemap xsm INNER JOIN prefix_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 /var/www/localhost/htdocs/sites/all/modules/xmlsitemap/xmlsitemap.module on line 283.

I'm not sure whether the module was installed once. However, I removed possible leftovers and cleared the cache without success.

Comments

avpaderno’s picture

Status: Active » Postponed (maintainer needs more info)

Did you also remove any reference to XML sitemap present in the system table too?

heirecka’s picture

Something like DELETE FROM system WHERE name LIKE '%xmlsitemap%';?

Then yes.

avpaderno’s picture

Status: Postponed (maintainer needs more info) » Active

Yes, it what I meant; thanks for the reply.

avpaderno’s picture

Actually, the installation file correctly call drupal_install_schema(); if you are installing the module, the table should be created.

The only problem that you could notice is when a module that depends on XML sitemap is installed before XML sitemap, and then it calls a function that executes a query on the XML sitemap table. I think that Drupal should avoid such situations, and install first XML sitemap, but I am not sure what happens when the modules have different weights.

function xmlsitemap_install() {
  drupal_install_schema('xmlsitemap');
  variable_set('xmlsitemap_chunk_size', 1000);
  db_query("UPDATE {system} SET weight = 5 WHERE name = 'xmlsitemap'");
}
Anonymous’s picture

Status: Active » Postponed (maintainer needs more info)

This sounds like a duplicate of #509764: Trying to help for bug search... sitemap.xml not populating and #512660: Problem with 0.5. Please research these and let me know if it is the case with you.

avpaderno’s picture

This report seems a duplicate of #509764: Trying to help for bug search... sitemap.xml not populating, as the error reported in both is the same.

If this is the case, the database table is not created because of a module that changes the locale settings of PHP; that causes the 0.5 value to be translated in 0,5 (which is not accepted by the database engine).

heirecka’s picture

Thanks alot!

After reading the mentioned bug reports I found the following bug of the gallery module: #389452: setlocale() calls in Gallery wrongly transform float numbers in SQL

Disabling the gallery module, installing xmlsitemap and re-enabling gallery worked for me.

dave reid’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

If you re-enable gallery, whenever it tries to insert float numbers into the database, it is still going to cause problems.

heirecka’s picture

Sorry to carry on with this issue, but i have to disagree. Strangely inserting float numbers seems to work after installation. However, I'm searching for a lightweight replacement for gallery anyway.

Anonymous’s picture

It may by chance work for insert/update and not as the default value due to features of PHP or MySQL. This however isn't a bug for xmlsitemap and the problem needs resolve at the source; not worked around it by xmlsitemap.

dave reid’s picture

It will definitely come back anytime another module is installed that has the same float-type column in its database.