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
Comment | File | Size | Author |
---|---|---|---|
#9 | gcal_events.module.diff | 1.63 KB | pzingg |
Comments
Comment #1
Se7enLC CreditAttribution: Se7enLC commentedTry 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.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedIf 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...
Comment #3
macdoggie CreditAttribution: macdoggie commentedI am experiencing the same issue. Is there any resolution? The suggestion above did not work.
appreciate any suggestions. thx
Comment #4
Se7enLC CreditAttribution: Se7enLC commentedIf 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?
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedI 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.
Comment #6
Se7enLC CreditAttribution: Se7enLC commentedAha, 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.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedAny chance of a fix for this?
Thanks.
Comment #8
pzingg CreditAttribution: pzingg commentedThe 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.
Comment #9
pzingg CreditAttribution: pzingg commentedHere 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.
Comment #10
MC_McMic CreditAttribution: MC_McMic commentedI 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.
Comment #11
jimmynash CreditAttribution: jimmynash commentedI 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
Comment #12
jdwfly CreditAttribution: jdwfly commentedComment #13
jdwfly CreditAttribution: jdwfly commented