nov/fb_graph — Issue #201: Tag Photo
Author: fabiogiolito
Created: 2012-03-03 08:40:50+00:00
State: open

Sorry for the double titled issue, but these problems seem to be related.

I'm trying to upload a photo and add tags to it, I'm following the wiki (https://github.com/nov/fb_graph/wiki/Photo-and-Album)

```
tags = [
FbGraph::Tag.new(
:name => "without profile link",
:x => 0,
:y => 95
),
FbGraph::Tag.new(
:id => 529080466,
:name => "with Facebook profile link",
:x => 5,
:y => 0
)
]
FbGraph::User.me(current_user.token).photo!(
:url => "http://ihateflash.net/wp-content/uploads/2012/02/RA_25591.jpg",
:message => 'FbGraph Test',
:tags => tags
)
```

I get the following error message:
`(#121) Invalid photo id`

The photo upload works, it appears on Facebook. But without any tags.

So I tried a different approach:

```
me = FbGraph::User.me(current_user.token)
photo = me.photo!(
:url => "http://ihateflash.net/wp-content/uploads/2012/02/RA_25591.jpg",
:message => 'FbGraph Test',
)
photo.tag!(
:to => 'Fabio Giolito',
:x => 50,
:y => 50
)
```
and got `undefined method `tag!' for #`
`photo` is valid and has all the photo information.

I tried changing `:to => 'Fabio Giolito'` to `:name => 'Fabio Giolito'` and even adding an `:id`.
But It didn't work.

So my last try was to upload the image, fetch it, and add tags.
But I couldn't fetch any photo either...

```
me = FbGraph::User.me(current_user.token)
raise me.photos.to_yaml
```

photos is empty.

And if I try to fetch a specific photo:

```
photo = FbGraph::Photo.new('valid photo id', :access_token => current_user.token).fetch
raise photo.to_yaml
```

I get the error: `Graph API returned false, so probably it means your requested object is not found.`