Jump to content

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


Recommended Posts

Posted

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.

  • 2 weeks later...
Posted

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.

Posted

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": ""
    }
}
Posted

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.

  • Like 1
Posted
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
Posted

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?

Posted

Is it okay to delete "caption" from the database?

Yup, just delete that field from the DB and it should be fine again.

  • Like 1

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
  • Recently Browsing   0 members

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