Page 1 of 1

Problem Saving Content With Empty Date Field

PostPosted: Mon Mar 10, 2014 11:20 pm
by jlester
I've created a new contenttype with a couple non-required date fields. Unfortunately, I can not save the content if these fields are left empty. When I attempt to save the form it throws the following MySQL error: Invalid datetime format: 1292 Incorrect date value: '' for column 'rebate_start' at row 1

Am I missing something? Is there a way to have an optional date field?

I've tried setting the field to nullable in the database, but Bolt detects the change and switches it back to not nullable.

If it helps this is what my contenttype looks like:

Code: Select all
products:
    name: Products
    singular_name: Product
    fields:
        part_num:
            type: text
            label: Part Number
        rebate_amt:
            type: float
            label: Rebate Amount
        rebate_start:
            type: date
            label: Rebate Start
            required: false
        rebate_end:
            type: date
            label: Rebate End
            required: false
        rebate_file:
            type: file
            label: Rebate File
    taxonomy: [ categories, tags ]

Re: Problem Saving Content With Empty Date Field

PostPosted: Fri Mar 21, 2014 4:50 pm
by Bob
Which version of bolt is this? make sure you update to the latest version! :-)

Re: Problem Saving Content With Empty Date Field

PostPosted: Fri Mar 28, 2014 7:05 pm
by jlester
I just updated to the latest 1.5.2 and the error still occurs. The field, even if there is nothing in it, is being sent as an empty string in the query, causing a MySQL error of an invalid date format.