Changeset 466
- Timestamp:
- 10/20/08 00:03:15 (4 years ago)
- Location:
- wiki-toolkit/trunk
- Files:
-
- 7 modified
-
Changes (modified) (1 diff)
-
lib/Wiki/Toolkit.pm (modified) (2 diffs)
-
lib/Wiki/Toolkit/Store/Database.pm (modified) (2 diffs)
-
lib/Wiki/Toolkit/Store/MySQL.pm (modified) (1 diff)
-
lib/Wiki/Toolkit/Store/Pg.pm (modified) (1 diff)
-
lib/Wiki/Toolkit/Store/SQLite.pm (modified) (1 diff)
-
t/021_moderation.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wiki-toolkit/trunk/Changes
r457 r466 4 4 Add store->list_metadata_names, which will tell you all the 5 5 different metadata types (names) 6 write_node: return the version of the node that was just committed, 7 if successful 6 8 7 9 0.76 13 July 2008 -
wiki-toolkit/trunk/lib/Wiki/Toolkit.pm
r465 r466 793 793 $wiki->toggle_node_moderation to change the node moderation flag. 794 794 795 Returns 1 on success, 0 on conflict, croaks on error. 795 Returns the version of the updated node on success, 0 on conflict, croaks on 796 error. 796 797 797 798 B<Note> on the metadata hashref: Any data in here that you wish to … … 853 854 $search->index_node($node, $store->charset_encode($content) ); 854 855 } 855 return 1;856 return $ret; 856 857 } 857 858 -
wiki-toolkit/trunk/lib/Wiki/Toolkit/Store/Database.pm
r457 r466 451 451 you (or your chosen subclass). This method shouldn't really be used 452 452 directly as it might overwrite someone else's changes. Croaks on error 453 but otherwise returns t rue.453 but otherwise returns the version number of the update just made. 454 454 455 455 Supplying a ref to an array of nodes that this ones links to is … … 658 658 } 659 659 660 return 1;660 return $version; 661 661 } 662 662 -
wiki-toolkit/trunk/lib/Wiki/Toolkit/Store/MySQL.pm
r431 r466 46 46 Locks the node, verifies the checksum, calls 47 47 C<write_node_post_locking> with all supplied arguments, unlocks the 48 node. Returns 1 on successful writing, 0 if checksum doesn't match,49 c roaks on error.48 node. Returns the version of the updated node on successful writing, 0 if 49 checksum doesn't match, croaks on error. 50 50 51 51 Note: Uses MySQL's user level locking, so any locks are released when -
wiki-toolkit/trunk/lib/Wiki/Toolkit/Store/Pg.pm
r431 r466 46 46 Locks the node, verifies the checksum, calls 47 47 C<write_node_post_locking> with all supplied arguments, unlocks the 48 node. Returns 1 on successful writing, 0 if checksum doesn't match,49 c roaks on error.48 node. Returns the version of the updated node on successful writing, 0 if 49 checksum doesn't match, croaks on error. 50 50 51 51 =cut -
wiki-toolkit/trunk/lib/Wiki/Toolkit/Store/SQLite.pm
r431 r466 57 57 Locks the node, verifies the checksum, calls 58 58 C<write_node_post_locking> with all supplied arguments, unlocks the 59 node. Returns 1 on successful writing, 0 if checksum doesn't match,60 c roaks on error.59 node. Returns the version of the updated node on successful writing, 0 if 60 checksum doesn't match, croaks on error. 61 61 62 62 =cut -
wiki-toolkit/trunk/t/021_moderation.t
r366 r466 7 7 plan skip_all => "no backends configured"; 8 8 } else { 9 plan tests => ( 8 6* scalar @Wiki::Toolkit::TestLib::wiki_info );9 plan tests => ( 89 * scalar @Wiki::Toolkit::TestLib::wiki_info ); 10 10 } 11 11 … … 62 62 63 63 # Update it 64 ok( $wiki->write_node("Moderation", "yy", $mn_data{checksum}),65 "Can update where moderation is enabled" );64 my $nmn_ver = $wiki->write_node("Moderation", "yy", $mn_data{checksum}); 65 ok( $nmn_ver, "Can update where moderation is enabled" ); 66 66 my %nmn_data = $wiki->retrieve_node("Moderation"); 67 67 my %nmnv_data = $wiki->retrieve_node(name=>"Moderation", version=>2); 68 is( $nmn_data{version}, '1', "Latest moderated version" ); 69 is( $nmnv_data{version}, '2', "Latest unmoderated version" ); 70 is( $nmn_ver, '2', "Latest (unmoderated) version returned by write_node" ); 68 71 69 72 # Check content was updated right
