Changeset 3374


Ignore:
Timestamp:
04/05/09 15:26:17 (4 years ago)
Author:
CrawfordCurrie
Message:

Item1420: there was a core problem, that it wasn't defaulting the topic name when expanding macros when only the web was known. Not actually wrong, but enough to break some plugins.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/lib/Foswiki.pm

    r3363 r3374  
    24302430    my $memWeb   = $this->{prefs}->getPreference('WEB'); 
    24312431 
     2432    # Historically this couldn't be called on web objects. 
     2433    my $webContext = $topicObject->web || $this->{webName}; 
     2434    my $topicContext = $topicObject->topic || $this->{topicName}; 
     2435 
    24322436    $this->{prefs}->setInternalPreferences( 
    2433         TOPIC => $topicObject->topic, 
    2434         WEB   => $topicObject->web 
     2437        TOPIC => $topicContext, 
     2438        WEB   => $webContext 
    24352439    ); 
    24362440 
     
    27952799    $text = $this->renderer->takeOutBlocks( $text, 'verbatim', $verbatim ); 
    27962800 
     2801    # Require defaults for plugin handlers :-( 
     2802    my $webContext = $topicObject->web || $this->{webName}; 
     2803    my $topicContext = $topicObject->topic || $this->{topicName}; 
     2804 
    27972805    my $memW = $this->{prefs}->getPreference('INCLUDINGWEB'); 
    27982806    my $memT = $this->{prefs}->getPreference('INCLUDINGTOPIC'); 
    27992807    $this->{prefs}->setInternalPreferences( 
    2800         INCLUDINGWEB   => $topicObject->web, 
    2801         INCLUDINGTOPIC => $topicObject->topic 
     2808        INCLUDINGWEB   => $webContext, 
     2809        INCLUDINGTOPIC => $topicContext 
    28022810    ); 
    28032811 
     
    28072815 
    28082816    # Plugin Hook 
    2809     $this->{plugins}->dispatch( 'commonTagsHandler', $text, $topicObject->topic, 
    2810         $topicObject->web, 0, $topicObject ); 
     2817    $this->{plugins}->dispatch( 
     2818        'commonTagsHandler', $text, 
     2819        $topicContext, 
     2820        $webContext, 
     2821        0, $topicObject ); 
    28112822 
    28122823    # process tags again because plugin hook may have added more in 
     
    28332844    # Foswiki Plugin Hook (for cache Plugins only) 
    28342845    $this->{plugins} 
    2835       ->dispatch( 'afterCommonTagsHandler', $text, $topicObject->topic, 
    2836         $topicObject->web, $topicObject ); 
     2846      ->dispatch( 'afterCommonTagsHandler', $text, $topicContext, 
     2847        $webContext, $topicObject ); 
    28372848 
    28382849    return $text; 
Note: See TracChangeset for help on using the changeset viewer.