Changeset 584

Show
Ignore:
Timestamp:
12/14/04 13:32:21 (4 years ago)
Author:
kake
Message:

Fix bug with diff display on nodes containing macros.

Location:
trunk
Files:
1 added
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/Build.PL

    r582 r584  
    302302        $drivers{$dbtype}                 => 0, 
    303303        'File::Spec::Functions'           => 0, 
     304        'File::Temp'                      => 0, 
    304305        'Geography::NationalGrid'         => 0, 
    305306        'LWP::Simple'                     => 0, 
  • trunk/Changes

    r581 r584  
    55        Added new CSS class "node_name" for inline non-hyperlink references 
    66         to node names - see README.CSS for details. 
     7        Fix bug with diff display on nodes containing macros. 
    78         
    890.45    1 December 2004 
  • trunk/MANIFEST

    r562 r584  
    7272t/54_redirect.t 
    7373t/55_node_history.t 
     74t/56_diffs_with_macros.t 
    7475t/61_bug_textareas.t 
    7576t/62_bug_os_coords.t 
  • trunk/PREREQUISITES

    r582 r584  
    2323) 
    2424File::Spec::Functions 
     25File::Temp 
    2526( 
    2627  Geography::NationalGrid::GB 
  • trunk/lib/OpenGuides/Utils.pm

    r578 r584  
    120120        qr/\@INDEX_LINK\s+\[\[(Category|Locale)\s+([^\]|]+)\|?([^\]]+)?\]\]/ => 
    121121            sub { 
    122                   my $wiki = shift; 
     122                  # We may be being called by CGI::Wiki::Plugin::Diff, 
     123                  # which doesn't know it has to pass us $wiki - and 
     124                  # we don't use it anyway. 
     125                  if ( UNIVERSAL::isa( $_[0], "CGI::Wiki" ) ) { 
     126                      shift; # just throw it away 
     127                  } 
    123128                  my $link_title = $_[2] || "View all pages in $_[0] $_[1]"; 
    124129                  return qq(<a href="$script_name?action=index;index_type=) . uri_escape(lc($_[0])) . qq(;index_value=) . uri_escape($_[1]) . qq(">$link_title</a>); 
     
    127132             sub { 
    128133                   my ($wiki, $type, $value) = @_; 
     134 
     135                   # We may be being called by CGI::Wiki::Plugin::Diff, 
     136                   # which doesn't know it has to pass us $wiki 
     137                   unless ( UNIVERSAL::isa( $wiki, "CGI::Wiki" ) ) { 
     138                       return "(unprocessed INDEX_LIST macro)"; 
     139                   } 
     140 
    129141                   my @nodes = sort $wiki->list_nodes_by_metadata( 
    130142                       metadata_type  => $type, 
     
    148160                 }, 
    149161        qr/\@RSS\s+(.+)/ => sub { 
    150                     my ($wiki, $url) = @_; 
     162                    # We may be being called by CGI::Wiki::Plugin::Diff, 
     163                    # which doesn't know it has to pass us $wiki - and 
     164                    # we don't use it anyway. 
     165                    if ( UNIVERSAL::isa( $_[0], "CGI::Wiki" ) ) { 
     166                        shift; # just throw it away 
     167                    } 
     168 
     169                    my $url = shift; 
    151170 
    152171                    # The URL will already have been processed as an inline