Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since Release 1.0.0 Symbol field handling is different for empty strings #117

Closed
dlitvakb opened this issue Jan 2, 2017 · 2 comments
Closed
Assignees

Comments

@dlitvakb
Copy link
Contributor

dlitvakb commented Jan 2, 2017

Observed on our marketing-website when transitioning from 0.8 to 1.1.

Tests still need to be created around this.

@dlitvakb dlitvakb added the bug label Jan 2, 2017
@dlitvakb dlitvakb self-assigned this Jan 2, 2017
@dlitvakb
Copy link
Contributor Author

dlitvakb commented Jan 2, 2017

This has been tested with a pristine space with 3 symbol fields, one filled, one empty (via CMA), one nil. All 3 checks properly passed.

[3] pry(main)> client.entries.first
=> #<Contentful::DynamicEntry[test]: @fields={:name=>"Test", :empty=>""} @sys={:space=>#<Contentful::Link: @sys={:type=>"Link", :linkType=>"Space", :id=>"8jbbayggj9gj"}>, :id=>"3vuP7wtireIWM2WO2oiw4u", :type=>"Entry", :createdAt=>#<DateTime: 2017-01-02T20:07:37+00:00 ((2457756j,72457s,872000000n),+0s,2299161j)>, :updatedAt=>#<DateTime: 2017-01-02T20:15:48+00:00 ((2457756j,72948s,450000000n),+0s,2299161j)>, :revision=>2, :contentType=>#<Contentful::Link: @sys={:type=>"Link", :linkType=>"ContentType", :id=>"test"}>, :locale=>"en-US"}>
[4] pry(main)> client.entries.first.nil
=> nil
[5] pry(main)> client.entries.first.empty
=> ""
[6] pry(main)> client.entries.first.name
=> "Test"

Awaiting on more input from the marketing team to pinpoint their issue.

@realityking
Copy link
Contributor

Looking at your test entry it looks like this (from the CDA)

{
  "sys": {
    "space": {
      "sys": {
        "type": "Link",
        "linkType": "Space",
        "id": "8jbbayggj9gj"
      }
    },
    "id": "3vuP7wtireIWM2WO2oiw4u",
    "type": "Entry",
    "createdAt": "2017-01-02T20:07:37.872Z",
    "updatedAt": "2017-01-02T20:15:48.450Z",
    "revision": 2,
    "contentType": {
      "sys": {
        "type": "Link",
        "linkType": "ContentType",
        "id": "test"
      }
    },
    "locale": "en-US"
  },
  "fields": {
    "name": "Test",
    "empty": ""
  }
}

However in the marketing website the field with issues looks like this

{
  "oldFileName": null,
}

Note that the value is a literal null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants