I've verified a calendar is public by going to calendar details page, pasting HTML for calendar address into a browser not logged into gmail or google accounts. (Using the HTMLfrom calendar details page, you get to calendar when not authenticated.) Entered corresponding xml or calendar id into "Calendar ID(s)" field of gcal_events block. Title template is

<b><a href="#URL#">#TITLE#</A></b><br>

Clicking on title of event in gcal_events block takes you to a page asking you to "sign into to google calendar with your google account", rather than directly to the event like band.mit.edu does. Same behaivior when using "usa__en@holiday.calendar.google.com" as calendar id.

Any ideas on what I'm doing wrong or need to do?

Drpal 6.15
6.x-1.x-dev

CommentFileSizeAuthor
#9 gcal_events.module.diff1.63 KBpzingg
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Se7enLC’s picture

Try using #URLENC# instead of #URL# - it's possible that parts of the URL are not being interpreted correctly in the non-encoded version of the URL.

Anonymous’s picture

If I use

<b><a href="#URLENC#">#TITLE#</A></b><br>

instead of

<b><a href="#URL#">#TITLE#</A></b><br>

the link generated is

http://news.example.com/#URLENC%23

is that what you meant to try?

Thanks...

macdoggie’s picture

I am experiencing the same issue. Is there any resolution? The suggestion above did not work.
appreciate any suggestions. thx

Se7enLC’s picture

If it works for usa__en@holiday.calendar.google.com, but not for your own calendar, it must be a problem with the calendar. What is your calendar ID? Are you *SURE* it's a public calendar?

Anonymous’s picture

I go to google calendar settings for the calendar, share this calendar. "Make this calendar public" is checked, and "See all event details" selected. On Calendar Details page, click on 'html' and this link is generated

http://www.google.com/calendar/hosted/islandcreekoysters.com/embed?src=i...

Unauthenticated in that domain I can see the calendar so am pretty sure its public. #URL# still does not work for me as above.

Se7enLC’s picture

Aha, I found the problem. gcal_events only works with personal calendars - I never tried it with a hosted calendar, before. The only difference SHOULD be that the XML address is different, so I'm sure it's a small fix to get it to work. If you know any PHP and want to give it a try it should be pretty easy to see where the URLs are being compiled. The code normally takes the URL you give it and extracts the calendar ID, then generates the URLS needed using that. In the case of hosted domains, it looks like it's going to need a different base URL (with "/hosted/islandcreekoysters.com/" in the URL).

I'll take a look at this in a couple days and see if I can come up with a good fix.

Anonymous’s picture

Any chance of a fix for this?

Thanks.

pzingg’s picture

The problem is with hosted (that is, Google Apps) public calendars. The 'link' property of a public calendar item is something like this:

http://www.google.com/calendar/event?eid=Xzk1aG0ycjFrNmdvajhvaGtjY3JtY2....

When you put #URL# in the Event Template, by the time it's rendered by Drupal in a block, the "eid=" in the query string of th e link becomes "eid%3D" and that breaks the link. Being a Drupal noob, I'm not sure where the encoding is being done or how to turn it off.

I debugged a bit and found the error. The feed parser returns URL-encoded links in $item->get_link(). I will attach a patch to urldecode this below.

pzingg’s picture

FileSize
1.63 KB

Here is the patch that does a urldecode() call on $item->link() when the items are being read from the feeds and converted into PHP array elements.

MC_McMic’s picture

I assume that this was a patch for a previous version of gcal_events. I found it while searching for a solution to the same problem as stated in the original post (#URL# not linking properly).

In the current version of GCal Events (6.x-1.4), you can remedy this problem by going to line 729 in your "gcal_events.module" file and replacing "$item['link']" with "urldecode($item['link'])". It worked for me at least.

jimmynash’s picture

I tried the modification listed in #10 and it worked for me as well. The calendar event being linked to was a hosted Google Apps calendar. I am using core 6.19 and gcal_events 6.x-1.4

jdwfly’s picture

Category: support » bug
jdwfly’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)