Skip to content

Commit

Permalink
ArticleInfo: correct name of 'ip_edits' property in API response
Browse files Browse the repository at this point in the history
  • Loading branch information
MusikAnimal committed Jun 24, 2023
1 parent e7171e2 commit b5b7382
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Release Notes #

## 3.17.12 ##
- ArticleInfo: Correct the name of the `ip_edits` property in the ArticleInfo
API response.

## 3.17.11 ##
- ArticleInfo: added a "bot data" and "(semi-)automated edits" API endpoints.
See https://www.mediawiki.org/wiki/XTools/API/Page#Bot_data for more info.
- ArticleInfo: the [article info API](https://www.mediawiki.org/wiki/XTools/API/Page#Article_info)
now returns an `ip_editors` property which is a count of the number of unique
IPs that edited the page.
now returns an `ip_edits` property.
- Localization updates.

## 3.17.10 ##
Expand Down
2 changes: 1 addition & 1 deletion config/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# The release process is documented at https://www.mediawiki.org/wiki/XTools/Development#Releases

parameters:
app.version: 3.17.11
app.version: 3.17.12
2 changes: 1 addition & 1 deletion src/Model/ArticleInfoApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public function getArticleInfoApiData(Project $project, Page $page): array
$data = array_merge($data, [
'revisions' => (int) $info['num_edits'],
'editors' => (int) $info['num_editors'],
'ip_editors' => (int) $info['num_ip_editors'],
'ip_edits' => (int) $info['ip_edits'],
'minor_edits' => (int) $info['minor_edits'],
'author' => $info['author'],
'author_editcount' => null === $info['author_editcount'] ? null : (int) $info['author_editcount'],
Expand Down
2 changes: 1 addition & 1 deletion src/Repository/ArticleInfoRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public function getBasicEditingInfo(Page $page)
(
SELECT COUNT(rev_id) AS num_edits,
COUNT(DISTINCT(rev_actor)) AS num_editors,
SUM(actor_user IS NULL) AS num_ip_editors,
SUM(actor_user IS NULL) AS ip_edits,
SUM(rev_minor_edit) AS minor_edits
FROM $revTable
JOIN $actorTable ON actor_id = rev_actor
Expand Down
2 changes: 1 addition & 1 deletion tests/Controller/ArticleInfoControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function testArticleInfoApi(): void
static::assertEquals(
[
'project', 'page', 'watchers', 'pageviews', 'pageviews_offset', 'revisions', 'editors',
'ip_editors', 'minor_edits', 'author', 'author_editcount', 'created_at', 'created_rev_id',
'ip_edits', 'minor_edits', 'author', 'author_editcount', 'created_at', 'created_rev_id',
'modified_at', 'secs_since_last_edit', 'last_edit_id', 'assessment', 'elapsed_time',
],
array_keys($data)
Expand Down

0 comments on commit b5b7382

Please sign in to comment.