[Slashdotjp-dev 1009] [536] Fix to attach discussion to another story when duplicate stories are removed

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 3月 6日 (木) 18:23:20 JST


Revision: 536
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=536
Author:   tach
Date:     2008-03-06 18:23:19 +0900 (Thu, 06 Mar 2008)

Log Message:
-----------
Fix to attach discussion to another story when duplicate stories are removed

Modified Paths:
--------------
    slashjp/branches/2.5.0.192/Slash/DB/Static/MySQL/MySQL.pm
    slashjp/branches/2.5.0.192/debian/changelog
    slashjp/trunk/Slash/DB/Static/MySQL/MySQL.pm


-------------- next part --------------
Modified: slashjp/branches/2.5.0.192/Slash/DB/Static/MySQL/MySQL.pm
===================================================================
--- slashjp/branches/2.5.0.192/Slash/DB/Static/MySQL/MySQL.pm	2008-03-06 08:05:13 UTC (rev 535)
+++ slashjp/branches/2.5.0.192/Slash/DB/Static/MySQL/MySQL.pm	2008-03-06 09:23:19 UTC (rev 536)
@@ -1328,9 +1328,13 @@
 		$self->sqlUpdate('journal_transfer', {
 			stoid	=> 0,
 		}, 'id=' . $self->sqlQuote($story->{journal_id}));
-	} elsif ($discussion_id &&
-		$self->sqlCount('stories', "discussion=$discussion_id") > 0) {
-		# do nothing
+	} elsif ($discussion_id and
+		my $sid = $self->sqlSelect('sid', 'stories', "discussion=$discussion_id")) {
+		my $constants = getCurrentStatic();
+		$self->sqlUpdate('discussions', {
+			sid	=> $sid,
+			url	=> $constants->{rootdir} . "/article.pl?sid=$sid",
+		}, "id=$discussion_id");
 	} elsif ($discussion_id) {
 		$self->deleteDiscussion($discussion_id);
 	}

Modified: slashjp/branches/2.5.0.192/debian/changelog
===================================================================
--- slashjp/branches/2.5.0.192/debian/changelog	2008-03-06 08:05:13 UTC (rev 535)
+++ slashjp/branches/2.5.0.192/debian/changelog	2008-03-06 09:23:19 UTC (rev 536)
@@ -2,8 +2,10 @@
 
   * Add to forbid Moderation for user doing bad moderation
   * Fix to remove some unicode control characters from form
+  * Fix to attach discussion to another story when duplicate stories are
+    removed
 
- -- Taku YASUI <tach****@osdn*****>  Thu,  6 Mar 2008 07:47:56 +0000
+ -- Taku YASUI <tach****@osdn*****>  Thu,  6 Mar 2008 09:20:58 +0000
 
 slash (2.5.0.192-6) unstable; urgency=low
 

Modified: slashjp/trunk/Slash/DB/Static/MySQL/MySQL.pm
===================================================================
--- slashjp/trunk/Slash/DB/Static/MySQL/MySQL.pm	2008-03-06 08:05:13 UTC (rev 535)
+++ slashjp/trunk/Slash/DB/Static/MySQL/MySQL.pm	2008-03-06 09:23:19 UTC (rev 536)
@@ -1338,9 +1338,13 @@
 		$self->sqlUpdate('journal_transfer', {
 			stoid	=> 0,
 		}, 'id=' . $self->sqlQuote($story->{journal_id}));
-	} elsif ($discussion_id &&
-		$self->sqlCount('stories', "discussion=$discussion_id") > 0) {
-		# do nothing
+	} elsif ($discussion_id and
+		my $sid = $self->sqlSelect('sid', 'stories', "discussion=$discussion_id")) {
+		my $constants = getCurrentStatic();
+		$self->sqlUpdate('discussions', {
+			sid	=> $sid,
+			url	=> $constants->{rootdir} . "/article.pl?sid=$sid",
+		}, "id=$discussion_id");
 	} elsif ($discussion_id) {
 		$self->deleteDiscussion($discussion_id);
 	}


Slashdotjp-dev メーリングリストの案内
Back to archive index