madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r21009: LJSV-2014: merge action has been fixed.

Committer: sbelyaev
LJSV-2014: merge action has been fixed.
U   trunk/cgi-bin/LJ/Support/Request/Tag.pm
Modified: trunk/cgi-bin/LJ/Support/Request/Tag.pm
===================================================================
--- trunk/cgi-bin/LJ/Support/Request/Tag.pm	2012-01-26 11:59:44 UTC (rev 21008)
+++ trunk/cgi-bin/LJ/Support/Request/Tag.pm	2012-01-26 12:16:55 UTC (rev 21009)
@@ -176,7 +176,7 @@
                     $dbh->do( 'INSERT INTO supporttagmap (spid, sptagid) ' .
                               'VALUES (?, ?) ',
                               undef,
-                              $spid,
+                              $current_spid,
                               $destination_id );
                 }
             }
@@ -214,6 +214,9 @@
         return 1;
     }
 
+    # one cat. case
+
+    #does exist tag name?
     my ($exists_stagid)
             = $dbh->selectrow_array( "SELECT sptagid FROM supporttag " .
                                      "WHERE name=? AND spcatid = ?",
@@ -223,12 +226,14 @@
 
     my $name_exists = !!$exists_stagid;
 
+    # The name does not exist. Just update.
     if (!$name_exists) {
         $dbh->do( 'UPDATE supporttag SET name=? WHERE sptagid=?',
                   undef,
                   $new_name,
                   $sptagid );
     } elsif ($name_exists && $allowmerge) {
+        #recv. current spid for tag id
         my ($current_spid) = $dbh->selectrow_array( 'SELECT spid ' .
                                                     'FROM supporttagmap ' .
                                                     'WHERE sptagid = ?',
@@ -249,7 +254,7 @@
             $dbh->do( 'INSERT INTO supporttagmap (spid, sptagid) ' .
                       'VALUES (?, ?)',
                       undef,
-                      $spid,
+                      $current_spid,
                       $exists_stagid );
         }
     } else {

Tags: livejournal, madeon, pm, sbelyaev
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments