Wikia/app — pull request #5219 by Grunny (2014-10-31 08:29:43+00:00)
Title: (CE-1099) Fix additional calls of the ArticleDeleteComplete hook

The ArticleDeleteComplete hook was changed in MW 1.18 from using an
Article object as its first argument to using a WikiPage object. We
ran the hook in a few extra places, but did not update these hooks
when we upgraded from MW 1.16 to MW 1.19. When a correct type hint of
WikiPage was used recently in a method attached to this hook, it
started causing fatal errors.

This removes the custom 'ArticleDelete' and 'ArticleDeleteComplete'
hook calls as they are no longer needed. In MW 1.16, the hooks were
run from Article::doDelete not from Article::doDeleteArticle which
is what is used in these extensions. As such, the hooks were run
manually before and after calling Article::doDeleteArticle. However,
in MW 1.19, the hooks are run from WikiPage::doDeleteArticleReal
meaning that they are run anyway, and we've been running the hooks
twice per deletion in these extensions since the 1.19 upgrade.

Fixes the following fatal error:

PHP Catchable fatal error: Argument 1 passed to
ApiHooks::onArticleDeleteComplete() must be an instance of WikiPage,
instance of Article given in includes/wikia/api/ApiHooks.class.php on
line 53.

/cc @macbre @Wikia/community-engineering @nandy-andy