Hello,

I get this error with any version of xml sitemap that I have tried, what can I do ?

user warning: Unknown column 'tags' in 'where clause' query: UPDATE xmlsitemap_term SET previously_changed = last_changed, last_changed = 1215438903 WHERE tid IN(4, tags) in SITE.COM/includes/database.mysql.inc on line 172.

Thanks.

Comments

hongpong’s picture

Yes I am getting this too. I tried wiping out my xmlsitemap_term table, and reinstalling that (sub)module via devel. Doesn't help - maybe you have to reinstall the full module? That doesn't quite seem to work either.

deepesh’s picture

Same here, Why nobody is replying ? I think its a bug and needs a FIX.

wwwoliondorcom’s picture

When I disable the xmlsitemap term module, no more problem !

momper’s picture

same problem ...

greetings momper

scoutladen’s picture

even same problem... any answer?

momper’s picture

Priority: Normal » Critical

any idea?

it's critical ...

deepesh’s picture

Seems the module is abandoned.

scoutladen’s picture

adding the column "tags" to "xmlsitemap_term" work for me...

BLOFISTIS’s picture

HOW?

scoutladen’s picture

with phpmyadmin

schnippy’s picture

I had the same problem as well and spent some time sifting through the xmlsitemap_term module to see if this was a versioning issue with the database structure.. I couldn't see any reference to this and I'm not sure how it inter-relates yet but I tried scoutladen's suggestion and it seems to be back up and running after I ran the following alter command on my table:

alter table xmlsitemap_term add column tags varchar(255);

The type declaration of varchar(255) is arbitrary -- not sure what we should be using here..

avpaderno’s picture

Title: xml sitemap problem, error: user warning: Unknown column 'tags' in 'where clause' query: UPDATE xmlsitemap_term SET » Unknown column 'tags' in 'where clause' query: UPDATE xmlsitemap_term
asak’s picture

Same problem.

Will try the "add your own table" solution ;)

avpaderno’s picture

Title: Unknown column 'tags' in 'where clause' query: UPDATE xmlsitemap_term » Unknown column 'tags' in 'where clause'

I am not sure this is the solution to the problem. It can be the module created a wrong SQL query, and that tags should be repleaced with $tags (i.e.).
I think this issue needs to be investigated more.

avpaderno’s picture

The values that in a SQL query are placed in IN() are not column names, but values (strings, or numbers) that must be compared with the content of a column.
In this case, the SQL query select all the rows where the column tid contains or '4', or 'tags'. The problem is that the code doesn't surround the string with the apices.

This is caused by one of the following SQL queries:

  db_query("UPDATE {xmlsitemap_term} SET previously_changed = last_changed, last_changed = %d WHERE tid IN(". implode(', ', array_keys($node->taxonomy)) .")", $node->created);
  
  db_query("UPDATE {xmlsitemap_term} SET previously_changed = last_changed, last_changed = %d WHERE tid IN(". implode(', ', $terms) .")", $node->changed);
  
  db_query("UPDATE {xmlsitemap_term} SET previously_changed = last_changed, last_changed = %d WHERE tid IN(". implode(', ', array_keys($node->taxonomy)) .")", time());

Adding a tags column in the module sitemap avoids the error message, but doesn't make the module work as it should.

avpaderno’s picture

Assigned: Unassigned » avpaderno

I am changing the code to resolve this issue. Basically, I will backport a couple of helper functions that help in creating query like those without to forget to surround the strings with apices.

avpaderno’s picture

Title: Unknown column 'tags' in 'where clause' » Unknown column 'tags' in 'where' clause

It has been fixed.

avpaderno’s picture

Status: Active » Fixed

I forgot to change the status.

Status: Fixed » Closed (fixed)

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