don't try to prefill edit summary when section=new (relevant only for preload=)
[lhc/web/wiklou.git] / includes / RecentChange.php
index 9495057..69cbb17 100644 (file)
@@ -63,10 +63,10 @@ class RecentChange
                return $rc;
        }
 
-       /* static */ function newFromCurRow( $row )
+       /* static */ function newFromCurRow( $row, $rc_this_oldid = 0 )
        {
                $rc = new RecentChange;
-               $rc->loadFromCurRow( $row );
+               $rc->loadFromCurRow( $row, $rc_this_oldid );
                $rc->notificationtimestamp = false;
                $rc->numberofWatchingusers = false;
                return $rc;
@@ -137,18 +137,19 @@ class RecentChange
                        # been purged, it just locks up the indexes needlessly.
                        global $wgRCMaxAge;
                        $age = time() - wfTimestamp( TS_UNIX, $lastTime );
-#                      if( $age < $wgRCMaxAge ) {
-#                              # Update rc_this_oldid for the entries which were current
-#                              $dbw->update( 'recentchanges',
-#                                      array( /* SET */
-#                                              'rc_this_oldid' => $oldid
-#                                      ), array( /* WHERE */
-#                                              'rc_namespace' => $ns,
-#                                              'rc_title' => $title,
-#                                              'rc_timestamp' => $dbw->timestamp( $lastTime )
-#                                      ), $fname
-#                              );
-#                      }
+                       if( $age < $wgRCMaxAge ) {
+                                # live hack, will commit once tested - kate
+                               # Update rc_this_oldid for the entries which were current
+                               #$dbw->update( 'recentchanges',
+                               #       array( /* SET */
+                               #               'rc_this_oldid' => $oldid
+                               #       ), array( /* WHERE */
+                               #               'rc_namespace' => $ns,
+                               #               'rc_title' => $title,
+                               #               'rc_timestamp' => $dbw->timestamp( $lastTime )
+                               #       ), $fname
+                               #);
+                       }
 
                        # Update rc_cur_time
                        $dbw->update( 'recentchanges', array( 'rc_cur_time' => $now ),
@@ -373,8 +374,8 @@ class RecentChange
                        'rc_minor' => $row->rev_minor_edit ? 1 : 0,
                        'rc_type' => $row->page_is_new ? RC_NEW : RC_EDIT,
                        'rc_cur_id' => $row->page_id,
-                       'rc_this_oldid' => (int)$row->rev_id,
-                       'rc_last_oldid' => 0,
+                       'rc_this_oldid' => $row->rev_id,
+                       'rc_last_oldid' => isset($row->rc_last_oldid) ? $row->rc_last_oldid : 0,
                        'rc_bot'        => 0,
                        'rc_moved_to_ns'        => 0,
                        'rc_moved_to_title'     => '',