Problem: When a user is blocked from notifying you using the new notification blacklist and then attempts to email you they get an Internal error/backtrace
Notes: The email goes through (and the notification does not) which is likely how we want it but the error is obviously not as designed and also reveals to the sender that they are blocked from notifications (if they can figure it out/read the backtrace).
Recreation steps:
- User A places User B on their notification blacklist on Special:Preferences
- User B goes to Special:EmailUser and tries to send an email to User A.
Results:
- User A gets email
- No one gets a notification
- User B gets a backtrace/Internal error
[WS3sHwpEE4AAABIG7V8AAAAF] /wiki/Special:EmailUser BadMethodCallException from line 436 of /srv/mediawiki/php-master/extensions/Echo/includes/controller/NotificationController.php: Call to a member function getNamespace() on a non-object (null)
Backtrace:
#0 /srv/mediawiki/php-master/extensions/Echo/includes/iterator/FilteredSequentialIterator.php(120): Closure$EchoNotificationController::getUsersToNotifyForEvent#5(User)
#1 [internal function]: Closure$EchoFilteredSequentialIterator::createFilter#2(User, integer, ArrayIterator)
#2 [internal function]: CallbackFilterIterator->accept()
#3 [internal function]: FilterIterator->fetch()
#4 /srv/mediawiki/php-master/extensions/Echo/includes/controller/NotificationController.php(126): FilterIterator->rewind()
#5 /srv/mediawiki/php-master/extensions/Echo/includes/model/Event.php(171): EchoNotificationController::notify(EchoEvent, boolean)
#6 /srv/mediawiki/php-master/extensions/Echo/Hooks.php(1337): EchoEvent::create(array)
#7 /srv/mediawiki/php-master/includes/Hooks.php(186): EchoHooks::onEmailUserComplete(MailAddress, MailAddress, string, string)
#8 /srv/mediawiki/php-master/includes/specials/SpecialEmailuser.php(443): Hooks::run(string, array)
#9 /srv/mediawiki/php-master/includes/specials/SpecialEmailuser.php(314): SpecialEmailUser::submit(array, DerivativeContext)
#10 /srv/mediawiki/php-master/includes/htmlform/HTMLForm.php(663): SpecialEmailUser::uiSubmit(array, HTMLForm)
#11 /srv/mediawiki/php-master/includes/htmlform/HTMLForm.php(555): HTMLForm->trySubmit()
#12 /srv/mediawiki/php-master/includes/htmlform/HTMLForm.php(570): HTMLForm->tryAuthorizedSubmit()
#13 /srv/mediawiki/php-master/includes/specials/SpecialEmailuser.php(177): HTMLForm->show()
#14 /srv/mediawiki/php-master/includes/specialpage/SpecialPage.php(522): SpecialEmailUser->execute(NULL)
#15 /srv/mediawiki/php-master/includes/specialpage/SpecialPageFactory.php(578): SpecialPage->run(NULL)
#16 /srv/mediawiki/php-master/includes/MediaWiki.php(287): SpecialPageFactory::executePath(Title, RequestContext)
#17 /srv/mediawiki/php-master/includes/MediaWiki.php(862): MediaWiki->performRequest()
#18 /srv/mediawiki/php-master/includes/MediaWiki.php(523): MediaWiki->main()
#19 /srv/mediawiki/php-master/index.php(43): MediaWiki->run()
#20 /srv/mediawiki/w/index.php(3): include(string)
#21 {main}