Hi,
I recently upgrade to the latest version of Menu translation node and lost one of my menus. The block is now disabled and an error message is constantly displayed on the blocks page:
user warning: Duplicate entry 'name-of-theme-name-of-menu' for key 'tmd' query: INSERT INTO blocks (module, delta, theme, status, weight, region, custom, throttle, visibility, pages, title, cache) VALUES ('i18nmenu_node', 'name-of-menu', 'name-of-theme', 0, 0, '', 0, 0, 0, '', '', 1) in /path/to/drupal/includes/common.inc on line 3538.
If I move it back to the region and save, it stays in Disabled. The only solution I found was to downgrade back to version 6.x-1.0-beta2 which doesn't have this bug. Both RC and final versions have this bug.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | i18nmenu_node-1097990-12.patch | 2.17 KB | plach |
| #11 | i18nmenu_node-1097990-11.patch | 2.17 KB | plach |
| #8 | i18nmenu_node-1097990-8.patch | 1.37 KB | plach |
Comments
Comment #1
blaiz commentedComment #2
plachDid you run update.php? Are you sure that the value for the
deltacolumn is'name-of-menu'instead of'menu--name-of-menu'?Comment #3
blaiz commentedI did run update.php (which updated the i18n module itself).
For the name, I just removed the original name and replaced by this one but yeah I guess that's how it was written.
Comment #4
plachTry to run the following query on your database (backup it first!):
This should remove the error and let you assign the block to the desired region.
Comment #5
blaiz commentedThanks for the suggestion. Actually I tried that but it didn't work.
Then I noticed that one letter was missing from the name of the menu on this error message. I got me thinking that the delta of the menu might be too long and that's actually what it was. For some reason, the delta of the menu was 27 characters long, but with the additions of the menu--, it should be 33 chars long. Since the delta field in the database is limited to 32 chars, the last char got stripped and I guess the module or Drupal couldn't find which menu it was.
I just renamed the delta for this menu everywhere in my database and now it works. I'm still wondering how I was able to have a delta that was longer than 26 chars long for a menu.
Anyway, it's fixed now. If anybody has the same problem, just search for the delta of the menu in all tables of the database, and shorten it! Of course, do a backup of the whole db before any change.
Thanks
Comment #6
plachWell, prior to rc1 the delta separator used was ":" hence 1 character instead of 2 :)
Let's try to fix this.
Comment #7
plachRelated issue: #1062126: [i18n] block deltas do not work with CSS.
Comment #8
plachThe attached patch introduces a check that the [i18n] block delta does not exceed the delta column length.
Comment #9
summit commentedsubscribing,
thanks for the check-patch. But this is I think not a solution.
Could the delta column length not be expanded?
greetings, Martijn
Comment #10
plachMessing with core tables should be avoided if possible as it may lead to upgrade path issues between major core versions. How about letting just one block exceed the limit (the delta will be truncated) and then issuing a warning/ignoring any other one having a duplicate delta? This could be a good trade-off.
Comment #11
plachComment #12
plachCommitted the attached patch to HEAD.
Comment #14
lalit774 commentedyou can change length of delta field varchar(32) to varchar(64) in blocks table.