TulioBento / gapi-google-analytics-php-interface

Automatically exported from code.google.com/p/gapi-google-analytics-php-interface
0 stars 0 forks source link

Errors on line 282 #39

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

$this->load->library('gapi', array('email' => $this->email, 'password' => 
$this->password));

$this->gapi->requestAccountData();

foreach($this->gapi->getResults() as $result)
{
   echo $result . ' (' . $result->getProfileId() . ")<br />";
}        

Expect a all accounts, instead:

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: google_results

Filename: libraries/Gapi.php

Line Number: 281

A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: libraries/Gapi.php

Line Number: 281

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: google_results

Filename: libraries/Gapi.php

Line Number: 282

A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: libraries/Gapi.php

Line Number: 282

I use @version 1.3

Please provide any additional information below.

To fix this is easy: 

Replace 

$account_root_parameters['startDate'] = strval($google_results->startDate);
    $account_root_parameters['endDate'] = strval($google_results->endDate);

On line 281 and 282

with

$account_root_parameters['startDate'] = strval($open_search_results->startDate);
    $account_root_parameters['endDate'] = strval($open_search_results->endDate);

Original issue reported on code.google.com by alex.n...@gmail.com on 15 Aug 2010 at 9:28