You are here: Foswiki>Tasks Web>Item1546 (19 Jul 2015, GeorgeClark)Edit Attach

Item1546: CalendarPlugin issues when included

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: CalendarPlugin
Branches:
Reported By: MarcSCHAEFER
Waiting For:
Last Change By: GeorgeClark

FIX FOR THE PROBLEM DESCRIBED BELOW:

--- CalendarPlugin.pm-2009-05-01        2009-05-01 16:37:48.000000000 +0000
+++ CalendarPlugin.pm   2009-05-01 16:44:44.000000000 +0000
@@ -453,6 +453,9 @@
     # (don't rely on Foswiki::Func::expandCommonVariables to avoid deep recursion)
     $text =~ s/%INCLUDE{(.*?)}%/&expandIncludedEvents( $1, $options{web}, $options{topic}, () )/geo;
 
+    $text =~ s/%CALENDAR[^%]*%/_WAS_A_CALENDAR_CALL_HERE_/g;
+    $text = TWiki::Func::expandCommonVariables($text, $theTopic, $theWeb);
+
     # Before this was modified to do multiple months, there was a
     # clause to bail out early if there were no events, simply
     # returning a "blank" calendar. However, since the plugin can now

BUGS FOR THE ABOVE FIX

  • if a CALENDAR takes data from another CALENDAR using a list mode, it will fail. Just include the same base data and it will work.

PROBLEM DESCRIPTION

If you have dynamic entries in a document, and use this document as the entry source for %CALENDAR%, the dynamic entries will only be displayed when you use %CALENDAR% directly in the same document. If you use it from another document or include the document, the dynamically generated entries will not be seen.

Example
  • WebLeftBarExample has
    %CALENDAR{topic="CalendrierActivites" web="Main"}%
    
  • WebHome has
    %CALENDAR{topic="CalendrierActivites" aslist="1" days="30" datenumberformat="   * $year-$mo-$day"}%
    
  • CalendrierActivites has
       * 1 Wed - [[http://linux-neuchatel.he-arc.ch][linux-ne]]
    %SEARCH{ "^Activite[A-Z0-9]"
                         scope="topic"
                         web="%WEB%"
                         regex="on" nosearch="on" nototal="on" order="modified" reverse="on" limit="100"
                         format="   * $formfield(EventDate) - [[$web.$topic][$formfield(ShortTitle)]]"
    }%
    %CALENDAR{topic="CalendrierActivites" web="Main"}%
    

Results

(http://www.alphanet.ch:8080/cgi-bin/foswiki/view/Main/WebHome for live example)
Had to fix this so I could include calendars from external sources.

-- CrawfordCurrie - 30 Jun 2010

ItemTemplate edit

Summary CalendarPlugin issues when included
ReportedBy MarcSCHAEFER
Codebase 1.0.4
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component CalendarPlugin
Priority Normal
CurrentState Closed
WaitingFor
Checkins CalendarPlugin:935752dc7796
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic revision: r4 - 19 Jul 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy