Index: trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php |
— | — | @@ -90,7 +90,7 @@ |
91 | 91 | $ctaId = $ratingIds['cta_id']; |
92 | 92 | $feedbackId = $ratingIds['feedback_id']; |
93 | 93 | |
94 | | - $this->saveUserProperties( $revisionId ); |
| 94 | + $this->saveUserProperties( $feedbackId ); |
95 | 95 | $this->updateRollupTables( $pageId, $revisionId, $user_answers ); |
96 | 96 | |
97 | 97 | if ( $params['email'] ) { |
— | — | @@ -554,7 +554,7 @@ |
555 | 555 | * Inserts or updates properties for a specific rating |
556 | 556 | * @param $revisionId int Revision ID |
557 | 557 | */ |
558 | | - private function saveUserProperties( $revisionId ) { |
| 558 | + private function saveUserProperties( $feedbackId ) { |
559 | 559 | global $wgUser; |
560 | 560 | $dbw = wfGetDB( DB_MASTER ); |
561 | 561 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -565,28 +565,6 @@ |
566 | 566 | return null; |
567 | 567 | } |
568 | 568 | |
569 | | - // I'd really rather have this passed in, to save a query, |
570 | | - // and rule out consistency problems, but there doesn't seem |
571 | | - // to be a way to do 'RETUNING af_id' on the insert, or to |
572 | | - // pre-increment the ID column (since it's a MySQL auto- |
573 | | - // increment, not a sequence) before the insert. So, fetch |
574 | | - // the most recent feedback ID for this user on this revision. |
575 | | - // This gets called imediately after saving, so it'll almost |
576 | | - // certainly be the right one. |
577 | | - $feedbackId = $dbr->selectField( |
578 | | - 'aft_article_feedback', |
579 | | - 'af_id', |
580 | | - array( |
581 | | - 'af_revision_id' => $revisionId, |
582 | | - 'af_user_id' => $wgUser->getId() |
583 | | - ), |
584 | | - __METHOD__, |
585 | | - array( |
586 | | - 'ORDER BY' => 'af_id DESC', |
587 | | - 'LIMIT' => 1 |
588 | | - ) |
589 | | - ); |
590 | | - |
591 | 569 | // Total edits by this user |
592 | 570 | $rows[] = array( |
593 | 571 | 'afp_feedback_id' => $feedbackId, |