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.
Comments
Comment #1
avpadernoMaybe 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?Comment #2
avpadernoWhere
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.
Comment #3
bryansd commentedYou 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.
Comment #4
dave reidxmlsitemap_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.
Comment #5
dave reidHmm...but running update.php should clear the caches (which include the schema cache), so I'm not sure that would do any good.
Comment #6
bryansd commentedMy 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.
Comment #7
avpadernoDid you enable third-party modules that handle the menu?
Comment #8
bryansd commentedKimLaLuno, 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.
Comment #9
dave reidBryanSD, have you had this problem happen since your last post?
Comment #10
bryansd commentedI 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.
Comment #11
bryansd commentedSince I haven't seen the Unknown column 'menu_name' error for some time and no one else is reporting it...I'm closing it.
Comment #12
avpadernoIt'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.