Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Get following php error message after upgrading on April 14 to latest dev version
date_format() expects parameter 1 to be DateTime, string given in /home/sitename/public_html/sites/all/modules/date/date_api.module on line 710.
I returned to earlier April 10 version and error goes away.
Comment | File | Size | Author |
---|---|---|---|
#16 | date-772180-element-description-1.patch | 2.18 KB | recrit |
#3 | date-772180-date_popup-element-description.patch | 685 bytes | recrit |
Comments
Comment #1
theohawse CreditAttribution: theohawse commentedI have this exact problem, but is being caused by date popup + I18n modules
Comment #2
theohawse CreditAttribution: theohawse commentedGuess thats what I get for going to the dev version, was tying to get the date translated, but hadn't enabled the date locale.
Reverted to recommended version and warning disappeared.
Comment #3
recrit CreditAttribution: recrit commentedI had the same error and noticed that on the node form the date popup format description was blank. The attached patch to the latest dev 2010-04-14 fixes this error.
Comment #4
recrit CreditAttribution: recrit commentedchanging to needs review
Comment #5
movinr8along CreditAttribution: movinr8along commentedThis patch worked for me.
Comment #6
webwriter CreditAttribution: webwriter commentedPatch confirmed working for me.
Comment #7
butler360 CreditAttribution: butler360 commentedPatch works for me.
Comment #8
recrit CreditAttribution: recrit commentedbumping to tested in hopes to get patch applied
Comment #9
Junro CreditAttribution: Junro commentedHello, patch doesn't work for me.
Maybe it's because I have the warning on line 681 and 688 too.
warning: date_format() expects parameter 1 to be DateTime, string given in /home/pariscin/www/sites/all/modules/date/date_api.module on line 681.
warning: date_format() expects parameter 1 to be DateTime, string given in /home/pariscin/www/sites/all/modules/date/date_api.module on line 710.
warning: date_format() expects parameter 1 to be DateTime, string given in /home/pariscin/www/sites/all/modules/date/date_api.module on line 688.
Comment #10
gozigzag CreditAttribution: gozigzag commentedI am getting similar warnings after updating to dev. version- more than 50 total - such as : warning: date_format() expects parameter 1 to be DateTime, string given in C:\wamp\www\go8\sites\all\modules\date\date_api.module on line 678. I tried the patch on 3. No change.
I get this when I go and try to edit a node, this is the only time I've noticed it. And the description for the date format for the CCK date fields on the node edit page is not displaying correctly. Instead of showing Format: 04/24/2010 it shows this: Format: , // - :
I've tried going through each date field in the admin, content type, manage fields settings - making minor changes, re-saving each field. Did not help.
Comment #11
mayerwin CreditAttribution: mayerwin commentedSame problem here with dev version
Comment #12
jared12 CreditAttribution: jared12 commentedPatch from #3 seems to have solved this problem for me. Thanks!
Comment #13
avibrazil@gmail.com CreditAttribution: avibrazil@gmail.com commentedWorked for me too. Thanks for the patch !
Comment #14
amariotti CreditAttribution: amariotti commentedPatch worked for me too. I remember patching this last time....it'd be nice to get this committed to the dev version so I don't have to track this down again. :)
Comment #15
Junro CreditAttribution: Junro commentedread #9
Comment #16
recrit CreditAttribution: recrit commenteddigging deeper to find if any other part of the date module was erroneously using date_format_date.
searching for signature from date_popup.module error on unmodified date module:
Result:
date_api_elements.inc:150
date_popup/date_popup.module:259
My thoughts: people who use date popup were fixed on initial patch, everyone else continued to see this. its the exact same error, most likely some copy-pasting going on.
Everyone who didn't get fixed on first one, try this one and report back.
Comment #17
jcmarco CreditAttribution: jcmarco commentedThis patch solves all the errors I had when editing forms with date fields.
Thank you.
Comment #18
ali_b CreditAttribution: ali_b commentedit works, thank you
Comment #19
alippai CreditAttribution: alippai commentedpatch #16 works for me
Comment #20
Junro CreditAttribution: Junro commentedFixe in the last dev. version (6.x-2.x-dev (2010-mai-02).Sorry, the last dev version doesn't fixe this problem.
Comment #21
tchurch CreditAttribution: tchurch commentedNot working for me. I have -dev version from 2-5-2010 installed.
warning: date_format() expects parameter 1 to be DateTime, string given in /home/sites/.co.uk/public_html/central/sites/all/modules/date/date_api.module on line 678.
warning: date_format() expects parameter 1 to be DateTime, string given in /home/sites/.co.uk/public_html/central/sites/all/modules/date/date_api.module on line 710.
warning: date_format() expects parameter 1 to be DateTime, string given in /home/sites/.co.uk/public_html/central/sites/all/modules/date/date_api.module on line 710.
warning: date_format() expects parameter 1 to be DateTime, string given in /home/sites/.co.uk/public_html/central/sites/all/modules/date/date_api.module on line 710.
warning: date_format() expects parameter 1 to be DateTime, string given in /home/sites/.co.uk/public_html/central/sites/all/modules/date/date_api.module on line 710.
warning: date_format() expects parameter 1 to be DateTime, string given in /home/sites/.co.uk/public_html/central/sites/all/modules/date/date_api.module on line 710.
Comment #22
Junro CreditAttribution: Junro commentedPatch #16 works, thanks recrit :)
Comment #23
alippai CreditAttribution: alippai commentedPlease don't set as needs work, if patch works. It's not fixed in dev, that's true. (02-05-2010 version adds only Czech translation)
Comment #24
recrit CreditAttribution: recrit commentedthis fixes the dev version the patch was specified to fix... its not valid for any future dev unless re-evaluated that nothing has changed in the new dev. patches shouldn't have multiple versions to chase the module dev if the maintainer does not apply the patch.
If using the correct dev and this patch AND still see this error, the issue could be in ANY module that calls date_format() incorrectly, not necessarily the date module itself.
Comment #25
jlmeredithThis patch worked for me against the latest dev build.
Comment #26
inforeto CreditAttribution: inforeto commentedPatch from #16 worked for me against the dev build of May 1st.
Comment #27
jenna.tollersonPatch worked for me against 2010-May-02 dev build. Freaking awesome work, this has been driving me batty.
Comment #28
Witch CreditAttribution: Witch commentedsubscribe
Comment #29
tribe_of_dan CreditAttribution: tribe_of_dan commentedPatch from #16 seems to have worked for me. Thank you
Comment #30
dwwConfirming that this bug still exists in DRUPAL-6--2 branch, and that patch #16 fixes it and looks like the proper solution. It'd be nice to get this into CVS so that people don't keep a) hitting the bug and b) reopening old similar-looking issues. I just searched for this and found quite a few issues where things were getting ugly. ;)
Thanks for the great module KarenS!
Thanks for the patch, recrit!
Cheers,
-Derek
Comment #31
m.sant CreditAttribution: m.sant commentedConfirming that this bug persists in version 6.x-2.x-dev installed today.
The patch works.
Regards,
Marco
Comment #32
Danny EnglanderWhen I try to apply the patch, I get prompted what file to patch, can anyone shed light on which file to patch? thanks.
Comment #33
dww@highrockmedia: Start in the root of the "date" module and use
patch -p0 < date-772180-element-description-1.patch
See http://drupal.org/patch/apply for more.
Also, giving this a better title to be more visible for other users experiencing the same problem.
Comment #34
dwwActually, I just searched through the date issue queue and since there are a lot of duplicate reports of this, I wanted to consolidate everything into the oldest open issue about this:
#518816: warning: date_format() expects parameter 1 to be DateTime
This research revealed another issue for the same bug with a different, perhaps better patch. So, please check that out, too:
#518816-5: warning: date_format() expects parameter 1 to be DateTime
Comment #35
Danny Englander@dww - Ok, that command works, thanks! I no longer get the specific error I was having here: http://drupal.org/node/808242
Comment #36
cerup CreditAttribution: cerup commented#16 worked.
Based upon all the confirmations, can we get this committed to the latest dev release?
Comment #37
dwwNo, we can't. Once an issue is marked "duplicate", please stop commenting here. Join us in the earlier issue that I linked when I marked this duplicate...