google-api-php-client icon indicating copy to clipboard operation
google-api-php-client copied to clipboard

Property Google\Service\Resource::$rootUrl does not exist

Open Mo7sin opened this issue 1 year ago • 2 comments

Environment details

  • OS: MacOS or CloudLinux v8.10.0
  • PHP version: 8.3
  • Package name and version: https://github.com/googleads/googleads-shopping-samples/tree/main/php
  • "google/apiclient": "^2.17.0",

Steps to reproduce

  1. I use service account credentials from content/service-account.json authentication method.
  2. When I hit run() method from 'php/ProductsSample.php', i always get Property Google\Service\Resource::$rootUrl does not exist.
  3. rootUrl is generated by prepareServices() method in 'php/ContentSession.php'
  4. This code has not been changed since 2021 and it was working just fine.

Thank you.

Mo7sin avatar Oct 04 '24 12:10 Mo7sin

Had exactly the same issue. Property name of $rootUrl in Google\Service\Resource has changed to $rootUrlTemplate. Changing rootUrl to rootUrlTemplate solved the problem.

asafloll avatar Nov 15 '24 16:11 asafloll

Had exactly the same issue. Property name of $rootUrl in Google\Service\Resource has changed to $rootUrlTemplate. Changing rootUrl to rootUrlTemplate solved the problem.

I have already implemented the required changes and rectified the error. However, API calls are still not being executed. I have verified this through my API call monitoring capabilities on GMC, and I only observe GET requests to retrieve the account service being made.

image

Mo7sin avatar Nov 15 '24 18:11 Mo7sin

Yeah those googleads shopping samples are really outdated (the deps say php >= 5.4). They are also using PHP Reflection to modify our private properties, which is cursed and unholy. I've submitted a PR to fix it (https://github.com/googleads/googleads-shopping-samples/pull/60), but really there's not much else I can do here.

bshaffer avatar May 07 '25 18:05 bshaffer