mirror of
https://bitbucket.org/vertlach/voteny.git
synced 2024-05-16 13:58:15 +03:00
Make it work even on imports when title is null.
Change-Id: I75acf8860d15f5f47f16e1f35a5ea07cc88bac85
This commit is contained in:
parent
3a5e47a7af
commit
836963a1b5
|
@ -51,19 +51,24 @@ class VoteHooks {
|
|||
$type = intval( $args['type'] );
|
||||
}
|
||||
|
||||
$articleID = $wgOut->getTitle()->getArticleID();
|
||||
switch( $type ) {
|
||||
case 0:
|
||||
$vote = new Vote( $articleID );
|
||||
break;
|
||||
case 1:
|
||||
$vote = new VoteStars( $articleID );
|
||||
break;
|
||||
default:
|
||||
$vote = new Vote( $articleID );
|
||||
}
|
||||
$output = null;
|
||||
$title = $wgOut->getTitle();
|
||||
if( $title ) {
|
||||
|
||||
$output = $vote->display();
|
||||
$articleID = $title->getArticleID();
|
||||
switch( $type ) {
|
||||
case 0:
|
||||
$vote = new Vote( $articleID );
|
||||
break;
|
||||
case 1:
|
||||
$vote = new VoteStars( $articleID );
|
||||
break;
|
||||
default:
|
||||
$vote = new Vote( $articleID );
|
||||
}
|
||||
|
||||
$output = $vote->display();
|
||||
}
|
||||
|
||||
wfProfileOut( __METHOD__ );
|
||||
|
||||
|
|
Loading…
Reference in a new issue