Jevents 2.x (Free Access)

ical remote import not working, but local works

Discuss JEvents 2.x for Joomla 1.5-2.5 here - club members can use the special club forum for faster response times.
Forum rules
When requesting support please follow these steps:

1. Update all JEvents add on's first, via the Joomla! Updater
2. Copy and Paste the JEvents Support Information from the JEvents Control Panel.
3. If you get a 500 error OR white page, enable Maximum Error Reporting in Joomla! Global Config and visit the page again, this should give you a more detailed error and help us provide a prompt response.

Postby danletkeman » Thu Dec 08, 2011 10:24 pm

Hello,

I have a link to a calendar file that I am trying to import into jevents. The link is as follows:

http://mail.gvsd.ca/gwcal/calendar/c2Nv ... ormat=ical

If I add this url into the calendar setup it says that it is an invalid vcalendar.

If I download the file from the link and upload it using the local file option, it works fine and all of the events are imported.

Is there something I am doing wrong or is just not supported?

Thanks,
Dan.
danletkeman
 
Posts: 8
Joined: Thu Dec 08, 2011 10:19 pm

Postby Geraint » Fri Dec 09, 2011 10:22 am

The "invalid vcalendar" message is when the file from the URL contains unexpected information. Its possible that when your server loads the URL that your server config means it gets some unexpected data.
JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!
User avatar
Geraint
 
Posts: 42837
Joined: Fri Feb 15, 2008 6:14 pm

Postby danletkeman » Fri Dec 09, 2011 3:02 pm

Any idea on how to get around this problem? When I save the file and load it manually it works. Seems odd.

Thanks,
Dan.
danletkeman
 
Posts: 8
Joined: Thu Dec 08, 2011 10:19 pm

Postby Geraint » Sat Dec 10, 2011 11:01 am

If you edit the file components/com_jevents/libraries/iCalImport.pho abd find code like this (line number will depending on your jevents version)

Code: Select all
      // remove spurious lines before calendar start
      if (!JString::stristr($this->rawData,'BEGIN:VCALENDAR')) {
         // check for CSV format
         $firstLine = JString::substr($this->rawData,0,JString::strpos($this->rawData,"\n")+1);
         if (JString::stristr($firstLine,'SUMMARY') && JString::stristr($firstLine,'DTSTART')
            && JString::stristr($firstLine,'DTEND') && JString::stristr($firstLine,'CATEGORIES')
            && JString::stristr($firstLine,'TIMEZONE')) {
            $timezone= date_default_timezone_get();
            $csvTrans = new CsvToiCal($file);
            $this->rawData = $csvTrans->getRawData();
            date_default_timezone_set($timezone);
          } else {
            JError::raiseWarning(0, 'Not a valid VCALENDAR data file: ' . $this->srcURL);
            //JError::raiseWarning(0, 'Not a valid VCALENDAR or CSV data file: ' . $this->srcURL);
            // return false so that we don't remove a valid calendar because of a bad URL load!
            return false;
            }
      }


Then just before the line
Code: Select all
JError::raiseWarning(0, 'Not a valid VCALENDAR data file: ' . $this->srcURL);

Put this:

echo $this->rawData;die();

It may give you a clue to what the problem is.
JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!
User avatar
Geraint
 
Posts: 42837
Joined: Fri Feb 15, 2008 6:14 pm

Postby danletkeman » Mon Dec 12, 2011 7:07 pm

Ok I did that and now I get a white screen that has the url that i entered and below that is says:

"I hope this is a URL!!"

Am I supposed to see more debug codes than this?

Thanks,
Dan.
danletkeman
 
Posts: 8
Joined: Thu Dec 08, 2011 10:19 pm

Postby Geraint » Tue Dec 13, 2011 1:57 pm

it looks as thought rawData is empty - which is your problem.

It looks as though your server may not be configured in such a way as to allow it to load other webpages in the background.
JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!
User avatar
Geraint
 
Posts: 42837
Joined: Fri Feb 15, 2008 6:14 pm

Postby danletkeman » Tue Dec 13, 2011 3:20 pm

Hmm...is there any other way to test to see if that is the problem? I just created an iframe and loaded a remote page and that works.
danletkeman
 
Posts: 8
Joined: Thu Dec 08, 2011 10:19 pm

Postby danletkeman » Fri Dec 16, 2011 6:06 pm

Ok, I uploaded the file to the server instead of trying to get it remotely, as I could have a cron job do this for me if needed.

Now when I try to import via an URL I get these messages:

file_get_contents() failed, try fsockopen

and

fsockopen: no connect for http://dev.gvsd.ca/images/stories/wes.ics - Connection refused

Is there any other way to automatically import it? If I import it using a local file it works perfectly. I just need it to be automatic so my users are not having to import it manually.

You were mentioning that the server may not be configured to allow web pages in the background. Is there a name for that? I'm using virtualmin, but I cannot find any option to allow or disallow that.

Dan.
danletkeman
 
Posts: 8
Joined: Thu Dec 08, 2011 10:19 pm

Postby danletkeman » Fri Dec 16, 2011 6:16 pm

My server is set to allow remote url's as files.

allow_url_fopen = On
danletkeman
 
Posts: 8
Joined: Thu Dec 08, 2011 10:19 pm

Postby danletkeman » Fri Dec 16, 2011 7:02 pm

Looks like this could be a php issue. I'm running 5.3.8.

Something to do with either fopen or fsockopen.
danletkeman
 
Posts: 8
Joined: Thu Dec 08, 2011 10:19 pm

Next

Return to Jevents 2.x (Free Access)

  • Who is online
  • View new posts
  • View unanswered posts
  • In total there is 1 user online :: 1 registered and 0 hidden (based on users active over the past 5 minutes)
  • Most users ever online was 94 on Tue Sep 01, 2009 12:33 am
  • Users browsing this forum: Bing [Bot]