I was updating my Drupal site and noticed there were updates for the Phone 7.x-2.x-dev release.
I proceeded to update, then in drush the following error showed up...
Cannot add field <em class="placeholder">field_data_field_office_phone_number</em>.<em class="placeholder">field_office_phone_number_number</em>: field already exists. [error]
Performed update: phone_update_7200I went into one of my content types that uses the "phone" field to try and edit/save it and got an error..
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_data_field_office_phone_number0.field_office_phone_number_value' in 'where clause': SELECT DISTINCT field_data_field_office_phone_number0.entity_type AS entity_type, field_data_field_office_phone_number0.entity_id AS entity_id, field_data_field_office_phone_number0.revision_id AS revision_id, field_data_field_office_phone_number0.bundle AS bundle FROM {field_data_field_office_phone_number} field_data_field_office_phone_number0 WHERE (field_data_field_office_phone_number0.field_office_phone_number_value IN (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2, :db_condition_placeholder_3)) AND (field_data_field_office_phone_number0.deleted = :db_condition_placeholder_4) LIMIT 1 OFFSET 0; Array ( [:db_condition_placeholder_0] => 0 [:db_condition_placeholder_1] => 1 [:db_condition_placeholder_2] => 2 [:db_condition_placeholder_3] => 3 [:db_condition_placeholder_4] => 0 ) in field_sql_storage_field_storage_query() (line 585 of /var/wwwroot/intranet_dev/modules/field/modules/field_sql_storage/field_sql_storage.module).
Any idea why the update breaks the phone field type? Is there anything I can do to fix this...?
Comments
Comment #1
c3rberus commentedLooks like its trying to add a field that already exists? Can we add some code to check to see if the field already exist and perhaps run a update on the field instead of a addField().
Comment #2
cdale commentedCan you provide information on the sites usage history of the phone module? Did you use 1.x branch then add the 2.x branch? Were you recently using the 2.x branch, then updated to the "newer" dev release of the 2.x branch?
The 2.x branch is still in development, and the update code has not been fully tested yet. One solution would be to uninstall then re-install the phone module, but I'm not sure if that will cause any data loss.
Comment #3
c3rberus commentedHi cdale,
I was using the 2.x dev branch and I did a drush up which indicated there was a newer "dev" release. So my upgrade path was from dev to dev.
I could uninstall and re-install, but i would have to remove the phone field first which would lose data for content that uses that field type.
Maybe i'll just wait until 2.x stable release then upgrade to that.. the only reason I chose to update was just to stay on top of latest releases.
Comment #4
dwightaspinwall commentedLike exxoid, I've always been on the 7.x-2.x-dev branch and get the same error when attempting the update:
Comment #5
cdale commentedThe dev branch was/is in heavy development. Anyone who was using the previous 2.x branch will need to completely uninstall the phone module and re-install.
Comment #6
dwightaspinwall commentedSounds like data loss to me. I guess it was our mistake to use this module in production. Just to be clear, there is no guarantee that any future 7.x-2.x-dev releases won't require uninstall/reinstall?
IMO, once even a dev version of a module is released there's an implied commitment to preserve data. Otherwise there is no incentive to ever use/test a module until it achieves non-dev status.
Comment #7
cweagansThat is correct. There is no such guarantee, nor is there ever such a guarantee with -dev releases. We may start providing an upgrade path, but not until the module is a little more stable. It's still under very heavy development. I am going to unpublish the dev release for now.