Closed (won't fix)
Project:
Date
Version:
6.x-2.x-dev
Component:
Date API
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Jan 2011 at 11:51 UTC
Updated:
26 Oct 2018 at 02:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
kybermanThe same error, but it seems to be the Date module problem (I don't have installed Event Bookings module). The error shows after update to version 2.7, when node with Date CCK field is saved.
Comment #2
merilainen commentedHere is the whole error message:
Seems to be related to Date API. But I'm not sure if the problem is there or in the Eventbookings module, because I don't get this problem with other content types. I think it's calling the Date API in wrong manner.
Comment #3
omerida commentedSeems to happen if $date is empty, which causes the function to return early. Reversing the tests gets rid of the notice. Attached is a patch.
Comment #4
kybermanFor me, the problem has gone after change in "date_api.module" (line 710) from:
to:
Is this correct, or wrong way?
EDIT: Now, I see that the patch from omerida do the same thing :-)
Comment #5
hnln commentedsub
Comment #6
karens commentedThis is a patch for an older version of the code. Everyone is referring to some code that no longer looks the same. Since this part of the code has changed, someone needs to see if there is still a problem in the latest dev version, and if so, provide a patch for that.
Comment #7
omerida commentedThe case for get_class being called still exists in the code for the dev snapshot. Attached is a patch to fix it.
Comment #8
rob c commented#4 & #7 looking good, this seems to fix the problem for me in the 2.7 release.
Comment #9
arlinsandbulte commentedfixed:
http://drupalcode.org/project/date.git/commit/58c3f6e
Note:
This change made sense and looked pretty simple, so I applied it without really verifying it fixes a problem.
In the future, please provide details on how the error message can be reproduced. Preferably, try reproducing the error on a clean Drupal install.
That way, module maintainers can:
1.) First reproduce the error
2.) apply the patch
3.) then verify that the patch eliminates the error.
I know this takes time and is not always possible. But doing so will CERTAINLY help your issue/patch get implemented.
AT THE VERY LEAST, you should at least mention that you TRIED to reproduce the problem.
The more detail you give, the faster we can react.
Comment #11
bohz commentedSorry to reopen this.
I am experiencing a very similar error:
get_class() expects parameter 1 to be object, string given in /home/.../sites/all/modules/date/date_api.module on line 719.This happens with both 6.x-2.8 and 6.x-2.x-dev when accessing the full node.
I have checked the above patch is in use in my version.
Dates are saved correctly, views and other modules work as expected.
[EDIT2]
It seems this happens only when using Times;This happens because when I use start and end dates, the start date is a string not an object; like:get_class($date)is actually empty$date = '2012-04-25 00:00:00'I have added this check
And the error went away but still, I would like to know what happens!
I am unsure if this is caused by my setup: (updated) default LAMP stack on Ubuntu 10.04 server with PEAR - PHP Extension enabled.
Any hint on how to (properly) solve this problem is welcome.
THanks!!
Comment #12
omerida commentedYou should file a new ticket and leave this one closed/fixed.
Comment #13
boran commentedOne year later (almost :-)
I had the exact same problem as #11 with v2.9 (the stable release at the time of writing).
I also have start/end dates.
The quick fix in #11 worked too, adding that line before line 719
Comment #14
uv516 commentedOne mere year later the error appear in the newest version (6.x-2.10).
#11 solve the problem, but du we have to do this at every update?
Comment #15
rukayya commentedI resolved that error by applying the following patch
Comment #16
rukayya commentedWe can remove the Warning: get_class() expects parameter 1 to be object, integer given in date_format_date() caused by date_api.module by using this patch:)
Comment #17
damienmckennaUnfortunately the Drupal 6 version of the Date module is no longer supported. That said, we appreciate that you took time to work on this issue. Should this request still be relevant for Drupal 7 please feel free to reopen it. Thank you.