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

Matthijs’s picture

If 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

Matthijs’s picture

Status: Active » Postponed (maintainer needs more info)
Matthijs’s picture

Project: Manual Crop (old) » Manual Crop
Version: 7.x-1.x-dev » 7.x-1.4
Matthijs’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)