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

Friends.getAppUsers Bug (REST) #18

Closed
mhuggins opened this issue Nov 10, 2010 · 2 comments
Closed

Friends.getAppUsers Bug (REST) #18

mhuggins opened this issue Nov 10, 2010 · 2 comments

Comments

@mhuggins
Copy link

On line 660 of mini_fb.rb (v1.1.5), within the MiniFB::fetch method, you check if the result is an array and immediately attempt to utilize Hashie to convert its structure. Unfortunately, the REST call to friends.getAppUsers returns an array of Facebook user ID's, which this method incorrectly attempts to convert (and ultimately has an error occur in Hashie). Instead, the raw array data provided by friends.getAppUsers should be returned to the calling method.

if res_hash.is_a? Array # fql  return this
    res_hash.collect! { |x| Hashie::Mash.new(x) }
else
    res_hash = Hashie::Mash.new(res_hash)
end
@appoxy
Copy link
Collaborator

appoxy commented Nov 24, 2010

I see, so perhaps it should be doing this instead:

if res_hash.is_a? Array # fql  return this
    res_hash.collect! { |x| x.is_a?(Hash) ? Hashie::Mash.new(x) : x }
else
    res_hash = Hashie::Mash.new(res_hash)
end

Something along those lines?

@mhuggins
Copy link
Author

That seems like a valid workaround. Since I wasn't using FQL, I temporarily edited the same line to just return x, so that solution seems like it would work.

@treeder treeder closed this as completed Oct 24, 2016
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

2 participants