Changeset 380 for wiki-toolkit-plugin-categoriser
- Timestamp:
- Mar 6, 2007, 11:00:35 AM (14 years ago)
- Location:
- wiki-toolkit-plugin-categoriser/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
wiki-toolkit-plugin-categoriser/trunk/Changes
r261 r380 1 0.05 2 Fix bug - ->categories was picking up out-of-date categories. 3 1 4 0.04 13 May 2006 2 5 Renamed Wiki::Toolkit::Plugin::Categoriser -
wiki-toolkit-plugin-categoriser/trunk/lib/Wiki/Toolkit/Plugin/Categoriser.pm
r267 r380 4 4 5 5 use vars qw( $VERSION @ISA ); 6 $VERSION = '0.0 4';6 $VERSION = '0.05'; 7 7 @ISA = qw( Wiki::Toolkit::Plugin ); 8 8 … … 125 125 my ($self, %args) = @_; 126 126 my $dbh = $self->datastore->dbh; 127 my $sth = $dbh->prepare( "SELECT metadata_value FROM node INNER JOIN metadata ON (node_id = id) WHERE name = ? AND metadata_type = 'category'" ); 127 my $sth = $dbh->prepare( "SELECT metadata_value 128 FROM node 129 INNER JOIN metadata 130 ON ( node.id = metadata.node_id 131 AND node.version = metadata.version ) 132 WHERE name = ? AND metadata_type = 'category'" ); 128 133 $sth->execute( $args{node} ); 129 134 my @categories; -
wiki-toolkit-plugin-categoriser/trunk/t/categoriser.t
r261 r380 4 4 5 5 my $iterator = Wiki::Toolkit::TestLib->new_wiki_maker; 6 plan tests => ( 1 + $iterator->number * 6);6 plan tests => ( 1 + $iterator->number * 7 ); 7 7 8 8 use_ok( "Wiki::Toolkit::Plugin::Categoriser" ); … … 42 42 is_deeply( [ sort @categories ], [ "Pub Food", "Pubs" ], 43 43 "...->categories returns all categories" ); 44 45 # Make sure we only look at current category data. 46 my %node_data = $wiki->retrieve_node( "Calthorpe Arms" ); 47 $wiki->write_node( "Calthorpe Arms", 48 "Oh noes, they stopped doing food!", 49 $node_data{checksum}, 50 { category => [ "Pubs" ] } ) 51 or die "Can't write node"; 52 @categories = $categoriser->categories( node => "Calthorpe Arms" ); 53 is_deeply( \@categories, [ "Pubs" ], 54 "->categories ignores out-of-date data" ); 44 55 }
Note: See TracChangeset
for help on using the changeset viewer.