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] changelog2010-01-08 11:45 pm

[dw-free] Crossposting footer truncates after unknown amount of time

[commit: http://hg.dwscoalition.org/dw-free/rev/63973df563bf]

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

Fix update-db for new installations so it doesn't require a property we
haven't built yet.

Patch by [personal profile] sophie.

Files modified:
  • bin/upgrading/update-db-general.pl
--------------------------------------------------------------------------------
diff -r c9ab986c6c8d -r 63973df563bf bin/upgrading/update-db-general.pl
--- a/bin/upgrading/update-db-general.pl	Fri Jan 08 23:43:26 2010 +0000
+++ b/bin/upgrading/update-db-general.pl	Fri Jan 08 23:45:20 2010 +0000
@@ -3811,13 +3811,16 @@ EOF
 
     # convert xpost-footer-update from char to blobchar
     if ( table_relevant( 'userproplite2' ) ) {
-        my $upropid = LJ::get_prop( user => 'crosspost_footer_text' )->{upropid};
+        my $uprop = LJ::get_prop( user => 'crosspost_footer_text' );
+        if ( defined( $uprop ) ) {
+            my $upropid = $uprop->{upropid};
 
-        my $testresult = $dbh->selectrow_array( "SELECT upropid FROM userproplite2 WHERE upropid = $upropid LIMIT 1" );
-        if ( $testresult > 0 ) {
-            do_sql( "INSERT IGNORE INTO userpropblob (userid, upropid, value) " .
-                    "    SELECT userid, upropid, value FROM userproplite2 WHERE upropid = $upropid" );
-            do_sql( "DELETE FROM userproplite2 WHERE upropid = $upropid" );
+            my $testresult = $dbh->selectrow_array( "SELECT upropid FROM userproplite2 WHERE upropid = $upropid LIMIT 1" );
+            if ( $testresult > 0 ) {
+                do_sql( "INSERT IGNORE INTO userpropblob (userid, upropid, value) " .
+                        "    SELECT userid, upropid, value FROM userproplite2 WHERE upropid = $upropid" );
+                do_sql( "DELETE FROM userproplite2 WHERE upropid = $upropid" );
+            }
         }
     }
     if ( table_relevant( "userproplist" ) && ! check_dbnote("xpost_footer_update") ) {
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org