ZF-2022: Property _reminder does not exist when using Zend_Gdata_Calendar demo
Description
Summary When running the Zend_Gdata_Calendar demo at demos/Zend/Gdata/Calendar.php, attempting to use the setReminder mode will cause the following error:
{panel}Stack trace:
0 .../library/Zend/Gdata/App/Base.php(324): Zend_Gdata_App_Base->__isset('_reminder')
1 .../demos/Zend/Gdata/Calendar.php(572): Zend_Gdata_App_Base->__set('reminder', Array)
2 .../demos/Zend/Gdata/Calendar.php(679): setReminder(Object(Zend_Http_Client), 'vsrdg4c2da04jsd...', '30')
3 {main}
thrown in .../library/Zend/Gdata/App/Base.php on line 344
Fatal error: Uncaught exception 'Zend_Gdata_App_InvalidArgumentException' with message 'Property _reminder does not exist' in .../library/Zend/Gdata/App/Base.php:344 Stack trace:
0 .../library/Zend/Gdata/App/Base.php(324): Zend_Gdata_App_Base->__isset('_reminder')
1 .../demos/Zend/Gdata/Calendar.php(572): Zend_Gdata_App_Base->__set('reminder', Array)
2 .../demos/Zend/Gdata/Calendar.php(679): setReminder(Object(Zend_Http_Client), 'vsrdg4c2da04jsd...', '30')
3 {main}
thrown in .../library/Zend/Gdata/App/Base.php on line 344{panel}
History This was originally reported by Rusu Mircea via zfmrketing@zend.com, then forwarded to the Zend_Gdata mailing list. Reference: <698DE66518E7CA45812BD18E807866CEB95188@us-ex1.zend.net>
Comments
Posted by Trevor Johns (tjohns) on 2007-10-01T16:57:40.000+0000
Added issue history.
Posted by Trevor Johns (tjohns) on 2007-10-01T16:59:12.000+0000
Attaching patch as [^ZF-2022_v1.patch].
Instead of following Rusu's suggestion, I went with $when->reminders instead of $when->setReminders in order to maintain consistency with the rest of the sample code.
Posted by Ryan Boyd (rboyd) on 2007-10-01T17:12:49.000+0000
$when->reminders isn't consistent either, unfortunately. For all other data model elements, we went by the name of the XML element for deciding the pluralization. However, we seem to use reminders instead of reminder here.
Would it make sense to add setReminder and getReminder aliases to the pluralized version of the functions to Zend_Gdata_Extension_When in order to maintain that consistency? (I realize some may argue that what we are currently doing is consistent, but consistently wrong. In hindsight, I might have changed this, but don't really have that privilege while maintaining backwards compat)
-Ryan
Posted by Trevor Johns (tjohns) on 2007-10-01T17:19:54.000+0000
{quote}Would it make sense to add setReminder and getReminder aliases to the pluralized version of the functions to Zend_Gdata_Extension_When in order to maintain that consistency?{quote}
Yes, I think that would make sense.
The only thing that worries me is that, as mistakes happen over time (heaven forbid), we're going to start piling up duplicate methods such as the ones being proposed here. Does the ZF project have any guidelines as to how functions should be properly deprecated?
Posted by Ryan Boyd (rboyd) on 2007-10-02T10:12:08.000+0000
Agreed. I think the general plan is to keep the framework backwards compatible, but I will talk to Zend about what, if any, plans there are for deprecation of small things like this. My proposal would be to deprecate it with 1.1, and remove it with 1.2 or 1.3--- that should give plenty of time--- but I want to be in alignment with the overall deprecation guidelines.
Posted by Jochen Hartmann (jhartmann) on 2009-02-26T16:30:21.000+0000
(batch downgrading outstanding issues older than 1 year)
Posted by Ralph Schindler (ralph) on 2011-02-17T14:21:51.000+0000
Whats the word on this?
Posted by Adam Lundrigan (adamlundrigan) on 2011-05-07T17:01:08.000+0000
I created a demo Google Calendar account and reproduced the original reporter's problem. The same account is set up in the ZF test suite to run the Google Calendar online test suite, so there are already events available in the calendar from running those tests:
Actions to reproduce:
Sat, 07 May 2011 16:32:09 +0000 (http://google.com/calendar/feeds/…)Starts: 2011-05-07T09:30:00.000-02:30 [adam@zfdev Gdata]$ php Calendar.php setReminder zftest@lundrigan.ca ZFTest2011 3q294cfda18ldbk0qn94ag84fo 10 PHP Fatal error: Uncaught exception 'Zend_Gdata_App_InvalidArgumentException' with message 'Property _reminder does not exist' in library/Zend/Gdata/App/Base.php:526 Stack trace: #0 library/Zend/Gdata/App/Base.php(506): Zend_Gdata_App_Base->__isset('_reminder') #1 demos/Zend/Gdata/Calendar.php(621): Zend_Gdata_App_Base->__set('reminder', Array) #2 demos/Zend/Gdata/Calendar.php(728): setReminder(Object(Zend_Gdata_HttpClient), '3q294cfda18ldbk...', '10') #3 {main} thrown in library/Zend/Gdata/App/Base.php on line 526As the original submitter's patch shows, the reason this error occurs is due to the fact that the Zend_Gdata_Calendar demo incorrectly uses it's own API:
This should be:
As the latter is how reminders are set in both the component code and in the online unit test suite (see: Zend_Gdata_CalendarOnlineTest, Line 115)
When I make this change in the demo script and re-run, everything works A-OK:
The 55-minute reminder is now added: !gc_demo_image.PNG!
As such, I think the issue boils down to an error in the demo application and not in the component itself.
Posted by Adam Lundrigan (adamlundrigan) on 2011-05-07T17:07:15.000+0000
Patch applied to trunk r24025
Posted by Adam Lundrigan (adamlundrigan) on 2011-05-28T17:30:59.000+0000
Merged to release-1.11 in r24062