- 2009-11-29: mongodb_watchdog module created by dereine, ported to D7 by me in about half an hour, and migrated in a larger MongoDB project by damz before the hour ended. Wow...
- 2009-07-13: 100% unit test coverage on Taxonews for both D6 and D7 versions
- 2009-02-03: the new Drupal-based site for the golden jubilee of the french "Ministère de la Culture", which OSInet helped build, is now online
- 2009-01-22: new API site for CCK à la api.drupal.org
Drupal coder: you don't have to stick to the parameter names in the documentation
The documentation for hook_user can cause an unforeseen problem...
The API documentation for
hook_user
names the four parameters for hook_user as:
$op&$edit&$user$category = NULL
which is all very well, except for the fact the $user
happens to also be the name of a global variable in Drupal.
So unsuspecting developers will notice changing behaviour for
some cases if they use the global $user: for nodes
being edited by someone not already the node author, the author
information can be lost.
The fix is exceedingly simple: just rename the param to another name of
your choosing, like $account, suggested by Moshe and Drumm
as it appears to be already renamed that way in some places within Drupal.
Note that the same is true for various places in Drupal. Unlike, say, Delphi Pascal, PHP does not rely on function definitions matching prototypes down to the parameter name: Drupal doesn't even use prototypes, as it dynamically builds the hook names and invokes them from the dynamically built variable. So don't hesitate if you don't like a param name !
Tagged for drupal, hook_user, documentation.





Documentation work offer on drupal.org
Hello,
Seeing that your help out developpers with UML diagrams and tips, I thought you might be interested by this offer: drupal.org/node/38521.
Yvan
Drupal stars could do it better
Hi, Yvan,
Indeed I did notice this node. But I refrained from quoting an offer because I think there are people in the drupal ecosystem like chx or killes who could do that in their sleep with more accurate results than me. There are still many things in core that puzzle me. And it seems sometimes they do because they're not (yet) properly done (did you look at the various field definitions for a module name throughout drupal ? three different sizes for the same field).
Cela dit, si Linagora a un besoin concret dans le domaine, je suis évidemment ouvert à toute proposition: en ce cas, merci de me contacter par courriel.