venkyanthony / google-api-dfp-php

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

DateTimeUtils.php is incompatible with ReportService in API v201103 #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Specfiy the latest API version:
$reportService = $user->GetReportService('v201103');
2. Attempt to convert a php date to a dfp date:
$reportEndDate = DateTimeUtils::GetDfpDateTime(new DateTime('today'));

What is the expected output? What do you see instead?

Expected output is a DFP compatible date object. Instead, a PHP fatal error 
occurs:

[Tue May 03 07:16:08 2011] [error] [client x.x.x.x] PHP Fatal error:  Class 
'DfpDateTime' not found in 
<snip>/lib/src/Google/Api/Ads/Dfp/Util/DateTimeUtils.php on line 46

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

DFP API PHP Client Library 2.5.1 on Ubuntu 10.04.02 LTS with PHP version 
5.3.2-1ubuntu4.7 with Suhosin-Patch from repository.

Please provide any additional information below.

v201101 works as expected.

Original issue reported on code.google.com by da...@onlineinteractivemarketing.com.au on 4 May 2011 at 12:14

GoogleCodeExporter commented 9 years ago
Issue 19 has been merged into this issue.

Original comment by ekoleda+devrel@googlers.com on 1 Jun 2011 at 6:56

GoogleCodeExporter commented 9 years ago
I'll add a GetDfpDate() method to the DateTimeUtils to handle the case when 
DfpDateTime hasn't been loaded.

Original comment by ekoleda+devrel@googlers.com on 1 Jun 2011 at 6:57

GoogleCodeExporter commented 9 years ago
This doesn't seem to have been resolved, and is a real problem now that v201101 
is being deprecated in the next 24 hours.

Original comment by da...@pinion.gg on 29 Aug 2011 at 5:38

GoogleCodeExporter commented 9 years ago
Sorry for the delay, working on this now.

Original comment by ekoleda+devrel@googlers.com on 29 Aug 2011 at 5:57

GoogleCodeExporter commented 9 years ago
Fixed in r95, by adding the method ToDfpDate().

Original comment by ekoleda+devrel@googlers.com on 1 Sep 2011 at 3:43

GoogleCodeExporter commented 9 years ago
Thanks Eric, just confirming the fix works as expected for me. Cheers.

To anyone else updating old code for this fix, remember that the fields have 
changed from startDateTime and endDateTime to just startDate and endDate in 
201107.

Original comment by da...@pinion.gg on 8 Sep 2011 at 4:46