nov / fb_graph

This gem doesn't support FB Graph API v2.0+. Please use fb_graph2 gem instead.
MIT License
1.04k stars 191 forks source link

photo! Not allowing attachment of place #365

Closed Kelend closed 10 years ago

Kelend commented 10 years ago

I'm trying to create a photo upload with a place referenced as such:

place = FbGraph::Place.new(id).fetch
user_facebook.photo!(:url => my_url, :message => "test", :place => place)

which causes an error:

NoMethodError: undefined method `[]' for #<FbGraph::Place:0x007f11a26c85d0>

The post actually completes and appears in the user's Facebook feed, but the error is playing havoc on my background processing (error causes the event to retry).

nov commented 10 years ago

I couldn't reproduce such error.. Please more info using this feature. https://github.com/nov/fb_graph/wiki/Debugging

Kelend commented 10 years ago
I, [2014-07-18T14:37:41.729773 #2]  INFO -- FbGraph: ======= [FbGraph] API REQUEST STARTED =======
I, [2014-07-18T14:37:41.729884 #2]  INFO -- FbGraph: POST /me/photos HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 376
Host: graph.facebook.com

url=REDACTED_S3_URL
I, [2014-07-18T14:37:44.582918 #2]  INFO -- FbGraph: --------------------------------------------------
I, [2014-07-18T14:37:44.583063 #2]  INFO -- FbGraph: Status: 200 OK
Facebook-API-Version: v1.0
Content-Type: application/json; charset=UTF-8
Pragma: no-cache
Access-Control-Allow-Origin: *
X-FB-Rev: 1334091
Cache-Control: private, no-cache, no-store, must-revalidate
Expires: Sat, 01 Jan 2000 00:00:00 GMT
X-FB-Debug: 4+TgqvCUQo0o+0+Lnbnj4rYmOflrLztJj+5tJyMNJOnCy/A49Ms0ASk+2D6AWDJRUN2fjtmFMrhebgbhRGjA4A==
Date: Fri, 18 Jul 2014 14:37:44 GMT
Connection: keep-alive
Content-Length: 0

{"id":"10154384672340066","post_id":"654575065_10154382724765066"}
I, [2014-07-18T14:37:44.583134 #2]  INFO -- FbGraph: ======= [FbGraph] API REQUEST FINISHED =======
NoMethodError: undefined method `[]' for #<FbGraph::Place:0x007f497bbb14a0>
    from /app/vendor/bundle/ruby/2.0.0/gems/fb_graph-2.7.15/lib/fb_graph/photo.rb:43:in `initialize'
    from /app/vendor/bundle/ruby/2.0.0/gems/fb_graph-2.7.15/lib/fb_graph/connections/photos.rb:15:in `new'
    from /app/vendor/bundle/ruby/2.0.0/gems/fb_graph-2.7.15/lib/fb_graph/connections/photos.rb:15:in `photo!'
    from (irb):7
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.5/lib/rails/commands/console.rb:90:in `start'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.5/lib/rails/commands/console.rb:9:in `start'
    from /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.5/lib/rails/commands.rb:62:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

I'm on Rails 4.0.5, Ruby 2.0.0p481