[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

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
php, symfony
Domain
backend, database

Research direction

Start with the BoltForms database-saving path for a form field configured as type: date, using the provided example_form and examples content type as the reproduction. Trace the submitted date value into persistence and verify completion by submitting the form without the DateTime-to-string error and confirming the saved date.

Written by the indexing model from the issue text.

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
example_form:
  database:
    contenttype: examples
  fields:
    title:
      type: text
    date:
      type: date
    submit:
      type: submit
Contenttypes Configuration
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 but maybe with recent refactoring this has crept back in?

Dominant language
PHP
Stars
52
Forks
54
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bolt/boltforms

All issues in bolt/boltforms

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.