ZF-4158: GData Ignores my parameters (max-results, start-index etc) when fetching feeds

Issue Type: Sub-task Created: 2008-09-01T23:26:12.000+0000 Last Updated: 2010-02-06T07:51:08.000+0000 Status: Resolved Fix version(s): - 1.10.1 (10/Feb/10)

Reporter: Prem Pillai (premjg) Assignee: Trevor Johns (tjohns) Tags: - Zend_Gdata

Related issues: Attachments: - ZF-4158_v1.patch


GData Ignores my parameters (max-results, start-index etc) when fetching feeds. No matter what parameter values I add, the GData cbntacts feed always returns the same data set (first 25 entries)

Here's my code:

Zend\_Oauth::REQUEST\_SCHEME\_QUERYSTRING, 'version' => '1.0', 'signatureMethod' => 'RSA-SHA1', 'callbackUrl' => '', // UPDATE FOR YOUR DETAILS 'requestTokenUrl' => ' OAuthGetRequestToken', 'userAuthorisationUrl' => ' OAuthAuthorizeToken', 'accessTokenUrl' => ' OAuthGetAccessToken', 'consumerKey' => '', // UPDATE FOR YOUR DETAILS 'consumerSecret' => new Zend\_Crypt\_Rsa\_Key\_Private($test\_cert) ); /\*\* \* Example utilises the Google Contacts API \*/ $consumer = new Zend\_Oauth\_Consumer($options); if (!isset($\_SESSION['ACCESS\_TOKEN\_GOOGLE'])) { if (!empty($\_GET)) { // Google does not like empty POST bodies - switch to GET $token = $consumer->getAccessToken($\_GET, unserialize($\_SESSION['REQUEST\_TOKEN\_GOOGLE']), Zend\_Oauth::GET); $\_SESSION['ACCESS\_TOKEN\_GOOGLE'] = serialize($token); } else { // Default POST works fine here since POST body contains scope parameter $token = $consumer->getRequestToken(array('scope'=>'http:// '), Zend\_Oauth::GET); $\_SESSION['REQUEST\_TOKEN\_GOOGLE'] = serialize($token); $consumer->redirect(); exit; } } else { $token = unserialize($_SESSION['ACCESS_TOKEN_GOOGLE']); $_SESSION['ACCESS_TOKEN_GOOGLE'] = null; } // OAuth Access Token Retreived; Proceed to query Data API $client = $token->getHttpClient($options); //$client->setUri(' full'); //$client->setMethod(Zend\_Http\_Client::GET); $contact = new Zend\_Gdata($client); $contact\_count =0; $query = new Zend\_Gdata\_Query(' default/full'); $feed = $contact->getFeed($query); $name = ""; $email = ""; $db = new db\_connect(); $db = $db->db; foreach($feed as $entry){ $name = $entry->title; $parts = $entry->getExtensionElements(); foreach($parts as $p){ $element = $p->getDOM(); switch($element->tagName){ case 'email': $email = $element->getAttribute('address'); break; default: continue; } } $data = array( 'name' => "$name", 'email' => "$email", 'users\_index' => $users\_index ); //insert into DB here $contact\_count++; } ### Comments Posted by Trevor Johns (tjohns) on 2008-09-02T16:36:28.000+0000 This is being caused by Zend\_Oauth\_client not preserving query parameters on a GET request. Attached [^ZF-4158\_v1.patch] as a patch to fix this behavior, to be sent to [~padraic] for review. Posted by Jon Cockle (yongfook) on 2009-05-25T21:24:00.000+0000 I am still seeing this issue with the latest version in the incubator: […]( and the above patch unfortunately doesn't seem to fix it. I'm experiencing the same issue - GET params are stripped before sending requests, meaning that using Zend\_Oauth for GData doesn't work beyond authentication. Is there any update on this? Posted by Jon Cockle (yongfook) on 2009-05-25T21:37:23.000+0000 sorry, my mistake. the patch fixes the issue but you still need to manually set: $client->setRequestScheme(Zend\_Oauth::REQUEST\_SCHEME\_QUERYSTRING); before sending your request. looks good though. Posted by Pádraic Brady (padraic) on 2010-02-06T07:51:08.000+0000 Fixed in r20938

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.