<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Unable to parse recurring events during iCalendar import</title> 
  <pubDate>Fri, 10 Apr 2026 18:58:37 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/12801</link> 
  <atom:link rel="self" type="application/rss+xml" title="Unable to parse recurring events during iCalendar import" href="https://bugs.horde.org/ticket/12801/rss" /> 
  <description>Unable to parse recurring events during iCalendar import</description> 
 
   
   
  <item> 
   <title>Changes have been made in Git (master):

commit ecd18ac4f040</title> 
   <description>Changes have been made in Git (master):

commit ecd18ac4f04036cf6cede10be1c30c5d901edc5c
Author: Jan Schneider &lt;jan@horde.org&gt;
Date:   Tue Oct 29 18:44:02 2013 +0100

    [jan] Fix fatal error if recurrence exceptions have timezones set (Bug #12801).

 kronolith/docs/CHANGES  |    1 +
 kronolith/lib/Event.php |    5 ++++-
 kronolith/package.xml   |    4 ++--
 3 files changed, 7 insertions(+), 3 deletions(-)

http://git.horde.org/horde-git/-/commit/ecd18ac4f04036cf6cede10be1c30c5d901edc5c</description> 
   <pubDate>Tue, 29 Oct 2013 17:46:15 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12801#t81314</link> 
  </item> 
   
  <item> 
   <title>&gt;[jan] Fix fatal error if recurrence exceptions have timezon</title> 
   <description>&gt;[jan] Fix fatal error if recurrence exceptions have timezones set 
&gt; (Bug #12801).

Alas, it seems the problem is not completely solved.

* CalDAV counts 551 entries in its index, while the database and source ICS-file contain 595 entries. Unless not all VEVENT-objects should be in the index, there is still a problem here.
* The ICAL-URL is completely empty, supposedly because PHP&#039;s request handling died prematurely.

I will contact Jan via e-mail about a larger ICS-file with which the problem can be reproduced.</description> 
   <pubDate>Tue, 29 Oct 2013 19:11:25 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12801#t81316</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; [jan] Fix fatal error if recurrence exceptions have timez</title> 
   <description>&gt;&gt; [jan] Fix fatal error if recurrence exceptions have timezones set
&gt;&gt; (Bug #12801).
&gt;
&gt; Alas, it seems the problem is not completely solved.
&gt;
&gt; * CalDAV counts 551 entries in its index, while the database and 
&gt; source ICS-file contain 595 entries. Unless not all VEVENT-objects 
&gt; should be in the index, there is still a problem here.

This is fine, exceptions to recurring events are separate VEVENT entries.

&gt; * The ICAL-URL is completely empty, supposedly because PHP&#039;s request 
&gt; handling died prematurely.
&gt;
&gt; I will contact Jan via e-mail about a larger ICS-file with which the 
&gt; problem can be reproduced.

Works perfectly fine for me with a current Horde checkout even with the other ICS file.</description> 
   <pubDate>Wed, 30 Oct 2013 11:14:16 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12801#t81320</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; * The ICAL-URL is completely empty, supposedly because PH</title> 
   <description>&gt;&gt; * The ICAL-URL is completely empty, supposedly because PHP&#039;s request
&gt;&gt; handling died prematurely.
&gt;&gt;
&gt;&gt; I will contact Jan via e-mail about a larger ICS-file with which the
&gt;&gt; problem can be reproduced.
&gt;
&gt; Works perfectly fine for me with a current Horde checkout even with 
&gt; the other ICS file.
While I do not run the latest Horde checkout, I backported the fix you committed. The problem persists; I traced it to an OutOfMemory-problem:

In kronolith/lib/Api.php, line 896 onward, I wrote:
`$i=-1;
            foreach ($events as $dayevents) {
print(++$i.&#039;&lt;br/&gt;&#039;);
print((memory_get_usage()/1024/1024).&#039;MB / &#039;. ini_get(&#039;memory_limit&#039;) . &#039;&lt;br/&gt;&#039;);
                foreach ($dayevents as $event) {
                    $iCal-&gt;addComponent($event-&gt;toiCalendar($iCal));
                }
            }
die();
` 

From this I deduced I exceeded the memory limit. I find it dubious that experting a mere 100 calendar entries would require 184MB to yield a 2.9MB file; can we optimize this?

In Icalendar.php, we can (at least) do this:
`
    public function addComponent(&amp;$components)
    {
        if (is_array($components)) {
            foreach ($components as &amp;$component) {
                $this-&gt;addComponent($component);
            }
        } else if ($components instanceof Horde_Icalendar) {
            $components-&gt;_container = &amp;$this;
            $this-&gt;_components[] = &amp;$components;
        }
    }

`
Notice the ampersands; i.e., by-reference/address-of operator. The line &quot;$this-&gt;_components[] = &amp;$component;&quot; is still the most expensive one. Anyhow, by replacing addComponent as such, we cut down memory usage from 184MB to 53MB (and gain more performance as well)!

I recommend exploring further applications of passing values by-reference (by using the &amp;-operator) instead of by-value throughout Horde (especially oft-used functions, like domain-entity functions).




-----------


Also, the previous fix for kronolith/lib/Event.php you added checks for the Timezone-object being at index 0 or 1, but array_pop always retrieves the object at the last index (rather than the non-Timezone index). I suggest the following generalization:
`
                    foreach ($vEventException_r as $key =&gt; &amp;$vEE){
                        if ($vEE instanceof Horde_Icalendar_Vtimezone){
                            unset($vEventException_r[$key]);
                        }
                    }
                    // This should never happen, but protect against it anyway.
                    if (count($vEventException_r) &gt; 1) {
                        throw new Kronolith_Exception(_(&quot;Unable to parse event.&quot;));
                    }
                    $vEventException = array_pop($vEventException_r);
`</description> 
   <pubDate>Sun, 03 Nov 2013 14:55:17 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12801#t81351</link> 
  </item> 
   
  <item> 
   <title>&gt; I suggest the following generalization:
&gt; `
$vEventExcep</title> 
   <description>&gt; I suggest the following generalization:
&gt; `
$vEventException_r = $exceptionEvent-&gt;toiCalendar($calendar);
&gt;                     foreach ($vEventException_r as $key =&gt; &amp;$vEE){
&gt;                         if ($vEE instanceof Horde_Icalendar_Vtimezone){
&gt;                             unset($vEventException_r[$key]);
&gt;                         }
&gt;                     }
&gt;                     // This should never happen, but protect against 
&gt; it anyway.
&gt;                     if (count($vEventException_r) &gt; 1) {
&gt;                         throw new Kronolith_Exception(_(&quot;Unable to 
&gt; parse event.&quot;));
&gt;                     }
&gt;                     $vEventException = array_pop($vEventException_r);
&gt; `
</description> 
   <pubDate>Sun, 03 Nov 2013 14:58:10 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12801#t81352</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
