Chris Schmidt (crschmidt) wrote in lj_dev,
Chris Schmidt

  • Music:

S1 style browser problem

S1 style browser now displays all styles, even if they aren't public. This appears to be as a result of clusterization of the "style" table.

However, I have no idea what the s1style table looks like, and don't know if it contains the is_public information that the style table does.

Can anyone confirm or deny whether this table contains the is_public stuff that style did? If it did, I'd assume the query in would have to change to look something like this:

--- -u2003-09-04 21:01:04.000000000 -0500\?rev\=1.131
+++ 2003-09-13 14:23:02.000000000 -0500
@@ -379,13 +379,13 @@
my ($db, $sth);
if ($u->{'dversion'} >= 5) {
$db = LJ::S1::get_s1style_reader($u);
- $sth = $db->prepare("SELECT * FROM s1style WHERE userid=?");
+ $sth = $db->prepare("SELECT * FROM s1style WHERE is_public='Y' AND userid=?");

# old global table
} else {
$db = @LJ::MEMCACHE_SERVERS ? LJ::get_db_writer() : LJ::get_db_reader();
- $sth = $db->prepare("SELECT * FROM style WHERE user=?");
+ $sth = $db->prepare("SELECT * FROM style WHERE is_public='Y' AND user=?");

In any case, the "old, global table" part of this code should be updated to reflect the older query. For more information, the problem was caused by the change in the style browser:

As you can see,
my $sth = $dbr->prepare("SELECT styleid, user, styledes, type, is_embedded, is_colorfree FROM style WHERE is_public='Y' AND user=? ORDER BY type DESC,styledes");

was changed to

$styles = LJ::S1::get_user_styles($user);, which doesn't do the neccesary public check.

Suggestions are appreciated.

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded