Page MenuHomePhabricator

Non-virtual calls in Article.php
Closed, InvalidPublic

Description

Author: bugs

Description:
There are a few member functions in the Article class, named onArticleCreate(),
onArticleDelete() and onArticleEdit() that, according to the comment near them,
they are a kind of hook functions that are called when articles are created,
deleted or edited. Nevertheless, all calls to these member functions in the same
class are explicitly non-virtual for no apparent reason. I.e., these functions
are called like

Article::onArticleEdit( $this->mTitle );

instead of

$this->onArticleEdit( $this->mTitle );

This makes it impossible to override these hooks on derived classes. Is there
any reason why all calls to these functions were made non-virtual? Would it be
possible to make these calls virtual?

I'm designing an extension that needs such functionality. After editing an
article, I need to invalidate the cache of its parent articles, and this would
be cleanest way to do it.

This is somewhat related to bug #5135.


Version: 1.6.x
Severity: normal

Details

Reference
bz5140

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:08 PM
bzimport set Reference to bz5140.
bzimport added a subscriber: Unknown Object (MLST).

Those are static (class) methods.