Recent dev releases of Feeds have included major internal changes, including API changes, which break Date iCal. However, a patch which is not available in the latest recommended release (2.0-alpha8) is required to make Date iCal's date import mechanism work.

So, all Date iCal users who import events into their site from iCal feeds are encouraged to use Feeds 2.0-alpha8 with the attached patch file applied (it originally comes from #1989196: Never Pass FeedsDateTime objects into date_create). It fixes the date import code that's broken in Feeds.

This patch does not apply to Date iCal. It must be applied to the Feeds module.

Comments

coredumperror’s picture

Status: Active » Reviewed & tested by the community

Changing status to make this issue stand out more in the list.

coredumperror’s picture

Issue summary: View changes
coredumperror’s picture

StatusFileSize
new1.47 KB

I must sincerely apologize to anyone who downloaded this patch when I first posted this issue. I messed up when I copied it, and it apparently became corrupted.

The new patch that I've attached remedies this problem. It can be applied with patch -p1 < /path/to/patch.

coredumperror’s picture

StatusFileSize
new1.46 KB

And yet again, I screwed up. This new patch is the right one. Really.

vinmassaro’s picture

Is this fixed in the dev branch of Feeds? I can't find an issue with your patch in the Feeds queue.

coredumperror’s picture

Yes, but as I mentioned in this issue, recent dev releases of Feeds have made sweeping changes which break Date iCal, so it's no longer safe to use the Feeds dev releases to overcome this bug.

As for my particular patch, it's actually a slight edit to the patch posted in #1989196: Never Pass FeedsDateTime objects into date_create, because that patch has a small bug in it.

jenlampton’s picture

Can you please post an updated patch to #1989196: Never Pass FeedsDateTime objects into date_create?

Even if it's a patch specifically for the 7.x-2.0-alpha8 version (instead of dev), it would be good to have a record of it in the feeds queue.

coredumperror’s picture

Done.

jgarriso’s picture

Since the last comment on this issue is several months old I'm wondering if any progress has been made on getting Date iCal to work with the latest feeds-dev version or if this patch is still the preferred way to deal with the issue?

coredumperror’s picture

Unfortunately, the problem is not with Date iCal, so nothing I can do which will fix the problem. Double-unfortunately, Feeds is still undergoing frequent API changes in its dev release cycle, so I can't start working on a way to make Date iCal compatible with the new way that Feeds works until they release an official post-alpha8 version. Triple-unfortunately, I'm going to be swamped with work for the next few months, and may not be able to do any updates to Date iCal during that period.

Once Feeds releases a stable version, I will try my best to update Date iCal to work with it ASAP. Though I can't guarantee any kind of timeframe.

jjmackow’s picture

Has anyone got any idea if this patch been rolled into the October-2014 dev version of Feeds, 7.x-2.0-alpha8+56-dev ?

The code looks similar but there are different variable.

I think this is the issue report in feeds: https://www.drupal.org/node/857216

coredumperror’s picture

I'm fairly sure it has, but unfortunately, that version of Feeds is incompatible with Date iCal. Feeds has made some significant API changes in their more recent dev builds, and they break Date iCal's importer. Once Feeds releases a new recommended version, I'll update Date iCal to match.

Until then, this patch, applied to alpha8, is unfortunately the only working solution.

AndreasST’s picture

I can't get it to work
After applying the patch manualy, i get the following code and a WSOD at .../admin/structure/feeds/ical_importer/mapping
Here is the code after patching date.inc
Please help - thanks.

function date_feeds_set_target($source, $entity, $target, $feed_element) {
  list($field_name, $sub_field) = explode(':', $target, 2);
  if (!is_array($feed_element)) {
    $feed_element = array($feed_element);
  }
  $delta = 0;
  foreach ($feed_element as $f) {
    if (!($f instanceof FeedsDateTimeElement)) {
      if (empty($f) || !is_numeric($f) && is_string($f) && !date_create($f)) {
        $f = new FeedsDateTimeElement(NULL, NULL);
      }
      elseif ($sub_field == 'end') {
        $f = new FeedsDateTimeElement(NULL, $f);
      }
      else {
        $f = new FeedsDateTimeElement($f, NULL);
      }
    }
    $f->buildDateField($entity, $field_name, $delta);
    $delta++;
  }
}
coredumperror’s picture

That code looks right to me. Could you check your /admin/reports/dblog page to see what error is triggering the WSOD? I can't debug the problem if I don't know where it's originating.

AndreasST’s picture

There is no error in the dblog.
Maybe WSOD is the wrong wording - i get a blank page with nothing in it.

coredumperror’s picture

WSOD is right. That's definitely the White Screen Of Death. And now that I think about it, that does usually happen when the error is so fatal that PHP can't properly report it.

Unfortunately, that means I have no way of properly debugging the problem. The best I can offer is this:

Did you apply this patch to Feeds 2.0-alpha8, the current recommended release? Any other version, like the newest dev release, will not work with Date iCal.

Are you using Date iCal v3.3? If not, I suggest you upgrade to it.

The fact that you're getting a WSOD on the Mapping page tells me that it's possible that some other module is interfering with Date iCal or Feeds. Try disabling modules that interface with Feeds to see if the WSOD goes away.

izmeez’s picture

Will increasing the php memory limit help?

AndreasST’s picture

So, i waited a night and a few hours...
Tryed again - it works!

Feeds 2.0-alpha8 YES from beginning
iCal v3.3 YES from beginning
I didn't disable any module.
PHP memory limit was and is still at 280MB
Maybe there were some other processes allocating too much memory - i don't know.

Thanks for your time!

coredumperror’s picture

Glad to hear that your problem has been resolved.

charlie-s’s picture

So if this is RTBC when will it be committed?

coredumperror’s picture

I marked it as RTBC here to make it stand out in the issue queue. Since it's not actually a patch for Date iCal, I can't commit it. And it won't apply to the Feeds dev release because they changed a lot of the internal code since alpha8.

I can't really do anything more than this until the Feeds team finally releases a new official version. They're making so many internal changes in the dev releases that anything I do would likely get broken in short order.

pianomansam’s picture

This patch is working for me. Let's get it committed so I don't have to keep patching new releases!

coredumperror’s picture

Feeds 7.x-2.0-alpha9 is out, but it's just a security release. They apparently didn't include the huge overhaul they've been working on for years. So this patch is still necessary.

However, this is still a patch for Feeds, not Date iCal. This patch won't apply against the latest dev releases of Feeds, and doesn't need to be re-applied when new versions of Date iCal come out.

ucscholar’s picture

I just want to confirm. If I update Feeds from 2.0-alpha8 to 7.x-2.0-alpha9, I would need to reapply this patch. Is my understanding correct?

coredumperror’s picture

Yes. This patch has not been incorporated into Feeds 2.0-alpha9, so you'll need to reapply it after updating.

Poieo’s picture

Status: Reviewed & tested by the community » Closed (fixed)

This fix appears to be included in the latest beta release of feeds.

coredumperror’s picture

Oh wow, they finally made a new official release? That's great! Thanks for the heads up. I'll get right on to testing this.

coredumperror’s picture

I can now confirm that the newest dev release of Date iCal works fine with the newest recommended release of Feeds.

After more than a year, this is finally fixed!!