Unknown column error
BryanSD - July 4, 2009 - 05:12
| Project: | XML sitemap |
| Version: | 6.x-2.x-dev |
| Component: | xmlsitemap.module |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Dave Reid |
| Status: | closed |
Jump to:
Description
Getting the following error at cron runs...
Unknown column 'menu_name' in 'field list' query: INSERT INTO xmlsitemap (id, type, loc, access, status, lastmod, priority, priority_override, changefreq, changecount, menu_name) VALUES (202, 'menu', 'node/821', 0, 1, 0, NULL, NULL, 0, 0, 'primary-links') in .../sites/all/modules/xmlsitemap/xmlsitemap.module on line 805.

#1
Maybe it doesn't matter, but I noticed that the implementation of
hook_schema_alter()that would add the menu_name field is defined in the installation file. Is that normal, or should the hook be defined in the module file?#2
Where
hook_schema_alter()is located doesn't make a difference. Before the call todrupal_alter('schema', $schema), Drupal callsmodule_load_all_includes('install'); even if the hook would be in the installation file, the file would be already loaded from Drupal, by the time it executes the call todrupal_alter('schema', $schema).It seems that when the query is executed, the schema has not been altered from xmlsitemap_menu.module; maybe it happens because Drupal core code is using the schema it saved in its cache.
#3
You may be onto something. When I cleared the menu cache, many of the errors went away. Also some signs that this may not be just an XML sitemap issue. I was doing some menu changes just prior to the errors. Also, I was also seeing some issues with a couple other modules before clearing the menu cache.
#4
xmlsitemap_menu uses schema_alter and also adds the column in an update/install function. Since schemas are cached, my guess is this was a problem that drupal_write_record() was using the cached schema before the change. I can look into clearing the schema cache when these columns are added and that should prevent this error from popping up.
#5
Hmm...but running update.php should clear the caches (which include the schema cache), so I'm not sure that would do any good.
#6
My issue seemed to develop after running the update.php and after making changes with the menu. It seems when I manually clear the menu cache the reported issues with XML sitemap clears.
#7
Did you enable third-party modules that handle the menu?
#8
KimLaLuno, about the only contributed module that I'm running dealing with menus is pathauto. I'm also seeing a number of duplicate entry errors regarding the menu tables. So this issue may actually be reported to those in:
http://drupal.org/node/246653
http://drupal.org/node/333428
What's confusing me though is these errors only seem present when I have the XML sitemap module loaded.
#9
BryanSD, have you had this problem happen since your last post?
#10
I haven't seen the unknown column error the past couple weeks. Let's keep it postponed for a few more days. If I don't see the return of this error I'm ok with closing this issue.
#11
Since I haven't seen the Unknown column 'menu_name' error for some time and no one else is reporting it...I'm closing it.
#12
It's usual to set the report to fixed, so other can see the report for the next 2 weeks (and avoid open a similar one).
I am not sure if to classify this as a bug report, as the error went away alone.
#13
Automatically closed -- issue fixed for 2 weeks with no activity.