Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

datetime_created does not pick current datetime #551

Closed
KPChakravarthy opened this issue Oct 31, 2018 · 1 comment
Closed

datetime_created does not pick current datetime #551

KPChakravarthy opened this issue Oct 31, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@KPChakravarthy
Copy link

KPChakravarthy commented Oct 31, 2018

Bug Report

Issue Description

I have a collection named stories with the following fields

ID: the default field
title: a text field with field type = string
story: a WYSIWYG editor
banner_image: a featured image
categories: a list of categories to select from
created_by: a User field with field type = User Created
created_on: a DataTime field with field type = DateTime Created

API call =
GET /items/stories?fields=*.*

Response =

       {
           "id": 8,
           "title": "Test",
           "banner_image": {
               "id": 1,
               "storage": "local",
               "filename": "love.jpg",
               "title": "Love",
               "type": "image/jpeg",
               "uploaded_by": 1,
               "uploaded_on": "2018-10-30T19:21:38+00:00",
               "charset": "binary",
               "filesize": 52498,
               "width": 800,
               "height": 450,
               "duration": null,
               "embed": null,
               "folder": null,
               "description": "",
               "location": "",
               "tags": [],
               "metadata": null,
               "data": {
                   "full_url": "http://thewriteaddict.com/directus/public/uploads/_/originals/love.jpg",
                   "url": "/uploads/_/originals/love.jpg",
                   "thumbnails": [
                       {
                           "url": "http://thewriteaddict.com/directus/public/thumbnail/_/200/200/crop/good/love.jpg",
                           "relative_url": "/thumbnail/_/200/200/crop/good/love.jpg",
                           "dimension": "200x200",
                           "width": 200,
                           "height": 200
                       }
                   ],
                   "embed": null
               }
           },
           "story": "<p>Test story</p>",
           "created_on": null,
           "author": {
               "id": 1
           },
           "categories": [
               {
                   "id": 14,
                   "story_id": "8",
                   "category_id": "1"
               }
           ]
       }
   ],
   "public": true
}

As you can see, the created_on returns null

Expected Behavior

created_on being a User Created interface must pick up the current datetime stamp

Actual Behavior

Field has null value

Technical Details

  • Device: Linux Shared Server
  • OS: Linux
  • Web Server: Apache 2.4.33
  • PHP Version: 7.1.0
  • Database: MySQL 5.5.61-38.13
  • Install Method: cloned master
@wellingguzman wellingguzman added the bug Something isn't working label Oct 31, 2018
@wellingguzman wellingguzman added this to To do in v2.0.5 Oct 31, 2018
@wellingguzman wellingguzman moved this from To do to In progress in v2.0.5 Oct 31, 2018
@wellingguzman wellingguzman added this to High priority in Bug Triage Oct 31, 2018
@wellingguzman wellingguzman moved this from In progress to To do in v2.0.5 Oct 31, 2018
Bug Triage automation moved this from High priority to Closed Oct 31, 2018
v2.0.5 automation moved this from To do to Done Oct 31, 2018
@wellingguzman
Copy link
Contributor

Hey @KPChakravarthy, this patch 5a89124 should fix the problem auto filling datetime_created with the current datetime.

samvasko pushed a commit to samvasko/api that referenced this issue Nov 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
Bug Triage
  
Closed
v2.0.5
  
Done
Development

No branches or pull requests

2 participants