Jump to content

Error when uploading images: field 'XXX' doesn't have a default value


Lars282
 Share

Recommended Posts

Hi.

I am suddenly receiving an error on a production site that has worked perfectly over the past years. When uploading an image to a field called article_images, I receive the following error:

Quote

 

SQLSTATE[HY000]: General error: 1364 Field 'Credits' doesn't have a default value

 

I had set up this field to accept an additional value for "Credits" with each image:

121750387_Screenshot2019-06-10at20_16_07.thumb.png.444ddd04eabb954b9aff76553304cf73.png

This is also reflected in the database:

496513838_Screenshot2019-06-10at20_17_22.thumb.png.eb1621a5c4dc08da48b77dc55c4e2220.png

I have not made any changes to the setup/settings in the past years.

Does anyone have an idea on where this could be coming from now and how to fix it? Any help would be highly appreciated!

Lars

 

Screenshot 2019-06-10 at 20.16.33.png

Link to comment
Share on other sites

3 hours ago, Lars282 said:

I have not made any changes to the setup/settings in the past years.

Does anyone have an idea on where this could be coming from now and how to fix it? Any help would be highly appreciated!

Have you updated ProcessWire, Image Extra module, or your database software recently?

This error looks like it's coming from a custom database column added by the Image Extra module, so I would recommend opening an issue on its GitHub repository (https://github.com/justb3a/processwire-imageextra), or alternatively posting a question to the Image Extra support thread. The "Credits" database column is set to require a value, and there's no default value for it; it could be just that you can't provide a value when uploading the image, which in turn results in the issue you're seeing here.

I'm really not sure why this would've worked for you before, but the module was last updated a month ago, and that update included some changes to Exception handling. In theory that could be causing the error you see here, though it does seem like a kind of a long shot.

  • Thanks 1
Link to comment
Share on other sites

7 hours ago, teppo said:

Have you updated ProcessWire, Image Extra module, or your database software recently?

I haven’t touched the install at all ...

7 hours ago, teppo said:

The "Credits" database column is set to require a value, and there's no default value for it; it could be just that you can't provide a value when uploading the image, which in turn results in the issue you're seeing here.

Where do you see this? Is there a (temporary) „quick fix“ that you can see? Change this column to optional? Change the database column to accept null values and put default to null?

Will also move this to the image extra spaces.

Thanks a lot for your help, highly appreciated!

 

Link to comment
Share on other sites

1 hour ago, Lars282 said:

Where do you see this? Is there a (temporary) „quick fix“ that you can see? Change this column to optional? Change the database column to accept null values and put default to null?

What I meant was that it doesn't accept null value, as can be seen from your screenshot. Changing it to allow null might indeed be a valid temporary fix, though that could leave some sort of underlying issue open ?

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...