I have a content type called wedstrijdverslag created using CCK.
This results in a content type internally called content_wedstrijdverslag.
when activating show taxonomy breadcrumb for this content type, you make a variable called taxonomy_context_breadcrumb_content_wedstrijdverslag.
This variable is too long to fit into the variable table
The first time it gets inserted without any problem as MySQL automatically truncates the value to:
'taxonomy_context_breadcrumb_content_wedstrijdver'
When you update the settings an error occurs as your code tries to do an insert again because for him, the variable does not exists (as it is truncated)
The insert error states duplicate entry as while inserting the long variable for the second time, it gets truncated again and MySql finds the previous truncated value and thus give this error
user warning: Duplicate entry 'taxonomy_context_breadcrumb_content_wedstrijdver' for key 1 query: INSERT INTO variable (name, value) VALUES ('taxonomy_context_breadcrumb_content_wedstrijdverslag', 's:1:\"1\";') in /drupal-4.7.4/includes/database.mysql.inc on line 121
Maybe this can be avoided by altering the code so that the variable names get shorter for example use tacbc_content_wedstrijdverslag instead of taxonomy_context_breadcrumb_content_wedstrijdverslag
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | taxonomy_context.patch.txt | 1.13 KB | ednique |
Comments
Comment #1
nedjoGood suggestion for a fix, I'd welcome a patch.
I suppose you could change the field definition of variable.name, setting it to e.g. varchar(100). You could also suggest a core patch increasing the length of this field,
Comment #2
nedjoNote that a patch would need to include an _update function to convert existing variables to the new format. This would mean introducing a taxonomy_context.install file, as we don't have one yet.
Comment #3
ednique commentedhere's the patch... pretty simple...
Comment #4
nancydruIn Drupal 5 and 6, a variable name can be up to 128 characters. Your name is nowhere close to that.
Comment #5
avpadernoThe report has been opened for 4.7.x-1.x-dev, not for the Drupal 5, or Drupal 6 branch.
Comment #6
avpadernoIf then the Drupal 4.7 branch is not supported anymore, that is a different topic.
Comment #7
nancydruI don't see 4.7 as a supported release on the project page. Even if it was, I don't have access to a 4.7 site to work on it. However, a quick and easy fix would be to go to the "variable" table and change the "name" column to
VARCHAR(128).