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

Draft entries returned by Content Delivery API #177

Closed
damireh opened this issue Aug 14, 2018 · 9 comments
Closed

Draft entries returned by Content Delivery API #177

damireh opened this issue Aug 14, 2018 · 9 comments

Comments

@damireh
Copy link

damireh commented Aug 14, 2018

I have an entry that references other entries but the API is returning the draft referenced entries as part of the response; and I was under the impression it would only return published entries unless you use the preview api/token?

screenshot 2018-08-14 23 08 45

In the example above this is the response im receiving from the API

> content.experts
[<Contentful::Link id='3rwmNyX132m4A0gqWCu2go'>, <Contentful::Link id='3qkA1aMIruQaICu4EUioiM'>, <Contentful::Link id='5FZjRIRlio8ISI4Iq00IAs'>]

> content.experts.map(&:raw)
[{"sys"=>{"type"=>"Link", "linkType"=>"Entry", "id"=>"3rwmNyX132m4A0gqWCu2go"}},
 {"sys"=>{"type"=>"Link", "linkType"=>"Entry", "id"=>"3qkA1aMIruQaICu4EUioiM"}},
 {"sys"=>{"type"=>"Link", "linkType"=>"Entry", "id"=>"5FZjRIRlio8ISI4Iq00IAs"}}]

While its not actually returning the content of the draft entries; its still returning their IDs, is this expected?

@dlitvakb
Copy link
Contributor

Hi @damireh.

Which version of the SDK are you using?

Cheers

@damireh
Copy link
Author

damireh commented Aug 15, 2018

Im using the gem and its pinned to version 2.8.0

contentful (2.8.0)
  http (> 0.8, < 3.0)
  multi_json (~> 1)

@dlitvakb
Copy link
Contributor

Can you share how you're instantiating the client?

Cheers

@damireh
Copy link
Author

damireh commented Aug 15, 2018

Contentful::Client.new(
  space: "xx",
  environment: "xxx",
  dynamic_entries: :auto,
  access_token: "xxx"
)

And im fetching the entries like so

client.entries(content_type: :page, include: 3, "fields.slug" => slug).first

@dlitvakb
Copy link
Contributor

Hey @damireh,

Could you create a support request in https://support.contentful.com and request for my help?

I'll need you to send your access token, space ID and environment ID so that I can test this properly.

As this issue shouldn't be happening since the release of version 2.5.0.

Cheers

@damireh
Copy link
Author

damireh commented Aug 15, 2018

Will do 👍 Thank you

@MatteoGioioso
Copy link

Did you manage to find the problem? I have the exact same issue

@rubydog
Copy link
Collaborator

rubydog commented Nov 9, 2020

Hey @MatteoGioioso, thanks for reporting the issue. 

I am looking into it. I will get back to you if I need more details.

Cheers

@roelkok
Copy link

roelkok commented Oct 5, 2022

I'm having the same issue two years later.

Edit:
Just realized Google led me to the Ruby library. But I'm having this with the JavaScript library

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

No branches or pull requests

5 participants