[Facebooker-talk] problems publishing into Profile
Mike Mangino
mmangino at elevatedrails.com
Thu Aug 21 18:53:20 EDT 2008
I think the problem comes from using a Facebooker::User as a
recipient. It should work, but it doesn't. I got a pull request for
something related to this, but it doesn't quite fix the bug. In the
short term, you can set recipients to either the integer or string of
the Facebook id. In the longer term, I'll need to fix this.
I have to pick my wife up from work. I'll get this patched first thing
tomorrow morning.
Mike
On Aug 21, 2008, at 5:03 PM, Allen Walker wrote:
> Just did a --force on the latest .git via:
>
> script/plugin install git://github.com/mmangino/facebooker.git --force
>
> restarted mongrel instance.
>
> Same error. Full stack trace:
>
> Rendered activity_publisher/_profile.fbml.erb (0.00001)
>
>
> NoMethodError (You have a nil object when you didn't expect it!
> The error occurred while evaluating nil.post):
> /vendor/plugins/facebooker/lib/facebooker/models/user.rb:203:in
> `set_profile_fbml_without_bebo_adapter'
> /vendor/plugins/facebooker/lib/facebooker/adapters/bebo_adapter.rb:
> 43:in `set_profile_fbml'
> /vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:
> 287:in `send_message'
> /vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:
> 384:in `method_missing'
> /app/controllers/public_controller.rb:14:in `index'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/base.rb:1162:in `send'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/base.rb:1162:in `perform_action_without_filters'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/filters.rb:580:in `call_filters'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/filters.rb:573:in `perform_action_without_benchmark\
> '
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/benchmarking.rb:68:in `perform_action_without_rescu\
> e'
> /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/benchmarking.rb:68:in `perform_action_without_rescu\
> e'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/rescue.rb:201:in `perform_action_without_caching'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/caching/sql_cache.rb:13:in `perform_action'
> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/
> active_record/connection_adapters/abstract/query_cache.rb:33:in `ca\
> che'
> /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/
> active_record/query_cache.rb:8:in `cache'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/caching/sql_cache.rb:12:in `perform_action'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/base.rb:529:in `send'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/base.rb:529:in `process_without_filters'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/filters.rb:569:in `process_without_session_manageme\
> nt_support'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/session_management.rb:130:in `process'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/base.rb:389:in `process'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/dispatcher.rb:149:in `handle_request'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/dispatcher.rb:107:in `dispatch'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/dispatcher.rb:104:in `synchronize'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/dispatcher.rb:104:in `dispatch'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/dispatcher.rb:120:in `dispatch_cgi'
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
> action_controller/dispatcher.rb:35:in `dispatch'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
> rails.rb:76:in `process'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
> rails.rb:74:in `synchronize'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
> rails.rb:74:in `process'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/
> mongrel.rb:159:in `process_client'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/
> mongrel.rb:158:in `each'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/
> mongrel.rb:158:in `process_client'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/
> mongrel.rb:285:in `run'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/
> mongrel.rb:285:in `initialize'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/
> mongrel.rb:285:in `new'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/
> mongrel.rb:285:in `run'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/
> mongrel.rb:268:in `initialize'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/
> mongrel.rb:268:in `new'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/
> mongrel.rb:268:in `run'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
> configurator.rb:282:in `run'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
> configurator.rb:281:in `each'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
> configurator.rb:281:in `run'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:
> 128:in `run'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/
> command.rb:212:in `run'
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:
> 281
> /usr/local/bin/mongrel_rails:19:in `load'
> /usr/local/bin/mongrel_rails:19
>
> Rendering /home/slick/meetingup/vendor/plugins/facebooker/templates/
> layout.erb (200)
>
> Mike Mangino wrote:
>> Hmm. That seems odd.
>>
>> Sorry this is taking so long for us to figure out. I've got a
>> couple of things to try:
>>
>> 1) Update to the newest Facebooker. I made changes this week that
>> might help this.
>> 2) I'm not 100% sure :locals=> will work. I think you need to
>> do :assigns=> (I don't think that is your problem though)
>> 3) If the upgrade and change don't help, can you post a new stack
>> trace? I want to make sure I can look at the actual line that is
>> causing the error.
>>
>> Mike
>>
>> On Aug 21, 2008, at 4:16 PM, Allen Walker wrote:
>>
>>> Made some adjustments and still having the same problem. It's
>>> gotta be an API bug?
>>>
>>> activity_publisher.rb
>>> class ActivityPublisher < Facebooker::Rails::Publisher
>>>
>>> include ApplicationHelper
>>>
>>> ...
>>> def profile_update(user)
>>> send_as :profile
>>> from user.facebook_session.user
>>> recipients user.facebook_session.user
>>> fbml = render({
>>> :partial => "profile",
>>> :locals => {:activities => user.activities}
>>> })
>>> profile(fbml)
>>> profile_main(fbml)
>>> end
>>>
>>> ...
>>> end
>>>
>>> _profile.erb
>>>
>>> This is a test.
>>>
>>> Publishing Test:
>>>
>>>
>>> >> user = User.find_by_id(1)
>>> => #<User id: 1, facebook_id: xxxxxxx, session_key:
>>> "b77a85f20a91bc3effc3ba95-xxxxxxx", cell_phone_number: nil,
>>> email_address: nil, contact_preference: nil, gender: "male",
>>> created_at: "2008-08-09 01:30:40", updated_at: "2008-08-20
>>> 23:02:16">
>>> >> ActivityPublisher.deliver_profile_update(user)
>>> NoMethodError: You have a nil object when you didn't expect it!
>>> The error occurred while evaluating nil.post
>>> from /home/slick/meetingup/vendor/plugins/facebooker/lib/
>>> facebooker/models/user.rb:203:in
>>> `set_profile_fbml_without_bebo_adapter'
>>> from /home/slick/meetingup/vendor/plugins/facebooker/lib/
>>> facebooker/adapters/bebo_adapter.rb:43:in `set_profile_fbml'
>>> from /home/slick/meetingup/vendor/plugins/facebooker/lib/
>>> facebooker/rails/publisher.rb:287:in `send_message'
>>> from /home/slick/meetingup/vendor/plugins/facebooker/lib/
>>> facebooker/rails/publisher.rb:384:in `method_missing'
>>> from (irb):2
>>> _______________________________________________
>>> Facebooker-talk mailing list
>>> Facebooker-talk at rubyforge.org
>>> http://rubyforge.org/mailman/listinfo/facebooker-talk
>>
>> --
>> Mike Mangino
>> http://www.elevatedrails.com
>>
>>
>>
>>
>
--
Mike Mangino
http://www.elevatedrails.com
More information about the Facebooker-talk
mailing list