I've tried to revert computed field from feature and got the next error:

FieldUpdateForbiddenException: field_sql_storage cannot change the schema for an existing field with data. in field_sql_storage_field_update_forbid() (line 236 of /home/drupalpro/websites/hof.loc/docroot/modules/field/modules/field_sql_storage/field_sql_storage.module).

The reason of that was comparing default value '0' (integer) with empty string '' in computed_field.install:

if ($settings['database']['data_default'] != '')  {
        $columns['value']['default'] = $settings['database']['data_default'];
      }

This condition returns FALSE so got changed field schema and as the result the exception.

Patch attached.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

illeace’s picture

I was running into this same problem and confirm that it fixes that error.

hughworm’s picture

Just had to apply this patch (fixed thanks!). Any chance it could at least get into the dev version? (It's taken me nearly 2 hours to chase this bug down :-0 )

  • ram4nd committed 428d8e1 on 7.x-1.x authored by drupalway
    Issue #2145697 by drupalway: Wrong default value while reverting from...
ram4nd’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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