[dw-free] Warnings in the logs when we try to map a null keyword id to its mapid
[commit: http://hg.dwscoalition.org/dw-free/rev/5899499b8c7a]
http://bugs.dwscoalition.org/show_bug.cgi?id=3097
Filter out userpic mappings with null keyword ids (pic#...) from selects.
These are handled by if-statements at other points.
Patch by
fu.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=3097
Filter out userpic mappings with null keyword ids (pic#...) from selects.
These are handled by if-statements at other points.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- cgi-bin/LJ/Userpic.pm
-------------------------------------------------------------------------------- diff -r b5f5f34d1cc9 -r 5899499b8c7a cgi-bin/LJ/Userpic.pm --- a/cgi-bin/LJ/Userpic.pm Sun Oct 03 12:27:46 2010 -0500 +++ b/cgi-bin/LJ/Userpic.pm Mon Oct 04 08:24:37 2010 +0800 @@ -1043,7 +1043,7 @@ sub set_keywords { my $dbh; if ( $have_mapid ) { - $sth = $u->prepare( "SELECT kwid FROM userpicmap3 WHERE userid=? AND picid=?" ); + $sth = $u->prepare( "SELECT kwid FROM userpicmap3 WHERE userid=? AND picid=? AND kwid NOT NULL" ); } else { $sth = $u->prepare( "SELECT kwid FROM userpicmap2 WHERE userid=? AND picid=?" ); } @@ -1056,7 +1056,7 @@ sub set_keywords { my %kwid_to_mapid; if ( $have_mapid ) { - $sth = $u->prepare( "SELECT mapid, kwid FROM userpicmap3 WHERE userid=?" ); + $sth = $u->prepare( "SELECT mapid, kwid FROM userpicmap3 WHERE userid=? AND kwid NOT NULL" ); $sth->execute( $u->userid ); while (my ($mapid, $kwid) = $sth->fetchrow_array) { --------------------------------------------------------------------------------