Page MenuHomePhabricator

ArticleAfterFetchContent and ArticleAfterFetchContentObject hooks... one is deprecated... the other's not.
Closed, ResolvedPublic

Description

Hi,

For MediaWiki 1.28.0

This page lists ArticleAfterFetchContent as deprecated:

https://www.mediawiki.org/wiki/Manual:Hooks/ArticleAfterFetchContent

This page doesn't list ArticleAfterFetchContentObject as deprecated:

https://www.mediawiki.org/wiki/Manual:Hooks/ArticleAfterFetchContentObject

The same is documented in docs/hooks.txt.

However, I receive a deprecation warning when using ArticleAfterFetchContentObject, and fixed that by using ArticleAfterFetchContent instead.

Is the documentation reversed? Or the implementation?

Thanks,
Peter

Event Timeline

maiden_taiwan renamed this task from ArticleAfterFetchContent and ArticleAfterFetchContentObject hooks... one is depricated... the other's not. to ArticleAfterFetchContent and ArticleAfterFetchContentObject hooks... one is deprecated... the other's not..Jan 5 2017, 5:06 PM
maiden_taiwan subscribed.

@Reedy deprecated ArticleAfterFetchContentObject in 97d9916a3d16.

ArticleAfterFetchContent also appears to be deprecated in 1.28, and it has actually been removed in master (yet it still appears in hooks.txt, which we'd better fix - and there was no release note either!).

Hmm. I don't think ArticleAfterFetchContentObject should've been deprecated... I'm not sure why it's run via ContentHandler::runLegacyHooks() either, so I guess that patch wants a partial revert, and a backport to 1.28

Change 332120 had a related patch set uploaded (by Reedy):
Un-deprecate ArticleAfterFetchContentObject hook

https://gerrit.wikimedia.org/r/332120

Change 332121 had a related patch set uploaded (by Reedy):
Un-deprecate ArticleAfterFetchContentObject hook

https://gerrit.wikimedia.org/r/332121

@Reedy deprecated ArticleAfterFetchContentObject in 97d9916a3d16.

ArticleAfterFetchContent also appears to be deprecated in 1.28, and it has actually been removed in master (yet it still appears in hooks.txt, which we'd better fix - and there was no release note either!).

https://gerrit.wikimedia.org/r/#/c/332150/ for T154498, which already noted this omission

ArticleAfterFetchContent (Still mentioned in hooks.txt, code removed, but not in RELEASE-NOTES or HISTORY)

Change 332121 merged by jenkins-bot:
Un-deprecate ArticleAfterFetchContentObject hook

https://gerrit.wikimedia.org/r/332121

Change 332120 merged by jenkins-bot:
Un-deprecate ArticleAfterFetchContentObject hook

https://gerrit.wikimedia.org/r/332120

TTO assigned this task to Reedy.

I think this is fixed now from our end. Update to 1.28.1 when it is released.

Change 577329 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Hooks.txt wasn't updated, still says its deprecated

https://gerrit.wikimedia.org/r/577329

DannyS712 added a project: User-DannyS712.
DannyS712 subscribed.

@TTO @Reedy hooks.txt wasn't updated to remove the deprecation notice. Can you take a look at the patch I just submitted?

@TTO @Reedy hooks.txt wasn't updated to remove the deprecation notice. Can you take a look at the patch I just submitted?

It was. Noting this was originally done in 1.28, the comment says 1.32, and it was re-added in https://github.com/wikimedia/mediawiki/commit/4835a75ec56444c61c5d0cfbc9e98ceb420fc513

My apologies. I couldn't find anything in the release notes that it was deprecated again

Change 577329 abandoned by DannyS712:
Hooks.txt: Update that ArticleAfterFetchContentObject was un-deprecated

https://gerrit.wikimedia.org/r/577329

My apologies. I couldn't find anything in the release notes that it was deprecated again

It happens. Always worth looking at the code incase :)