Reinstalled the module with drush and got the errors:

WD php: FieldException: Attempt to create field name splash_offer_markup     [error]
which already exists and is active. in field_create_field() (line 85 of
.../modules/field/field.crud.inc).
Cannot modify header information - headers already sent by (output started at[warning]
/root/.drush/drushrc.php:2) bootstrap.inc:1224
FieldException: Attempt to create field name <em class="placeholder">splash_offer_markup</em> which already exists and is active. in field_create_field() (line 85 of .../modules/field/field.crud.inc).
Drush command terminated abnormally due to an unrecoverable error.           [error]
ini_set('memory_limit',          '2048M');
Cannot modify header information - headers already sent by (output started at[warning]
/root/.drush/drushrc.php:2) popup_onload.module:221

I also get and error now when adding a new splash offer

Notice: Undefined index: locale in splash_offer_form() (line 189 of .../sites/all/modules/splash_offer/includes/splash_offer.admin.inc).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'splash_offer-1-0-0-und' for key 'PRIMARY': INSERT INTO {field_data_splash_offer_markup} (entity_type, entity_id, revision_id, bundle, delta, language, splash_offer_markup_value, splash_offer_markup_format) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => splash_offer [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => splash_offer [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => Age verification [:db_insert_placeholder_7] => ) in field_sql_storage_field_storage_write() (line 451 of .../modules/field/modules/field_sql_storage/field_sql_storage.module).

Comments

fox_01’s picture

Issue summary: View changes
fox_01’s picture

I noticed that the db table field_config_instance -> column field_name = splash_offer_markup will NOT get deleted on uninstall

fox_01’s picture

With a manual installation over the admin interface i get the error
FieldException: Attempt to create field name <em class="placeholder">splash_offer_markup</em> which already exists and is active. in field_create_field() (line 85 of .../modules/field/field.crud.inc).

devd’s picture

Priority: Normal » Critical

Yes same issue exists.

The following code should be work but unfortunately not working.

  $field= field_info_field('splash_offer_markup');
  if (!empty ($field)) {
    // Fetch the instance (object)
    $field = field_info_instance('splash_offer', 'splash_offer_markup', 'splash_offer');
    // Delete it.
    field_delete_instance($field);
    
    // Fetch the instance (object)
    $field = field_info_field('splash_offer_markup');
    // Delete it
    field_delete_field($field);
  } 

So right now you can use the following code in hook_uninstall().

db_delete('field_config')
    ->condition(
        db_and()
          ->condition('field_name', 'splash_offer_markup')
          ->condition('storage_type', 'field_sql_storage')
          ->condition('storage_module', 'field_sql_storage')
      )->execute();
  
  $splash_offer_flag = db_delete('field_config_instance')
    ->condition(
        db_and()
        ->condition('bundle', 'splash_offer')
        ->condition('field_name', 'splash_offer_markup')
        ->condition('entity_type', 'splash_offer')
      )->execute();
  
  if (db_table_exists('field_revision_splash_offer_markup')) {
    db_drop_table('field_revision_splash_offer_markup');
  }
  if (db_table_exists('field_data_splash_offer_markup')) {
    db_drop_table('field_data_splash_offer_markup');
  }
aklump’s picture

Assigned: Unassigned » aklump
Status: Active » Fixed

Thank you all who contributed to finding this issue. It has been addressed in the latest release: 7.x-1.0

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.