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 9:48 am
Location: England

Post by samliddicott »

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. ... lendar.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. ... lendar.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 9:21 pm
Location: USA, AZ

Post by n.oliver »

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 9:48 am
Location: England

Post by samliddicott »

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 9:48 am
Location: England

Post by samliddicott »

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 11:10 pm

Post by DiscGo »

samliddicott- You are awesome!!! Your proxy worked great!
drcook345
New Member
Posts: 18
Joined: Mon Mar 28, 2011 11:39 am
Location: USA, Utah, Vernal

Workaround to fix calendar sync problems

Post by drcook345 »

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 11:39 am
Location: USA, Utah, Vernal

Workaround to fix calendar sync problems

Post by drcook345 »

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 9:48 am
Location: England

Post by samliddicott »

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 11:39 am
Location: USA, Utah, Vernal

Workaround to fix calendar sync problems

Post by drcook345 »

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 11:39 am
Location: USA, Utah, Vernal

Post by drcook345 »

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”