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.
This was spanwed from a date_ical issue over at http://drupal.org/node/1886580.
It turns out date_ical returns FeedsDateTime objects to be mapped. Under certain situations the feeds mapper will pass this object into date_create, which takes a string as input. This causes lots of warnings to be printed.
There may be other issues at play, but just adding a check within the mapper to ensure a FeedsDateTime object isn't being passed into date_create fixes the issue for me.
Comment | File | Size | Author |
---|---|---|---|
#11 | feeds-fix_datetime_conversion-1989196-11.patch | 1.46 KB | coredumperror |
#1 | 1989196-feedsdatetime-check.patch | 548 bytes | beeradb |
Comments
Comment #1
beeradb CreditAttribution: beeradb commentedComment #2
Matthew Davidson CreditAttribution: Matthew Davidson commentedWorks for me and at least one other person.
Comment #3
aDarkling CreditAttribution: aDarkling commented+1
Works for me as well.
Feeds wasn't able to import or map dates from a CiviCrm ical event feed (version 4.2.2). This fixed that.
The code change appears solid and contained.
Comment #4
twistor CreditAttribution: twistor commentedI think I've fixed this. I just went ahead and made the check for a string, since that's what date_create() expects.
Also fixed multivalue handling while I was in there.
http://drupalcode.org/project/feeds.git/commit/7e6679d
Comment #5
beeradb CreditAttribution: beeradb commentedGood improvement. I realized after I had posted the patch that it shouldn't be as specific as checking for the feedsdatetime object, but just never had a chance to circle back and post the update. Thanks!
Comment #7
cdmo CreditAttribution: cdmo commentedI realize this patch is for 7.x-2.x-dev, but I applied the patch in #4 to 7.x-2.0-alpha8 and it worked for me. Thanks!
Comment #8
colanMarked #1988562: Begin and end date not beeing parsed (iCal from google calendar) and #1669964: Multiple Values and Empty Values in Date Fields as duplicates of this issue.
Comment #9
coredumperror CreditAttribution: coredumperror commentedPlease forgive me if I'm just reading this wrong, but the updated function confuses me:
Right near the top, it checks if
$feed_element
is an array, and makes it an array if it's not. And with the new change, it later checks if$feed_element
is aFeedsDateTimeElement
, which it can never be because of the above array code.Shouldn't that second if be checking $f instead of
$feed_element
?if (!($f instanceof FeedsDateTimeElement)) {
Comment #10
dgeo CreditAttribution: dgeo commentedSame here: not sure about how to understand this piece of code, but testing in the enumeration loop an impossible property of a parent element seems - at least - a bit strange…
I've tried here with the change proposed in #9, it works too…
Comment #11
coredumperror CreditAttribution: coredumperror commentedHere's the patch I've been using to fix this issue. It's essentially the same as the commit linked in #4, but with the $feed_element -> $f fix applied.
Comment #12
coredumperror CreditAttribution: coredumperror commentedOops. The patch in #11 is for alpha8, not the current dev.
Comment #13
twistor CreditAttribution: twistor commentedJust a note, the bug reported in #9, and patched in #11 was fixed a while ago, but this issue is left open until we get a new release since the patch is for alpha-8.
Comment #14
dgeo CreditAttribution: dgeo as a volunteer commentednow beta4, I close this according to #13