bolt / bolt/boltforms

[BUG] Date field not converted to string for insertion into database on form submission

Open
#211 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
52
Forks
54
PR merge metrics
No merged PRs in 30d

Description

## Overview

When using a `type: date` field on a BoltForms form configuration and also setting the form to save to the database - it throws an error stating that the _'Object of class DateTime could not be converted to string'_.

## Details

**BoltForms Version: 4.1.13**
Bolt Version:3.3.6
Install type: Composer install
PHP version: 7.0
Web server: Apache/2.4.18

## Reproduction

#### BoltForms Configuration

```yaml
example_form:
database:
contenttype: examples
fields:
title:
type: text
date:
type: date
submit:
type: submit
```

#### Contenttypes Configuration

``` yaml
examples:
name: Examples
singular_name: Example
fields:
title:
type: text
date:
type: date
```

This configuration should give you the error. Any form with a field of `type: date` and that saves to the database of a content type should provide the same error though.

This seems like it was raised and fixed in the past with [#3459](https://github.com/bolt/bolt/issues/3459) but maybe with recent refactoring this has crept back in?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.