Index: trunk/extensions/DataCenter/DataCenter.db.php |
— | — | @@ -1020,6 +1020,7 @@ |
1021 | 1021 | public static function getChanges( |
1022 | 1022 | array $options = array() |
1023 | 1023 | ) { |
| 1024 | + $dbr = wfGetDB( DB_SLAVE ); |
1024 | 1025 | return self::getRows( |
1025 | 1026 | 'DataCenterDBChange', |
1026 | 1027 | 'meta', |
— | — | @@ -1027,19 +1028,22 @@ |
1028 | 1029 | array_merge_recursive( |
1029 | 1030 | $options, |
1030 | 1031 | array( |
1031 | | - 'tables' => array( 'user' ), |
| 1032 | + 'tables' => array( $dbr->tablePrefix() . 'user' ), |
1032 | 1033 | 'fields' => array( |
1033 | | - 'user_name as ' . |
| 1034 | + 'user_name as' . |
1034 | 1035 | self::getColumnName( |
1035 | 1036 | 'meta', 'change', 'username' |
1036 | 1037 | ) |
1037 | 1038 | ), |
1038 | | - 'conditions' => array( |
1039 | | - self::getColumnName( |
1040 | | - 'meta', 'change', 'user' |
1041 | | - ) . |
1042 | | - ' = user_id' |
1043 | | - ), |
| 1039 | + 'joins' => array( |
| 1040 | + 'user' => array( |
| 1041 | + 'LEFT JOIN', |
| 1042 | + 'user_id = ' . |
| 1043 | + self::getColumnName( |
| 1044 | + 'meta', 'change', 'user' |
| 1045 | + ) |
| 1046 | + ) |
| 1047 | + ) |
1044 | 1048 | ) |
1045 | 1049 | ) |
1046 | 1050 | ); |
— | — | @@ -1655,14 +1659,14 @@ |
1656 | 1660 | } |
1657 | 1661 | } |
1658 | 1662 | |
1659 | | - public function saveChange( |
| 1663 | + public function insertChange( |
1660 | 1664 | $values |
1661 | 1665 | ) { |
1662 | 1666 | if ( !is_array( $values ) ) { |
1663 | 1667 | return; |
1664 | 1668 | } |
1665 | 1669 | $change = DataCenterDBChange::newFromComponent( $this, $values ); |
1666 | | - $change->save(); |
| 1670 | + $change->insert(); |
1667 | 1671 | } |
1668 | 1672 | |
1669 | 1673 | /** |
Index: trunk/extensions/DataCenter/Controllers/Facilities.php |
— | — | @@ -58,7 +58,7 @@ |
59 | 59 | if ( isset( $component ) ) { |
60 | 60 | $component->save(); |
61 | 61 | $component->saveMetaValues( $data['meta'] ); |
62 | | - $component->saveChange( $data['change'] ); |
| 62 | + $component->insertChange( $data['change'] ); |
63 | 63 | return true; |
64 | 64 | } |
65 | 65 | return false; |
Index: trunk/extensions/DataCenter/Controllers/Assets.php |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | $asset = DataCenterDBAsset::newFromType( $type, $data['row'] ); |
52 | 52 | $asset->save(); |
53 | 53 | $asset->saveMetaValues( $data['meta'] ); |
54 | | - $asset->saveChange( $data['change'] ); |
| 54 | + $asset->insertChange( $data['change'] ); |
55 | 55 | return true; |
56 | 56 | } |
57 | 57 | } |
\ No newline at end of file |
Index: trunk/extensions/DataCenter/Controllers/Models.php |
— | — | @@ -51,7 +51,7 @@ |
52 | 52 | $model = DataCenterDBModel::newFromType( $type, $data['row'] ); |
53 | 53 | $model->save(); |
54 | 54 | $model->saveMetaValues( $data['meta'] ); |
55 | | - $model->saveChange( $data['change'] ); |
| 55 | + $model->insertChange( $data['change'] ); |
56 | 56 | return true; |
57 | 57 | } |
58 | 58 | |