Werdna has uploaded a new change for review.
https://gerrit.wikimedia.org/r/92458
Change subject: Fix paging bugs caused by 6f99d757 and another rev I cannot
find.
......................................................................
Fix paging bugs caused by 6f99d757 and another rev I cannot find.
Also fixing some error handling (some things were using .fail() instead of
.reject(), other bugs)
Change-Id: Ic653d5c5dc4c6078e94a161f38172e4f08c957f0
---
M includes/Block/Topic.php
M modules/base/ext.flow.base.js
M modules/discussion/paging.js
3 files changed, 12 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/58/92458/1
diff --git a/includes/Block/Topic.php b/includes/Block/Topic.php
index f4ea2db..6c6d927 100644
--- a/includes/Block/Topic.php
+++ b/includes/Block/Topic.php
@@ -506,7 +506,7 @@
'*' => $post->getContent( null, $contentFormat
),
'format' => $contentFormat
);
- $output['user'] = $post->getCreatorText();
+ $output['user'] = $post->getCreator()->getName();
}
if ( ! isset( $options['no-children'] ) ) {
diff --git a/modules/base/ext.flow.base.js b/modules/base/ext.flow.base.js
index 25079cb..ca1c172 100644
--- a/modules/base/ext.flow.base.js
+++ b/modules/base/ext.flow.base.js
@@ -90,7 +90,7 @@
!output.query.flow ||
output.query.flow._element !==
'block'
) {
- deferredObject.fail(
'invalid-result', 'Unable to understand the API result' );
+ deferredObject.reject(
'invalid-result', 'Unable to understand the API result' );
return;
}
@@ -102,11 +102,11 @@
}
} );
- deferredObject.fail( 'invalid-result',
'Unable to find the '+
+ deferredObject.reject(
'invalid-result', 'Unable to find the '+
blockName+' block in the API
result' );
} )
.fail( function () {
- deferredObject.fail( arguments );
+ deferredObject.reject.apply( this,
arguments );
} );
return deferredObject.promise();
diff --git a/modules/discussion/paging.js b/modules/discussion/paging.js
index 456dac8..2953fb9 100644
--- a/modules/discussion/paging.js
+++ b/modules/discussion/paging.js
@@ -24,10 +24,14 @@
$( document ).on( 'flow_init', function () {
$( this ).find( '.flow-paging a' ).click( function ( e ) {
e.preventDefault();
- var $pagingLinkDiv = $( this ).closest( '.flow-paging' )
- .addClass( 'flow-paging-loading' ),
+ var $pagingLinkDiv = $( this ).closest( '.flow-paging'
);
- offset = $pagingLinkDiv.data( 'offset' ),
+ if( $pagingLinkDiv.hasClass( 'flow-paging-loading' ) ) {
+ return;
+ }
+ $pagingLinkDiv.addClass( 'flow-paging-loading' );
+
+ var offset = $pagingLinkDiv.data( 'offset' ),
direction = $pagingLinkDiv.data( 'direction' ),
limit = $pagingLinkDiv.data( 'limit' ),
workflowId = $( this ).flow(
'getTopicWorkflowId' ),
@@ -52,7 +56,7 @@
$replaceContent;
$.each( data, function ( k, v ) {
- if ( k - 0 === k ) {
+ if ( parseInt( k, 10 ) == k ) {
topics.push( v );
}
} );
--
To view, visit https://gerrit.wikimedia.org/r/92458
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic653d5c5dc4c6078e94a161f38172e4f08c957f0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Werdna <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits