[drupal-devel] [bug] module_invoke brokes default values
chx
drupal-devel at drupal.org
Tue Feb 22 23:29:15 UTC 2005
Project: Drupal
Version: cvs
Component: base system
Category: bug reports
Priority: critical
Assigned to: chx
Reported by: chx
Updated by: chx
Status: patch
Attachment: http://drupal.org/files/issues/themefix_0.patch (712 bytes)
The message was wrong (but funny).
chx
Previous comments:
------------------------------------------------------------------------
February 22, 2005 - 22:26 : chx
Attachment: http://drupal.org/files/issues/module_inc_no_default_nulls.patch (685 bytes)
Try this: module_invoke('taxonomy', 'get_tree', 1); and compare the
results with taxonomy_get_tree(1);
What happens is that taxonomy_get_tree is called by the arguments 1,
NULL, NULL, NULL which breaks it.
Hence the patch.
Every Drupal version I have met (4.4, 4.5, CVS) contains this error. I
think this led module authors to not use module_invoke (at least I did
so until now) which will be quite a problem if we decide on breaking up
the modules into smaller pieces.
------------------------------------------------------------------------
February 22, 2005 - 22:35 : killes at www.drop.org
I have no idea how else we should fix this. +1.
------------------------------------------------------------------------
February 22, 2005 - 23:49 : chx
Attachment: http://drupal.org/files/issues/module_inc_no_default_nulls_0.patch (625 bytes)
Of course, lambda is another solution. When I objected on IRC that
call_user_func_array is slower, Bart Jansens pointed out that
slashdotted pages are cached thus module_invoke is not called. So if
this solution is accepted, the credit goes to him.
But one of the solutions shall be accepted.
--
View: http://drupal.org/node/17770
Edit: http://drupal.org/project/comments/add/17770
More information about the drupal-devel
mailing list