When trying to uninstall and re-install story or fields module the creation of fields that already exist in the DB throws and error and fails.

for instances we need to change the field_create_instance() call to be wrapped like this:

if (!empty($instance['field_name']) &&  !field_read_field($instance['field_name'])) {
    field_create_instance($instance);
}

And for when we create fields something like this:

if (!field_read_field($audio['field_name'])){
     field_create_field($audio);
}

Comments

musicalvegan0’s picture

Status: Active » Closed (duplicate)
crookednumber’s picture

Assigned: Unassigned » crookednumber
Status: Closed (duplicate) » Active

Re-opening. Sorry, I should have assigned this to myself at the start. (Until recently, it was just me in the queue - so that wasn't necessary. But I'll be more conscientious in the future.)

crookednumber’s picture

Priority: Normal » Critical
crookednumber’s picture

Status: Active » Closed (fixed)

[7.x-1.x 2e8bdee] Issue #1956510 by CrookedNumber: Modules cannot be installed repeatedly.
2 files changed, 21 insertions(+), 7 deletions(-)

http://drupalcode.org/project/npr.git/commitdiff/2e8bdee

crookednumber’s picture

Bug here. Should be testing for non-existence of INSTANCE rather than field.

[7.x-1.x 789e2e5] Issue #1956510 by canofcorn, CrookedNumber: should check for INSTANCE existence, not field
1 files changed, 1 insertions(+), 1 deletions(-)

crookednumber’s picture

Issue summary: View changes

wrapping code in code elements