Workaround to fix calendar sync problems

Discussions about the Calendar Tool at lds.org. Questions about the calendar on the classic site should be posted in the LUWS forum.
User avatar
samliddicott
Member
Posts: 77
Joined: Wed May 20, 2009 8:48 am
Location: England

Postby samliddicott » Fri Mar 18, 2011 9:38 am

In private messaging I learn that there some people for whom the work-around-wrapper doesn't work and where google makes no request from my server.

I suppose that google does some kind of caching magic which helps it decide not to bother trying again.

A solution which has worked is to make use of the flexibility of the wrapper, for example, if your work-around wrapper was:
https://mail.liddicott.com/ldscalendar.php/987654321
and this is not working, then try:
https://mail.liddicott.com/ldscalendar.php/987654321/calendar.ics
You can make up any file name you like on the end, and it will still work.

Such tricks has made the wrapper work in cases where google has otherwise refused to make any requests from my server.

I note that the ics file obtained from the LDS servers is very sparse and doesn't even identify which internal LDS calendar an event came from. If this is improved in a later release then I will be able to add filtering to the wrapper-URL's so that perhaps it may be possible to have URL's like:
https://mail.liddicott.com/ldscalendar.php/987654321/calendar=YM,YW,RS/location!=Stake%20Centre/calendar.ics
to recieve a subset of calendars on your phone - and of course you could have multiple subset URLs

n.oliver
New Member
Posts: 30
Joined: Sun May 09, 2010 8:21 pm
Location: USA, AZ

Postby n.oliver » Sun Mar 20, 2011 11:53 am

I had the lds.org feed working with Google Calendar for a few months when it died on me for some reason. Today I had some time to hunt down the issue: EOL characters in the middle of an event's description.

Code: Select all

BEGIN:VEVENT
DTSTAMP:20110320T181054Z
DTSTART:20110225T020000Z
DTEND:20110225T031500Z
SUMMARY:Ward Preparation Specialist Training @ Cullumber Primary Room
UID:6c031d6e6dd8cdab39ad2627ebc0b0ef
DESCRIPTION:7:00 PM Ward
Preparation
Specialist
Training @
Cullumber
Primary Room
END:VEVENT


a validator gave the error: "It appears that this line has not been 'folded' properly according to the iCalendar standard."

I've edited your code a bit samliddicott, removing any EOL chars in $field and $value and now its working great! My edits can be found here: http://1b4.it/labs/lds/calendar.php

Thank you so much for posting the code!! (And making it easy for me to do the same! :)

User avatar
samliddicott
Member
Posts: 77
Joined: Wed May 20, 2009 8:48 am
Location: England

Postby samliddicott » Mon Mar 28, 2011 12:51 am

n.oliver wrote:I had the lds.org feed working with Google Calendar for a few months when it died on me for some reason. Today I had some time to hunt down the issue: EOL characters in the middle of an event's description.

Code: Select all

BEGIN:VEVENT
DTSTAMP:20110320T181054Z
DTSTART:20110225T020000Z
DTEND:20110225T031500Z
SUMMARY:Ward Preparation Specialist Training @ Cullumber Primary Room
UID:6c031d6e6dd8cdab39ad2627ebc0b0ef
DESCRIPTION:7:00 PM Ward
Preparation
Specialist
Training @
Cullumber
Primary Room
END:VEVENT


a validator gave the error: "It appears that this line has not been 'folded' properly according to the iCalendar standard."

I've edited your code a bit samliddicott, removing any EOL chars in $field and $value and now its working great! My edits can be found here: http://1b4.it/labs/lds/calendar.php

Thank you so much for posting the code!! (And making it easy for me to do the same! :)


Thanks for solving that. I'd pinned that down as a potential cause but was waiting feedback from a guy with the problems.

I'll update my code. I think I'll replace the carriage return with a literal \n which seems to be the official way to start a new line.

I haven't seen any lines that actually wrap with a newline and don't begin a field properly - have you actually seen any like this?

User avatar
samliddicott
Member
Posts: 77
Joined: Wed May 20, 2009 8:48 am
Location: England

Postby samliddicott » Mon Mar 28, 2011 1:45 am

I added this line:

Code: Select all

    while (($p=strpos($line, "\r", $p)) && $p<(strlen($line)-2)) $line=substr_replace($line, "\\n", $p, 1);

which replaces inline carriage returns with \n, so I hope that the wrapper is working for more people now.

I don't think any other of your changes were needed - from analyzing existing calendars there were no lines that began without an ICAL field name on the input.

DiscGo
New Member
Posts: 4
Joined: Sun Mar 27, 2011 10:10 pm

Postby DiscGo » Mon Mar 28, 2011 6:22 am

samliddicott- You are awesome!!! Your proxy worked great!

drcook345
New Member
Posts: 18
Joined: Mon Mar 28, 2011 10:39 am
Location: USA, Utah, Vernal

Workaround to fix calendar sync problems

Postby drcook345 » Mon Mar 28, 2011 10:42 am

Hummmm . . . I'm still having problems getting things to update on a google calendar from my lds.org calendar. I'm using samliddicott wrapper address and it did populate my calendar initially, but won't update with a delete I just tried from my lds.org calendar as a test.

I've also tried putting the fake file name on the end of the update URL, but I'm not sure I'm doing that correctly.

Thoughts?

-dc

drcook345
New Member
Posts: 18
Joined: Mon Mar 28, 2011 10:39 am
Location: USA, Utah, Vernal

Workaround to fix calendar sync problems

Postby drcook345 » Mon Mar 28, 2011 1:00 pm

I was able to get the fake file approach to work, but does this mean I will need to do this, using a different file name, each time I want to refresh my google calendar from lds.org?

-dc

User avatar
samliddicott
Member
Posts: 77
Joined: Wed May 20, 2009 8:48 am
Location: England

Postby samliddicott » Tue Mar 29, 2011 2:11 am

drcook345 wrote:I was able to get the fake file approach to work, but does this mean I will need to do this, using a different file name, each time I want to refresh my google calendar from lds.org?


I don't know. It seems like changing the fake filename is more needed when you remove/add the calendar URL to your googe calendar. The refreshing of the entries should happen automatically.

drcook345
New Member
Posts: 18
Joined: Mon Mar 28, 2011 10:39 am
Location: USA, Utah, Vernal

Workaround to fix calendar sync problems

Postby drcook345 » Tue Mar 29, 2011 7:26 am

samliddicott, thanks for your help BTW . . . Yeah, for some reason my google calendar is not getting updates.:confused:

Has anyone else seen this problem and have any ideas on a solution?

-dc

drcook345
New Member
Posts: 18
Joined: Mon Mar 28, 2011 10:39 am
Location: USA, Utah, Vernal

Postby drcook345 » Tue Mar 29, 2011 7:30 am

Sorry, I'll add, I don't get the lds.org updates. My wife has a google calendar she shares and I get those updates.

-dc


Return to “Calendar”

Who is online

Users browsing this forum: No registered users and 4 guests