From: Chris W. <la...@us...> - 2004-11-27 17:12:40
|
Update of /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2/Observer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11251/OpenInteract2/Observer Modified Files: AddDeliciousTags.pm Log Message: ensure we only get a string or arrayref Index: AddDeliciousTags.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/extra_packages/delicious_tags/OpenInteract2/Observer/AddDeliciousTags.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AddDeliciousTags.pm 25 Nov 2004 03:14:04 -0000 1.3 --- AddDeliciousTags.pm 27 Nov 2004 17:12:31 -0000 1.4 *************** *** 39,46 **** return; } ! my $object_desc = ref( $object ) . ': ' . $object->id; $log->is_info && ! $log->info( "Will add tags '$tag_listing' to '$object_desc'" ); ! my @all_tags = split /\s+/, $tag_listing; OpenInteract2::DeliciousTaggableObject::add_tags( $object, @all_tags ); } --- 39,55 ---- return; } ! my $listing_type = ref $tag_listing; ! if ( $listing_type and $listing_type ne 'ARRAY' ) { ! $log->warn( "Given a tag listing of type '$listing_type'", ! "$action_desc; I only know how to process a ", ! "space-delimited string or an arrayref of strings." ); ! return; ! } ! my @all_tags = ( $listing_type eq 'ARRAY' ) ! ? @{ $tag_listing } ! : split /\s+/, $tag_listing; $log->is_info && ! $log->info( "Will add tags '", join( ', ', @all_tags ), "' ", ! "to '", ref( $object ), ': ', eval { $object->id }, "'" ); OpenInteract2::DeliciousTaggableObject::add_tags( $object, @all_tags ); } *************** *** 63,67 **** # Mark your action 'myaction' to be observed and have the tags from ! # 'tags' mapped to your object [map] --- 72,76 ---- # Mark your action 'myaction' to be observed and have the tags from ! # the request or action parameter 'tags' mapped to your object [map] *************** *** 105,108 **** --- 114,119 ---- L<OpenInteract2::DeliciousTag> + L<OpenInteract2::DeliciousTaggableObject> + =head1 COPYRIGHT |