WD php: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'image__teaser__file_image' for key [error]
'PRIMARY': INSERT INTO {file_display} (name, weight, status, settings) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1,
:db_insert_placeholder_2, :db_insert_placeholder_3); Array
(
[:db_insert_placeholder_0] => image__teaser__file_image
[:db_insert_placeholder_1] => 5
[:db_insert_placeholder_2] => 1
[:db_insert_placeholder_3] => a:1:{s:11:"image_style";s:6:"medium";}
)
in drupal_write_record() (line 7106 of /Users/shenliang/Sites/drupal7/includes/common.inc).
Cannot modify header information - headers already sent by (output started at /opt/local/lib/php54/pear/drush/includes/output.inc:37) [warning]
bootstrap.inc:1212
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'image__teaser__file_image' for key 'PRIMARY': INSERT INTO {file_display} (name, weight, status, settings) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array
(
[:db_insert_placeholder_0] => image__teaser__file_image
[:db_insert_placeholder_1] => 5
[:db_insert_placeholder_2] => 1
[:db_insert_placeholder_3] => a:1:{s:11:"image_style";s:6:"medium";}
)
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 1844768-duplicate-file-display-error-on-install.patch | 1.5 KB | xtfer |
Comments
Comment #1
ParisLiakos commentedThis table belongs to file entity.
So you uninstalled file_entity and when you re enabled got this?
Comment #2
shenzhuxi commentedsorry I should post it to media module.
Comment #3
ParisLiakos commentedWhy media? this table is created by this module and it is being filled up by this as well..
Comment #4
shenzhuxi commentedIt only happens when I uninstall and re-enable media module.
Comment #5
ParisLiakos commentedOK, getting this back to media then
Comment #6
nerilka commentedI had the same issue : installed media and uninstalled it, then install it again => Bam! Warning!
After reading this, I have unintalled Media and File entity, then enabled them again and now I don't have anymore the warning and it seems working right...
I should precise, I did this with the 7.x-2.0-unstable7 version.
Comment #7
OnkelTem commentedThe full message text is:
Steps to reproduce:
file_entitymoduleThe problem is in
media_install()function as it tries to insert default records which are already there.Comment #8
OnkelTem commentedComment #9
xtfer commentedI'm tempted to think this should be fixed in file_entity's file_display_save() method, but failing that, checking if they exist first would be helpful.
Comment #10
xtfer commentedComment #11
dave reidComment #12
aaron commentedThis does the job. Thanks a lot!
Comment #13
devin carlson commented#10: 1844768-duplicate-file-display-error-on-install.patch queued for re-testing.
Comment #14
devin carlson commentedCommitted #10 to 7.x-2.x.
Thanks!