Lance O. Posted April 19, 2016 Posted April 19, 2016 I'm receiving the following error when uploading to an image field named "portrait": SQLSTATE[HY000]: General error: 1364 Field 'caption' doesn't have a default value Settings on this field: Valid file extensions = gif jpg jpeg png Maximum files allowed = 1 Formatted value = Single item (null if empty) Text formatters (for file descriptions) = no selection Overwrite existing files = checked Number of rows for description field = 0 The site is hosted on ServInt and I'm using ProcessWire 2.7.3 dev. Is this error that can be corrected by changing the SQL mode, or is this a ProcessWire error? Any insight is appreciated.
Lance O. Posted April 28, 2016 Author Posted April 28, 2016 Does anyone have any ideas on what is happening here? I have a lot of images I need to upload to my client's site and I can't because of this error message.
adrian Posted April 28, 2016 Posted April 28, 2016 I wonder if you are using the ImageExtra fieldtype which is where the caption is coming from. Did you uncheck the caption option? Take a look at my Github issue: https://github.com/justonestep/processwire-imageextra/issues/9 that still needs fixing.
Lance O. Posted April 28, 2016 Author Posted April 28, 2016 The field type is definitely set to "Image." There is no caption option. :-( Here is the field export, if that helps: { "portrait": { "id": 144, "type": "FieldtypeImage", "flags": 0, "name": "portrait", "label": "Portrait", "extensions": "gif jpg jpeg png", "maxFiles": 1, "outputFormat": 2, "defaultValuePage": 0, "inputfieldClass": "InputfieldImage", "collapsed": 2, "descriptionRows": 1, "adminThumbs": 1, "defaultGrid": 0, "maxReject": "", "fileSchema": 2, "icon": "image", "overwrite": null, "outputString": "", "textformatters": "", "entityEncode": "", "useTags": "", "showIf": "", "columnWidth": 100, "required": "", "requiredIf": "", "unzip": "", "maxWidth": "", "maxHeight": "", "minWidth": "", "minHeight": "" } }
adrian Posted April 28, 2016 Posted April 28, 2016 Can you show us a screenshot of the field_portrait table structure from PHPMyAdmin or similar? Or at least list out the fields/columns in that table. 1
Lance O. Posted April 28, 2016 Author Posted April 28, 2016 Hey look, a pesky caption! How did he get in there? 1
adrian Posted April 28, 2016 Posted April 28, 2016 Hey look, a pesky caption! How did he get in there? Probably from the ImageExtra module When it is removed from a field, that module either needs to remove these fields as I suggested, or set them to NULL = Yes as suggested by @mn-martin in that issue thread I linked to above. Perhaps you could also leave a comment to back up my claims 1
Lance O. Posted April 28, 2016 Author Posted April 28, 2016 Hmmm, I see that the ImageExtra 0.0.2 module is uploaded to the server, but it isn't installed. I don't remember installing it and using it, but then again, I've been working on this site since last July (!) and I may just be forgetting. Is it okay to delete "caption" from the database?
adrian Posted April 28, 2016 Posted April 28, 2016 Is it okay to delete "caption" from the database? Yup, just delete that field from the DB and it should be fine again. 1
Lance O. Posted April 28, 2016 Author Posted April 28, 2016 Deleted and works as expected. Thank you! 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now