mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-11 17:00:10 +00:00
Replace deprecated LinksUpdate::getAddedLinks
The current code uses deprecated TitleLinksTable::getTitleArray and that is also using Title::newFromPageReference to get Title objects, so performance issues or more memory usage are not expected. Change-Id: I25d047ceb707837009e0a703693ebc2f49fc0ba9
This commit is contained in:
parent
76fabc3bb5
commit
9380504852
|
@ -16,6 +16,7 @@ use MediaWiki\Auth\Hook\LocalUserCreatedHook;
|
|||
use MediaWiki\Config\Config;
|
||||
use MediaWiki\DAO\WikiAwareEntity;
|
||||
use MediaWiki\Deferred\DeferredUpdates;
|
||||
use MediaWiki\Deferred\LinksUpdate\LinksTable;
|
||||
use MediaWiki\Deferred\LinksUpdate\LinksUpdate;
|
||||
use MediaWiki\Extension\Notifications\Controller\ModerationController;
|
||||
use MediaWiki\Extension\Notifications\Controller\NotificationController;
|
||||
|
@ -806,8 +807,9 @@ class Hooks implements
|
|||
$max = 10;
|
||||
// Only create notifications for links to content namespace pages
|
||||
// @Todo - use one big insert instead of individual insert inside foreach loop
|
||||
foreach ( $linksUpdate->getAddedLinks() as $title ) {
|
||||
if ( $this->namespaceInfo->isContent( $title->getNamespace() ) ) {
|
||||
foreach ( $linksUpdate->getPageReferenceIterator( 'pagelinks', LinksTable::INSERTED ) as $pageReference ) {
|
||||
if ( $this->namespaceInfo->isContent( $pageReference->getNamespace() ) ) {
|
||||
$title = Title::newFromPageReference( $pageReference );
|
||||
if ( $title->isRedirect() ) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue