Needs work
Project:
Manual Crop
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Nov 2015 at 13:42 UTC
Updated:
23 Oct 2020 at 14:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
fabianx commentedComment #3
nitebreedWith this patch I get the following error when adding a image trough Media (with 2 crops) and after setting the crops:
PDOException: SQLSTATE[HY000]: General error: 1364 Field 'x' doesn't have a default value: INSERT INTO {manualcrop} (fid, vid, style_name) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 171 [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => project_image ) in drupal_write_record()Comment #4
peximo commentedI can replicate the issue: if a user don't crop the uploaded image and the crop isn't required, the cast transforms the selection from false to an array and so the selection is saved generating the SQL error. I think we have to cast to array only the object selections. Attached patch should fix the problem.