Problem Saving Content With Empty Date Field

A forum for Bolt related questions / issues

Problem Saving Content With Empty Date Field

Postby jlester » Mon Mar 10, 2014 11:20 pm

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 ]
jlester
 
Posts: 3
Joined: Mon Mar 10, 2014 11:09 pm

Re: Problem Saving Content With Empty Date Field

Postby Bob » Fri Mar 21, 2014 4:50 pm

Which version of bolt is this? make sure you update to the latest version! :-)
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm

Re: Problem Saving Content With Empty Date Field

Postby jlester » Fri Mar 28, 2014 7:05 pm

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.
jlester
 
Posts: 3
Joined: Mon Mar 10, 2014 11:09 pm


Return to Bolt Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron