mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-10-26 02:54 am

[dw-free] create function for creating s2 entry objects

[commit: http://hg.dwscoalition.org/dw-free/rev/89a6a4b11d29]

http://bugs.dwscoalition.org/show_bug.cgi?id=1670

Pass keywords to userpic object to fix missing title.

Patch by [personal profile] wyntarvox.

Files modified:
  • cgi-bin/LJ/S2.pm
--------------------------------------------------------------------------------
diff -r 4418c40f7083 -r 89a6a4b11d29 cgi-bin/LJ/S2.pm
--- a/cgi-bin/LJ/S2.pm	Mon Oct 26 02:50:30 2009 +0000
+++ b/cgi-bin/LJ/S2.pm	Mon Oct 26 02:54:51 2009 +0000
@@ -1909,26 +1909,29 @@ sub Entry_from_entryobj
 
     # loading S2 Userpic
     my $userpic;
+    my $kw = $entry_obj->userpic_kw_from_props( $entry_obj->props );
+
     # if the post was made in a community, use either the userpic it was posted with or the community pic depending on the style setting
     if ( $posterid == $journalid || !S2::get_property_value($opts->{ctx}, 'use_shared_pic') ) {
-        $userpic = Image_userpic($poster, $entry_obj->userpic->picid) if $entry_obj->userpic;
-    } else {
-       $userpic = Image_userpic($journal, $journal->userpic->picid) if $journal->userpic;
+        $userpic = Image_userpic( $poster, $entry_obj->userpic->picid, $kw ) if $entry_obj->userpic;
+    } else {
+        $userpic = Image_userpic( $journal, $journal->userpic->picid ) if $journal->userpic;
     } 
 
     # override used moodtheme if necessary
     my $moodthemeid = $u->prop( 'opt_forcemoodtheme' ) eq 'Y' ?
-       $u->{moodthemeid} : $poster->{moodthemeid};
+        $u->{moodthemeid} : $poster->{moodthemeid};
 
     # tags loading and sorting
     my $tags = LJ::Tags::get_logtags( $journal, $jitemid );
     my @taglist;
     while (my ($keywordid, $keyword) = each %{$tags->{$jitemid} || {}}) {
-            push @taglist, Tag( $journal, $keywordid => $keyword );
-        }
+        push @taglist, Tag( $journal, $keywordid => $keyword );
+    }
+
     @taglist = sort { $a->{name} cmp $b->{name} } @taglist;
     if ( $opts->{enable_tags_compatibility} && @taglist ) {
-            $text .= LJ::S2::get_tags_text($opts->{ctx}, \@taglist);
+        $text .= LJ::S2::get_tags_text($opts->{ctx}, \@taglist);
     }
 
     # comment information
--------------------------------------------------------------------------------