Skip to content
Open
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
2 changes: 1 addition & 1 deletion SpecialWikilog.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ protected function getSelectOptions()
$res = $query->select( $dbr,
array(), 'p.page_namespace, p.page_title',
array(), __FUNCTION__,
array('GROUP BY' => 'wlp_parent', 'ORDER BY' => 'w.page_title')
array('GROUP BY' => [ 'wlp_parent', 'p.page_namespace', 'p.page_title', 'w.page_title' ], 'ORDER BY' => 'w.page_title')
);
$values = array();
while( $row = $dbr->fetchRow( $res ) )
Expand Down
2 changes: 1 addition & 1 deletion Wikilog.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ static function LinkBegin( $skin, $target, $text, $attribs, $query, &$options, &
if ( $target->isTalkPage() &&
( $i = array_search( 'broken', $options ) ) !== false ) {
if ( self::nsHasComments( $target ) ) {
array_splice( $options, $i, 1 );
array_splice( $options, (int) $i, 1 );
$options[] = 'known';
}
}
Expand Down
2 changes: 1 addition & 1 deletion WikilogItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function saveData() {
$dbw = wfGetDB( DB_MASTER );
$dbw->replace(
'wikilog_posts',
'wlp_page',
array('wlp_page'),
array(
'wlp_page' => $this->mID,
'wlp_parent' => $this->mParent,
Expand Down
2 changes: 1 addition & 1 deletion WikilogItemPager.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ function formatRow( $row ) {
$result = $dbr->select(
array( 'wikilog_comments', 'page_last_visit' ),
'COUNT(*)',
array( 'wlc_status' => 'OK', 'IFNULL(wlc_updated>pv_date,1)', 'wlc_post' => $row->wlp_page ),
array( 'wlc_status' => 'OK', 'COALESCE(wlc_updated>pv_date,TRUE)', 'wlc_post' => $row->wlp_page ),
__METHOD__,
NULL,
array( 'page_last_visit' => array( 'LEFT JOIN', array( 'pv_page = wlc_comment_page', 'pv_user' => $wgUser->getID() ) ) )
Expand Down
2 changes: 1 addition & 1 deletion WikilogMainPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ protected function formatWikilogInformation( $skin ) {

$row = $dbr->selectRow(
array( 'wikilog_posts', 'page' ),
'COUNT(*) as total, SUM(wlp_publish) as published',
'COUNT(*) as total, COUNT(wlp_publish) as published',
array(
'wlp_page = page_id',
'wlp_parent' => $this->mTitle->getArticleID(),
Expand Down
2 changes: 1 addition & 1 deletion maintenance/wikilogImportDocumentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function handleRevision( $revision ) {
$revision->getText(), 0, false, $this->mTimeStamp,
$this->mUser);

if ( WikiError::isError( $archive ) || !$archive->isGood() ) {
if ( !$archive->isGood() ) {
$this->output( " failed.\n" );
return false;
} else {
Expand Down
6 changes: 3 additions & 3 deletions wikilog-tables.pg.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/wikilog_posts (
wlp_parent INT NOT NULL,

-- Post title derived from page(page_title), in order to simplify indexing.
wlp_title TEXT NOT NULL,
wlp_title VARCHAR(255) NOT NULL,

-- Either if the post was published or not.
wlp_publish BOOLEAN NOT NULL DEFAULT FALSE,
wlp_publish SMALLINT NOT NULL DEFAULT 0 CHECK(wlp_publish = 0 or wlp_publish = 1),

-- If wlp_publish = TRUE, this is the date that the post was published,
-- otherwise, it is the date of the last draft revision (for sorting).
Expand Down Expand Up @@ -86,7 +86,7 @@ CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/page_last_visit (
CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/wikilog_subscriptions (
ws_user INT NOT NULL,
ws_page INT NOT NULL,
ws_yes BOOLEAN NOT NULL,
ws_yes SMALLINT NOT NULL,
ws_date TIMESTAMPTZ NOT NULL,
PRIMARY KEY (ws_user, ws_page)
) /*$wgDBTableOptions*/;
Expand Down