Changeset 302


Ignore:
Timestamp:
May 20, 2006, 9:54:13 AM (14 years ago)
Author:
Dominic Hargreaves
Message:

Clean up after Nick, mutter mutter

Location:
wiki-toolkit/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wiki-toolkit/trunk/MANIFEST

    r260 r302  
    1111lib/Wiki/Toolkit/Extending.pod
    1212lib/Wiki/Toolkit/Feed/Atom.pm
     13lib/Wiki/Toolkit/Feed/Listing.pm
    1314lib/Wiki/Toolkit/Feed/RSS.pm
    1415lib/Wiki/Toolkit/Formatter/Default.pm
  • wiki-toolkit/trunk/lib/Wiki/Toolkit.pm

    r298 r302  
    291291    my $ret = $self->store->rename_node( %args );
    292292
    293         if($ret == -1) { return $ret; }
     293        if($ret && $ret == -1) { return $ret; }
    294294        return 1;
    295295}
  • wiki-toolkit/trunk/lib/Wiki/Toolkit/Store/Database.pm

    r300 r302  
    123123        my ($running_total_ref,$result) = @_;
    124124
    125         if($result == 0 || $result == undef) {
     125        if(($result && $result == 0) || !$result) {
    126126                # No opinion, no need to change things
    127127        } elsif($result == -1 || $result == 1) {
     
    14381438
    14391439        # If they only gave us the node name, get the node id
    1440     $sql = "SELECT id FROM node WHERE name=" . $dbh->quote($name);
    1441     my ($node_id) = $dbh->selectrow_array($sql);
     1440    unless ($node_id) {
     1441        $sql = "SELECT id FROM node WHERE name=" . $dbh->quote($name);
     1442        $node_id = $dbh->selectrow_array($sql);
     1443    }
    14421444
    14431445        # If they didn't tell us what they wanted / we couldn't find it,
     
    14471449
    14481450        # Build up our SQL
    1449         my $sql = "SELECT id, name, content.version, content.modified ";
     1451        $sql = "SELECT id, name, content.version, content.modified ";
    14501452        if($with_content) {
    14511453                $sql .= ", content.text ";
  • wiki-toolkit/trunk/t/040_rename.t

    r209 r302  
    133133
    134134        # Check the other two nodes
    135         my %anode1 = $wiki->retrieve_node("NodeOne");
     135        %anode1 = $wiki->retrieve_node("NodeOne");
    136136        is( "This is the second version of the first node, which links to NodeTwo, NodeThree, [NodeTwo], [NodeFour|Node Four] and [NodeThree | Node Three].", $anode1{'content'}, "explicit link was updated, implicit not" );
    137137        is( 3, $anode1{'version'}, "new version" );
  • wiki-toolkit/trunk/t/152_pre_plugin_approval.t

    r229 r302  
    7474
    7575                # Try to Rename
    76                 my $ok = $wiki->rename_node( old_name=>"Test Node 2", new_name=>"ren" )
     76                $ok = $wiki->rename_node( old_name=>"Test Node 2", new_name=>"ren" )
    7777            or die "Can't rename node";
    7878                is($plugin->{__pre_rename_called}, 1, "Plugin was called");
     
    8080
    8181                # Check it really wasn't
    82                 my %node = $wiki->retrieve_node("Test Node 2");
     82                %node = $wiki->retrieve_node("Test Node 2");
    8383                is($node{'version'}, 1, "Node correctly retrieved");
    8484
     
    9595
    9696                # Try to Add
    97                 my $ok = $wiki->write_node( "Test Node 4", "bar" )
     97                $ok = $wiki->write_node( "Test Node 4", "bar" )
    9898            or die "Can't add node";
    9999                is($plugin->{__pre_write_called}, 1, "Plugin was called");
     
    101101
    102102                # Check it really wasn't
    103                 my %node = $wiki->retrieve_node("Test Node 4");
     103                %node = $wiki->retrieve_node("Test Node 4");
    104104                is($node{'version'}, 0, "Node wasn't added");
    105105                is($node{'content'}, '', "Node wasn't added");
Note: See TracChangeset for help on using the changeset viewer.