If any of the IP Info data are unavailable, they are displayed as Not available.
This is currently not working for the blocks and contribs properties.
Steps to reproduce
- Make the blocks and contributions info unavailable by setting the following config:
$wgGroupPermissions['sysop']['ipinfo'] = true; $wgGroupPermissions['sysop']['ipinfo-view-full'] = false; $wgGroupPermissions['sysop']['ipinfo-view-basic'] = false;
- Log in as an admin and view either the infobox or the popup
- Expected:
- Actual:
The problem is here (link to code):
var activeBlocks = mw.msg( 'ipinfo-value-active-blocks', info.data[ 'ipinfo-source-block' ].numActiveBlocks ); var localEdits = mw.msg( 'ipinfo-value-local-edits', info.data[ 'ipinfo-source-contributions' ].numLocalEdits ); var $recentEdits = $( '<span>' ).addClass( 'ext-ipinfo-widget-value-recent-edits' ) .append( mw.msg( 'ipinfo-value-recent-edits', info.data[ 'ipinfo-source-contributions' ].numRecentEdits ) ); var $edits = $( '<span>' ).append( localEdits, $( '<br>' ), $recentEdits ); return $( '<dl>' ).addClass( 'ext-ipinfo-widget-property-properties' ).append( this.generatePropertyMarkup( location, mw.msg( 'ipinfo-property-label-location' ) ), this.generatePropertyMarkup( info.data[ 'ipinfo-source-geoip2' ].organization, mw.msg( 'ipinfo-property-label-organization' ) ), this.generatePropertyMarkup( activeBlocks, mw.msg( 'ipinfo-property-label-active-blocks' ) ), this.generatePropertyMarkup( $edits, mw.msg( 'ipinfo-property-label-edits' ) ) );
When info.data[ 'ipinfo-source-block' ] and info.data[ 'ipinfo-source-contributions' ] are undefined, we should not pass the message translations to generatePropertyMarkup. Instead we should pass null.
Acceptance criteria
If the blocks and/or contribs properties are unavailable, they should display as Not available in the popup and infobox.






