Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I do not have time today to write a patch on this as GIT is not my strong suit ( working on that), but here are the changes I made to make the #URL# work again.
Google sends the event link back under the $events->htmlLink
STARTING ON 690
$start = $event->getStart();
$end = $event->getEnd();
$allday = !empty($start->date);
$date = !empty($start->date) ? $start->date : $start->dateTime;
$gcal_time = !empty($start->dateTime) ? format_date($start->dateTime, 'custom', $timeformat) : '';
$gcal_endtime = !empty($end->dateTime) ? format_date($end->dateTime, 'custom', $timeformat) : '';
$unixdate = strtotime($date);
//Changed by tomseeber
$link = $event->htmlLink;
if (strlen($title) > 1 && $status != 'canceled' && strlen($date) > 0) {
$temp[] = array(
'title' => $title,
'description' => $description,
'allday' => $allday,
'where' => $location,
'date' => format_date($unixdate, 'custom', $dateformat),
'timestamp' => $unixdate,
'time' => $gcal_time,
'endtime' => $gcal_endtime,
'link' => $link, // TODO
'today' => date("Y-m-d") == date("Y-m-d", $unixdate),
'tomorrow' => (date("Y-m-d",strtotime("+1 day")) == date("Y-m-d", $unixdate)),
'thisweek' => (date("Y-W") == date("Y-W", $unixdate)),
'thismonth' => (date("Y-m") == date("Y-m", $unixdate)),
);
}
$count++;
}
Hope this helps someone else, I will be on vacation for the next few days ( but I will try to get the time to create this as a more formal patch if someone does not get to this first).
Happy Holidays all.
Comment | File | Size | Author |
---|---|---|---|
#6 | url_not_working_-2382039-6.patch | 1.14 KB | chrisfromredfin |
#5 | url_not_working_-2382039-5.patch | 1.14 KB | chrisfromredfin |
#3 | gcal_events-get-link-2382039-3.patch | 1.12 KB | jackalope |
#1 | link-2382039-1.patch | 897 bytes | Stefan Freudenberg |
Comments
Comment #1
Stefan Freudenberg CreditAttribution: Stefan Freudenberg commentedI have created a patch, the only difference to the above suggestion is that I opted for using
Google_Service_Calendar_Event::getHtmlLink
instead of accessing the property directly. That is more in line with the rest of the code.Comment #2
Stefan Freudenberg CreditAttribution: Stefan Freudenberg commentedChange version, because I rolled my patch against 7.x-1.x. I assume the patch applies to 6.x-1.x as well.
Comment #3
jackalope CreditAttribution: jackalope commentedI ran into the same problem with the Drupal 6 dev version of this module. I tried Stefan's patch but it didn't apply, so I've created my own patch for 6.x-1.x-dev.
p.s. Hi Stefan! :)
Comment #4
Stefan Freudenberg CreditAttribution: Stefan Freudenberg commentedPlease review.
Comment #5
chrisfromredfinPatch in 3 wouldn't apply - I think it was generated from the wrong folder. I re-rolled it here.
Comment #6
chrisfromredfinOOPS I typo'd event as "events" which barfed. this is correct. This is a D6 patch, to be clear, based on #3 above.
Comment #9
jdwfly CreditAttribution: jdwfly commentedFor some odd reason the patch wouldn't apply cleanly, but its a simple change. Thanks for the work everyone. Fixes have been committed to both 7.x and 6.x branches.