6 messages in com.googlegroups.opensocial-orkut[orkut-developer] Re: "a has no prope...
FromSent OnAttachments
Nitin25 Jun 2008 16:38 
Rajiv Renganathan25 Jun 2008 16:42 
Nitin25 Jun 2008 17:21 
Nitin25 Jun 2008 17:30 
Jason01 Jul 2008 15:18 
Adam01 Jul 2008 15:33 
Subject:[orkut-developer] Re: "a has no properties" js error in orkut production
From:Nitin (n.za@gmail.com)
Date:06/25/2008 05:30:09 PM
List:com.googlegroups.opensocial-orkut

I always ask for viewer_profile and owner_profile. It turns out that api/json (rightly)request sometime asks for both the info, but (wrong)sometimes it just asks for the owner_profile

I am just listing the post param of wrong request ===wrong api request === rc=1&v=0.61&vw=canvas&req=%5B%7B%22key%22%3A%22owner_profile%22%2C %22request%22%3A%7B%22type%22%3A%22FETCH_PEOPLE %22%2C%22parameters%22%3A%7B%22idSpec%22%3A%22OWNER%22%2C %22profileDetail%22%3A%5B%22movies%22%2C%22gender %22%2C%22dateOfBirth%22%2C%22currentLocation%22%2C%22thumbnailUrl%22%2C %22profileUrl%22%2C%22aboutMe %22%2Cnull%2C%22id%22%2C%22name%22%2C%22thumbnailUrl%22%5D%7D%7D%7D%2C %7B%22key%22%3A%22owner_app_data %22%2C%22request%22%3A%7B%22type%22%3A%22FETCH_PERSON_DATA%22%2C %22parameters%22%3A%7B%22idSpec%22%3A %22OWNER%22%2C%22keys%22%3A%5B%22*%22%5D%7D%7D%7D %5D&st=AFinprSxAgwOQyHHIxA8v472zQqpjFc7rYPQDzHIIWv3J9cmMroJbl0Hw2vZyTLTxUBf50JWBSNExRZuBps7IDwCmVT2i9gdQg5XMsi9TfQxOH6KrNwbBcA &out=js =======end =======

The right request is (which happens sometimes)

==right api call=== rc=1&v=0.61&vw=canvas&req=%5B%7B%22key%22%3A%22viewer_profile%22%2C %22request%22%3A%7B%22type%22%3A%22FETCH_PEOPLE %22%2C%22parameters%22%3A%7B%22idSpec%22%3A%22VIEWER%22%2C %22profileDetail%22%3A%5B%22id%22%2C%22name %22%2C%22thumbnailUrl%22%5D%7D%7D%7D%2C%7B%22key%22%3A%22owner_profile %22%2C%22request%22%3A%7B%22type %22%3A%22FETCH_PEOPLE%22%2C%22parameters%22%3A%7B%22idSpec%22%3A %22OWNER%22%2C%22profileDetail%22%3A %5B%22movies%22%2C%22gender%22%2C%22dateOfBirth%22%2C%22currentLocation %22%2C%22thumbnailUrl%22%2C%22profileUrl %22%2C%22aboutMe%22%2Cnull%2C%22id%22%2C%22name%22%2C%22thumbnailUrl %22%5D%7D%7D%7D%2C%7B%22key%22%3A %22viewer_app_data%22%2C%22request%22%3A%7B%22type%22%3A %22FETCH_PERSON_DATA%22%2C%22parameters%22%3A %7B%22idSpec%22%3A%22VIEWER%22%2C%22keys%22%3A%5B%22*%22%5D%7D%7D%7D %5D&st=AFinprQBXRFqetoUbEP0M7gVnZWHYx_Wpug9Z_jex5P7_9hgszB66mWOwCY7LI4V91NFuxMANcgbYhn_o6YUGvEkX- ZpCno5LLsXx4k4AF3pi5ikmLzW_jU &out=js ===end===

The actual code which triggers the calls is (always) var req = opensocial.newDataRequest(); // Add request code here req.add(req.newFetchPersonRequest("VIEWER"), "viewer_profile"); var params = {}; params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [ opensocial.Person.Field.MOVIES, opensocial.Person.Field.GENDER, opensocial.Person.Field.DATE_OF_BIRTH, opensocial.Person.Field.CURRENT_LOCATION, opensocial.Person.Field.THUMBNAIL_URL, opensocial.Person.Field.PROFILE_URL, opensocial.Person.Field.ABOUT_ME, opensocial.Person.Field.LABGUAGES_SPOKEN // opensocial.Person.Field.DISPLAY_NAME, // opensocial.Person.Field., ];

req.add(req.newFetchPersonRequest("OWNER",params), "owner_profile"); req.add(req.newFetchPersonAppDataRequest('VIEWER', ['*']),"viewer_app_data"); req.add(req.newFetchPersonAppDataRequest('OWNER', ['*']),"owner_app_data"); req.send(handleSocialDataFetch);

I ask for owner_profile, viewer_profile always, so why the difference in the backend api call ?