Issues

ZF-2022: Property _reminder does not exist when using Zend_Gdata_Calendar demo

Issue Type: Bug Created: 2007-10-01T16:50:18.000+0000 Last Updated: 2011-05-28T17:31:24.000+0000 Status: Resolved Fix version(s): - 1.11.7 (02/Jun/11)

Reporter: Trevor Johns (tjohns) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Gdata

Related issues: Attachments: - gc_demo_image.PNG

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:

<pre class="highlight">
[adam@zfdev trunk]$ cd demos/Zend/Gdata
[adam@zfdev Gdata]$ php Calendar.php outputCalendarByFullTextQuery zftest@lundrigan.ca ZFTest2011 Sat


Sat, 07 May 2011 16:32:09 +0000 (<a href="http://www.google.com/calendar/feeds/default/private/full/3q294cfda18ldbk0qn94ag84fo">http://google.com/calendar/feeds/…</a>)

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 526

As 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:

<pre class="highlight">
$when->reminder = array($reminder);

This should be:

<pre class="highlight">
$when->reminders = array($reminder);

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:

<pre class="highlight">
[adam@zfdev Gdata]$ php Calendar.php setReminder zftest@lundrigan.ca ZFTest2011 3q294cfda18ldbk0qn94ag84fo 55
[adam@zfdev Gdata]$ 

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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts