Page MenuHomePhabricator

Feature request: Add Cargo pageData column "Editor"
Closed, ResolvedPublic

Description

I have added a field "Editor" to $wgCargoPageDataColumns on my Wiki, which saves the username of the last editor of a page.

Added the following code to do so:

After line 38:

if ( in_array( 'editor', $wgCargoPageDataColumns ) ) {
        $fieldTypes['_editor'] = array( 'String', false );
}

and after line 122:

if ( in_array( 'editor', $wgCargoPageDataColumns ) ) {
        $pageDataValues['_editor'] = $wikiPage->getUserText();
}

Could this be merged into a next version of Cargo? Thanks!

Event Timeline

I thought about having this kind of column (maybe "_lastEditor" is a little better name for it). But how useful is this information?

Thanks for the quick feedback. I agree that _lastEditor would be a more descriptive name.

I'm using this to generate an overview of the pages within a category modified in the last week, along with metadata (from Cargo-powered templates) and whoever last modified it. This doesn't paint the full picture (there may have been multiple editors), but still gives an idea of what happened on those pages.

A next step would be to also add the approval status of a page (i.e. whether latest revision == approved revision) in case the ApprovedRevs extension is present. But now I might be pushing my luck here..

Change 770108 had a related patch set uploaded (by Sahajsk; author: Sahajsk):

[mediawiki/extensions/Cargo@master] Add _lastEditor field to _pageData table

https://gerrit.wikimedia.org/r/770108

Yaron_Koren claimed this task.

I believe this is finally done now; sorry for the delay.