Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When uploading a picture with the 2.x. media widget and wanting to make the manual crop on the edit page before the upload is completed, I ran into this error. Also that file style was not enabled for that content type, so it should probably not be a part of the form in the first place?
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1687-content_half_width' for key 'PRIMARY': INSERT INTO {manualcrop} (x, y, width, height, fid, style_name) 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); Array ( [:db_insert_placeholder_0] => 158 [:db_insert_placeholder_1] => 405 [:db_insert_placeholder_2] => 912 [:db_insert_placeholder_3] => 910 [:db_insert_placeholder_4] => 1687 [:db_insert_placeholder_5] => content_half_width ) i manualcrop_croptool_submit() (linje 662 af /data/disk/o1/static/vih--drupal-7.17-build-20121216-/sites/all/modules/manual-crop/manualcrop.module).
Comments
Comment #1
MatthijsIf not enabled, it should not be shown in the edit popup... Could you check if the Manual Crop settings are correctly passed to the popup (in the GET parameters)?
Concerning the PDOException: did you ever reset/change the auto increment for the files table? because if it's a new image its file id should not yet exist in the manualcrop table...
Matthijs
Comment #2
MatthijsComment #3
MatthijsComment #4
Matthijs