Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
field system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 Dec 2010 at 15:56 UTC
Updated:
4 Aug 2011 at 06:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
int commentedI think that this bug is more a major priority?
Comment #2
int commentedSo, anyone can help find the bug?
This error, happens with all fields upgraded from D6.
I just test this url site.com/admin/structure/types/manage/story/fields/body and save without any change, and give-me the same error:
DatabaseSchemaObjectExistsException: Não é possível adicionar o índice <em class="placeholder">body_format</em> à tabela <em class="placeholder">field_data_body</em>: o índice já existe. em DatabaseSchema_mysql->addIndex() (linha 433 de /home/int/sites/www.example.org/includes/database/mysql/schema.inc).Says that the index allready exists in the table field_data_body.
I'm editing, so is normal that allready exists.
With new fields don't give any error. So why is trying to add a new index for migrated fields?
I upgrade from D6.19 -> D7-rc2
Comment #3
int commentedThe same error for site.com/admin/structure/types/manage/page/fields/body.
Comment #4
marcvangendMoving this to 7.x-dev because that is where bug fixing happens. Please test with the latest dev version if the error still occurs. Also, please a list of modules you have installed and tell us about your server (php version, mysql version, etc etc).
Comment #5
int commentedIf you dont know, please don't change it!!
Nothing was changed in dev vs rc2, because only have one commit in cvs for preview logo in Bartik theme.
And is important to reference that the Drupal version is the RC2. (and is because of this, that this field exists)
Anyone can anyone please verify if yours migrated sites in this link www.site.com/admin/structure/types/manage/page/fields/body or alike, work's to save without change nothing..
Comment #6
EvanDonovan commented@int: Standard policy is always that bugs are tested in dev. You can comment that you were using RC2, but if you move the version to rc2, it won't show up in lists for the developers. Also, all bugs need to be reproduced against the latest code, which is why it was set to postponed.
We also will need more information as marcvangend stated.
Comment #7
int commentedI don't know why you are asking this, if the not migrated field's work's fine.
I just asking for someone test editing and save migrated core fields.
php: 5.3.3
mysq: mariadb 5.2.4
Modules: BUEditor, video_filter, xmlsitemap, backup, Global Redirect, mollom, pathauto, token, Translatable Regions, Transliteration, Language assignment, Locale updater.
None of this modules implements hook for fields content.
@EvanDonova, also the bug about the beta/rc bugs don't show in the list for developers was fixed for some time now.. and D7-RC2 is the last code, the dev version only have an javascript fix.
Comment #8
marcvangendint, if I did anything to upset you, I apologize, I'm only trying to help. Maybe you're right: maybe all this information is not relevant in your case. However a large part of bug fixing is simply ruling out possibilities, so that's why these questions are always asked when someone creates a bug report.
Comment #9
chx commentedI can verify the bug happening (I can't remember a verification like this before): I added
$this->drupalPost('admin/structure/types/manage/story/fields/body', array(), t('Save settings'));to the end ofNodeBodyUpgradePathTestCase::testNodeBodyUpgradeand I getCannot add index <em class="placeholder">body_format</em> to table <em class="placeholder">field_data_body</em>: index already exists.. Looking at the issue.Comment #10
chx commentedMoved a few lines around in _update_7000_field_create_field and it works.
Comment #11
sunLet's prepend a comment for this drupalPost() -- otherwise, I foresee that someone will remove it (lacking knowledge what and why that test is important).
Powered by Dreditor.
Comment #12
chx commentedTo finish the issue, comment, node, system (for upload / file module) and taxonomy needs further upgrades to fix up the botched fields. Also, the test needs a quick comment.
Comment #13
yched commented@chx: nice catch.
Added / adjusted comments.
Will give a try to the update funcs to fix the existing. I make no promises for tonight, though.
Comment #14
yched commentedOops @ patch rolling.
Comment #15
tstoecklerFor the next reroll: Missing word: "can BE edited". Leaving at needs review.
Powered by Dreditor.
Comment #16
int commentedyched, I'm waiting for the fix, thanks for help.
Comment #17
chx commentedint, I should have known from the above replies that you eager to help, this is great, but also that you are not too familiar with the process and so I should have written up my reasons for leaving it at needs review -- is this the correct solution? is there more to be done? I need expert eyes on the patch. The remaining work is small and if I set it to needs work then there will be a lot fewer eyeballs.
For example, does the patch solve the problem for you? So far , noone tested it with a real life database.
Comment #18
yched commentedAdded an upgrade function to fix existing broken fields.
*Not fully tested*, so please backup your database before applying and testing - or wait till tomorrow night that I can fully test.
Comment #19
chx commentedOne thing for sure, + $data['columns'] = $field['columns']; is not necessary 'cos of the unset($data['columns'] in field crud.
Comment #20
int commented@chk, I tested the patch, and didn't work. So I change the patch to needs work.. Only after i saw that the path for "fix the existing" fields isn't in the patch #14. (so i edited the post #16). My bad sorry..
My site is allready migrated for production.
I just test migrate again with the patch in #14 and it edit old fields works very well.
So for me #14 is good(RTBC), needs work for the existing rc2 sites.
Comment #21
peter feddo commentedI'm encountering the same problem at admin/structure/types/manage/story/fields/body when trying to modify fields. D7 is throwing the error: DatabaseSchemaObjectExistsException: Cannot add index body_format to table field_data_body: index already exists. in DatabaseSchema_mysql->addIndex() (line 433 of /var/www/vhosts/#####.com/httpdocs/D7/includes/database/mysql/schema.inc).
I tested the above patch with no success.
FYI: Testing on a D7 update of a fresh D6 install (with just a few test content nodes in place).
Comment #22
int commented@Peter Feddo you test the patch in the post #18 ? Do you test migrate again you site? or you test run update.php after apply the patch #18?
Comment #23
mo6I tested the patch #18 on an upgrade of a clean D6.19 install with a few test nodes and it fixes the problem.
Comment #24
yched commentedThanks for the feedback.
@chx #19: correct. I'll update the patch tonight. I'll also double check the upgrade func.
Thus, needs work for now.
Comment #25
peter feddo commentedAh, update.php fixed the problem. Thank you for the tip.
Comment #26
int commentedOne typo in:
Comment #27
yched commentedFixed chx's remark in #19, and tested the upgrade in various case (from a D6 db, from an existing D6->D7 upgraded db, from an existing D7 db). The upgrade function is correct.
Patch attached.
However, I noticed another bug : in dbs upgraded from D6,
drupal_get_schema('field_data_body')does not contain the 'foreign keys' entry.That's it for tonight. Still CNW :-(.
Comment #28
int commentedthe patch #27 work's great for my existing fields. But leave it needs works, since i don't know the impact of the missing 'foreign keys'.
Comment #29
yched commentedThe issue with 'foreign keys' I mentioned in #27 is actually a different bug, I'll open a separate issue.
The patch for the critical fix at hand here can be reviewed and committed independantly.
--> back to 'patch needs review' for #27
Meanwhile, the fact that fields created during a d6 upgrade don't have their 'foreign keys' is not critical, and can be fixed later on. 'foreign keys' are only runtime meta data for drupal_get_schema(), and don't affect actual db schemas.
Comment #30
chx commentedWe are good to go then.
Comment #31
dries commentedI could reproduce this bug, and can confirm that this patch fixed the problem.
I committed the patch to CVS HEAD.
The code comments could use some work but that was pretty minor, so decided to go ahead anyway.
Comment #32
rfaySorry, couldn't handle the minor typo in the hook_update_N()
Comment #34
int commentedTwo failed changing the commentary.. It's seems that the HEAD is boken.
Main content rendering fallback (SystemMainContentFallback) [System] 64 2 0
Message Group Filename Line Function Status
Modules status has been updated. Other system.test 1303 SystemMainContentFallback->testMainContentFallback()
Admin interface still available. Other system.test 1309 SystemMainContentFallback->testMainContentFallback()
Set to needs review to test again...
Comment #35
int commented#32: drupal.field_update_996160_32.patch queued for re-testing.
Comment #36
yched commentedSure.
Comment #37
webchickCommitted to HEAD. Thanks!
Comment #38
yched commentedResetting title for history's sake.
Comment #40
WilliamB commentedI've a fresh install of 7.2.
I then copy the module, theme and libraries folder from my dev site.
I apply a dump of my dev database.
Everything works fine but i get this error when trying to create a new content type.
DatabaseSchemaObjectExistsException : La table field_data_body existe déjà. dans DatabaseSchema->createTable() (ligne 629 dans D:\Profiles\gboullan\Bureau\sog71\includes\database\schema.inc).
Everytime i try and create a new content type the body field is missing by default and i get this error.
EDIT: I guess it's because i should've cleared the database before applying the dump, the body field table was left over from clean install but wasn't referenced anymore in whatever other table is referencing existing fields.
Just had to delete the empty table: field_data_body and field_data_body_revision and it worked fine.
Comment #41
stevenpatzPlease stop hijacking closed threads.
Comment #42
Mesut58 commentedGet the following error when upgrading from version 7.7 to 6.22.
Notice: unserialize() [function.unserialize]: Error at offset 44 of 48 bytes in variable_initialize() (line 727 of /var/www/vhosts/mesutersoy.com/httpdocs/includes/bootstrap.inc).
The following updates returned messages
node module
Update #7006
* Failed: DatabaseSchemaObjectExistsException: Table field_data_body already exists. in DatabaseSchema->createTable() (line 629 of /var/www/vhosts/mesutersoy.com/httpdocs/includes/database/schema.inc).
Comment #43
raj8 commentedGetting the same error : from 6.28 to 7.24
Update #7006
Failed: DatabaseSchemaObjectExistsException: Table field_data_body already exists. in DatabaseSchema->createTable()
Comment #44
mwaindegwa commentedSame here am getting the same error while upgrading from drupal 6.29 to drupal 7.25
The following updates returned messages
node module
Update #7006
Failed: DatabaseSchemaObjectExistsException: Table field_data_body already exists. in DatabaseSchema->createTable() (line 657 of C:\xampp\htdocs\YYY\includes\database\schema.inc).
taxonomy module
Update #7005
Failed: DatabaseSchemaObjectExistsException: Table taxonomy_update_7005 already exists. in DatabaseSchema->createTable() (line 657 of C:\xampp\htdocs\YYY\includes\database\schema.inc).