Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

safe - dont fail on missing metadata #28

Merged
merged 2 commits into from
Sep 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Controllers/CopyPatrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ protected function handleGet() {
// WikiProjects) have been completed, let's loop through the records
// once more to build the complete dataset to be rendered into view
foreach ( $records as $key => $record ) {
$editor = $editors[$record['diff']];
$editor = null;
if ( isset( $record['diff'] ) && isset( $editors[$record['diff']] ) ) {
$editor = $editors[$record['diff']];
}

// mark it as reviewed by our bot and skip if editor is in user whitelist
if ( in_array( $editor, $userWhitelist ) && $this->getFilter() === 'open' ) {
Expand Down
4 changes: 3 additions & 1 deletion src/Dao/EnwikiDao.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ public function getRevisionsEditors( $diffs ) {

if ( isset( $revisions ) ) {
foreach ( $revisions as $revision ) {
$data[$revision['revid']] = $revision['user'];
if ( isset( $revision['revid'] ) && isset( $revision['user'] ) ) {
$data[$revision['revid']] = $revision['user'];
}
}
}
}
Expand Down