NikosTsolakos / google-api-php-client

Automatically exported from code.google.com/p/google-api-php-client
Apache License 2.0
0 stars 0 forks source link

Undefined index: methods google-api-client-php\service\apiServiceResource.php #48

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Initialize and create a valid apiClient
2. Initialize an apiAnalyticsService object with the client object
3. The notice in the subject should be present

What is the expected output? What do you see instead?
I expect an apiAnalyticsService object with a subset of different objects, 
ManagementWebpropertiesServiceResource, ManagementSegmentsServiceResource, etc. 
 Instead, and I believe this is due to the undefined index error, none of these 
objects are present

What version of the product are you using? On what operating system?
r284

Please provide any additional information below.
I believe the bug is in apiAnalyticsService.php in the constructor.  A long 
json object is sent to the ManagmentServiceResource constructor as the 
"resource".  The constructor expects a 'method' index, but instead it receives 
an object with a number of resources with their own 'method' indexes, which I 
don't think it handles properly.

Original issue reported on code.google.com by davidcroda on 14 Dec 2011 at 3:44

GoogleCodeExporter commented 8 years ago
Has there been any develop on this? I am also getting this error when using the 
Analytics API.

Original comment by chris.al...@pmg.com on 14 Dec 2011 at 7:46

GoogleCodeExporter commented 8 years ago
Hi Chris,

I am not entirely sure how it is supposed to work. It looks like the 
apiServiceResource class was changed but the apiAnalyticsServiceResource was 
not updated.  I was able to get it to work with the attached patch (applied to 
apiAnalyticsServiceResource.php), but I am not positive if this is the way it 
was intended to be setup.

Dave

Original comment by davidcroda on 14 Dec 2011 at 9:14

GoogleCodeExporter commented 8 years ago
Thanks Dave, 

I will try it out!

-Chris

Original comment by chris.al...@pmg.com on 14 Dec 2011 at 9:19

GoogleCodeExporter commented 8 years ago
Oops, there was a minor bug in the attached patch, the "ga" value was being set 
to DataServiceResource instead of DataGaServiceResource.  Updated patch 
attached.  Good luck!

Original comment by davidcroda on 14 Dec 2011 at 9:33

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you for reporting this issue.

I have fixed the generator, and regenerated the Google Analytics service class 
in r287.

Original comment by chirags@google.com on 15 Dec 2011 at 9:40