Jump to content

Error when uploading image: Field 'caption' doesn't have a default value


Lance O.
 Share

Recommended Posts

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.

Link to comment
Share on other sites

  • 2 weeks later...

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": ""
    }
}
Link to comment
Share on other sites

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 :)

  • Like 1
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...