[drupal-devel] [feature] Enable override and extension of core module functions

stefan nagtegaal drupal-devel at drupal.org
Tue Aug 23 11:35:10 UTC 2005


Issue status update for 
http://drupal.org/node/29428
Post a follow up: 
http://drupal.org/project/comments/add/29428

 Project:      Drupal
 Version:      cvs
 Component:    module system
 Category:     feature requests
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  nedjo
 Updated by:   stefan nagtegaal
 Status:       patch (code needs review)

I'm not sure I get this..


Am I right when I think we can override (and change) any function in
drupal with this patch, which would give us the possibility to:
- override forms;
- override functions which generates the node links, so they (finally)
could be hidden instead of always displayed;
- any other advantages which i'm missing atm? (probably a lot, but
can't think of any right now, right here)


Stefan




stefan nagtegaal



Previous comments:
------------------------------------------------------------------------

Mon, 22 Aug 2005 22:47:09 +0000 : nedjo

Attachment: http://drupal.org/files/issues/module-extension-and-override.patch (1.38 KB)

A frequently requested functionality is the ability to override or
extend core module functions.


This small patch is an initial take on how to enable function extension
and overriding.  It takes the existing module_invoke() function and adds
tests for override and extension functions, in the forms
modulename_originalfunction_override() and
modulename_originalfunction_extension().  So, for example, an override
function for the core taxonomy_node_form() function as defined by a
module named testmodule would be called
testmodule_taxonomy_node_form_override(), and would be run instead of
taxonomy_node_form().  And testmodule_taxonomy_node_form_extension()
would be run every time taxonomy_node_form() was called, hence
"extending" it.


Of course, this approach would only be useful if we converted most - or
all! - of our current module function calls to use module_invoke()...







More information about the drupal-devel mailing list