brockf / hero

Hero Framework: A powerful Content Management System (CMS) and eCommerce framework built on CodeIgniter.
Other
53 stars 45 forks source link

Can add duplicate field to content type #9

Open swanback opened 10 years ago

swanback commented 10 years ago

Backup your database first. Add field called "Field 1" to a content type. Add that same field again. It adds the duplicate field to the customm_fields table, and then throws a db error at the last moment: pic1 pic4 pic5

Now delete the duplicate field, and here's where it starts to go bad: pic2 because indeed, the field has been deleted from the content type table, even though you only deleted one of the two same-named fields. pic3 And now there is no apparent way to recover without manually intervening in the db. You can't delete the original field and re-add it to sync things back up because it fails on dropping the field from the table:

Can't DROP 'field_1'; check that column/key exists

ALTER TABLE test DROP field_1

So you have to add a field called field_1 to the affected content type record structure by hand, then you can delete and re-add to make sure everything is good.