Home › Forums › Calendar Products › Events Calendar PRO › PHP Warning tribe-Events-recurrence-meta.class.php
- This topic has 6 replies, 2 voices, and was last updated 12 years, 11 months ago by
Jonah.
-
AuthorPosts
-
March 20, 2013 at 10:42 pm #43542
Bob
ParticipantHi,
In a situation I’ll describe below, I’m getting the following PHP warning: “Warning: Creating default object from empty value in wp-content\plugins\Events-calendar-pro\lib\tribe-Events-recurrence-meta.class.php on line 46”. This is only an annoyance, since it doesn’t appear unless PHP display_errors is set to “on”. However, I THINK it represents a minor bug in Events Pro.
Line 46 is part of function admin_bar_render. The statement says:
$edit_link->href = $edit_link->href . ‘&EventDate=’ . TribeDateUtils::dateOnly($post->EventStartDate);
I believe this is intended to make sure that, when a user decides to edit a recurring Event, the Edit link takes him/her to an edit screen for desired Event date (rather than the first occurrence of the recurring Event).
I think the assumption behind this is that the code only gets called when the user is viewing a single instance of the recurring Event.
However, if the recurring Event is the last Event appearing in a listing of multiple Events, admin_bar_render gets called and sets $edit_link to null. Line 46 then attempts to execute, resulting in the PHP warning.
This quick-fix resolved the warning for me:
if ($edit_link) {$edit_link->href = …}
However, I suspect it would be better if the original condition in admin_bar_render was expanded to make sure it covers the multiple event listing situation I described. Or maybe there’s more to the story.
Let me know what you think and/or if you have any questions. Thanks!
March 21, 2013 at 12:45 pm #43702Jonah
ParticipantHi Bob,
I’ve passed this on to one of our developers to check. Thanks for the report. I’ll let you know what they get back with.
Thanks,
JonahMay 3, 2013 at 11:01 am #47581Jonah
ParticipantHi Bob,
Sorry for never following back up here. Would you be willing to test things out with our 3.0 beta to see if this is addresses there? If so, please shoot an email over to pro [at] tri [dot] be with a request to test.
Thanks,
JonahMay 6, 2013 at 9:06 pm #47776Bob
ParticipantSure, I’ll do that.
Thanks.
BobMay 7, 2013 at 12:56 pm #47863Jonah
ParticipantSounds good Bob, let us know if there’s anything else I can do for you here.
– Jonah
May 15, 2013 at 11:13 pm #48696Bob
ParticipantI’ve just tested with the 3.0 beta, and the problem appears to be fixed! Thanks.
(By the way, while making sure I could duplicate the error before upgrading the test environment to the 3.0 beta, I discovered one more condition necessary for the error to occur: the user needs to be logged in. Since the error appears to be fixed in the 3.0 beta, I haven’t bothered to figure out why.)
May 16, 2013 at 5:36 am #48707Jonah
ParticipantHi Bob,
Glad to hear it’s fixed in 3.0 since we won’t be making any other updates to the pre 3.0 code. You’re welcome to continue using the beta until we launch at which point you can auto update to the latest. Let me know if you need anything else here.
Regards,
Jonah -
AuthorPosts
- The topic ‘PHP Warning tribe-Events-recurrence-meta.class.php’ is closed to new replies.
