warning: Invalid argument supplied for foreach() in /drupal/sites/all/modules/parser_ical/parser_ical.module on line 101
Title could not be retrieved from feed.

I try to upload this feed. it uploads to my browser but I cannot import the feed

https://secure.ocf.berkeley.edu/~qrc/rss.php?group=0

Chris

Comments

socialnicheguru’s picture

the line is:

foreach ($ical['VEVENT'] as $event)

does this mean that the event does not have VEVENT defined? It is not an ical feed?

Chris

ekes’s picture

Title: warning: Invalid argument supplied for foreach() in /drupal/sites/all/modules/parser_ical/parser_ical.module on line 101 » Check feed array before trying to parse to prevent PHP errors
Assigned: Unassigned » ekes

Yes. It's not an iCal feed it's an RSS feed.
You want to use one of the RSS parsers, but you aren't going to get much rich calendar date info from it I'm afraid because it's not there in a machine readable format. Maybe the (can) make an iCal feed?

warning: Invalid argument supplied for foreach() in /drupal/sites/all/modules/parser_ical/parser_ical.module on line 101

Still a minor bug though - it should check for the array before running over it - and maybe say something nicer to the user :) Assigning to self to add the change with the few patches that are there for the next release.

socialnicheguru’s picture

if I set up multiple parsers on the feed will the right parser automatically work?

i ask because sometimes, I or others might not know what type of feed the event is.

Thanks
C

sansui’s picture

I have gotten this same error message when trying to import my CiviCRM feed.

What's weird is that on my local installation, this all worked fine. The Ical parser took the civicrm feed with no issue and imported my events. On my live server, I've got it set up and now when I try to enter the civicrm feed, it spits back the error specified earlier in this thread.

warning: Invalid argument supplied for foreach() in /drupal/sites/all/modules/parser_ical/parser_ical.module on line 101 - and in the mapping, no mappable fields.

I tested with some other feeds on mozilla.org and they were able to be mapped and pulled in ok. Why does it think my civicrm feed is an acceptable ical feed on my test server, but not on my live server?

ekes’s picture

What's your URL it's not like the one above? That's an RSS feed not an iCal feed. You can use simplepie or common syndication parser to pull that one, but won't get rich date info from it.

sansui’s picture

Turned out to be a silly issue on my end - domain had not fully resolved, so it couldn't find anything. Works great now, very pleased with the ability to pull in these civicrm events and then link to their registration pages with some simple mapping

ekes’s picture

Category: bug » task

\o/ cool. Still a task (so I'll make it that this time) to make a more user-friendly error message though :/

ekes’s picture

Status: Active » Closed (duplicate)

This is actually a dupe of the error reporting to user #378474: Errors in collecting or parsing feed not clearly reported to user