Comments

jhodgdon’s picture

Title: Documentation problem with hook_process_HOOK » hook_process_HOOK nad hook_preprocess_HOOK need clarification
Issue tags: +Novice

They aren't identical - one says process and one says preprocess.

However, both should link to the documentation for theme(), which explains what processing and preprocess really are.

Good project for a novice doc contributor. I suggest adding a line something like "For more explanation of the processing/preprocessing steps see theme()" or something like that.

sime’s picture

For practical purposes of course they're identical. Someone has copy/pasted the description of preprocess and used it for process, and simply changed that word in the description.

There needs to be some information about when and why you'd use each one, I wasn't able to find this information. There must have been a reason why the process hook was added and there must be some best practice around why you'd use it over the existing preprocess. If it doesn't matter which one is used, then why was the hook added? In the end I went with preprocess as it seemed the safer option - am I going to find that (as I happened with form_id specific alters in D6) I'm going to find unusual bugs in my site due to order of precendence?

sime’s picture

Title: hook_process_HOOK nad hook_preprocess_HOOK need clarification » Differentiate process/preprocess hook documentation

Better title

sime’s picture

I've looked at the theme() documentation and it is excellent. Yes I agree completely all those hooks listed there should have links back to the theme() documentation, rather than duplicating it.

The following should also have references back to theme().
http://api.drupal.org/api/drupal/includes--theme.inc/function/template_p...
http://api.drupal.org/api/drupal/includes--theme.inc/function/template_p...

sime’s picture

Summary of hooks documentation that needs to be updated AFAICT:

template_preprocess
template_process
hook_preprocess
hook_process
hook_preprocess_HOOK
hook_process_HOOK

jhodgdon’s picture

Yes, that list in #5 looks good, thanks! All of these should have wording saying to check theme() for more information, as suggested in #1. In addition, if there are other hooks mentioned in the theme() documentation that also are missing this link, they should be updated too.

RoboPhred’s picture

Documentation added to functions listed in #5: just a simple "For more information, see theme()."
Is more guidance needed? (ex: "For more information, including when to use x_preprocess over x_process, see theme().")

RoboPhred’s picture

Status: Active » Needs review
jhodgdon’s picture

Status: Needs review » Needs work

There's a hunk in this patch that comes from another issue.

Also, see #6 - I think we need to check through the other functions/hooks listed in theme() and make sure they all have this line as well.

RoboPhred’s picture

Status: Fixed » Needs work
StatusFileSize
new2.65 KB

Oops, contaminated my base copy. Hunk manually removed.

I looked in theme() and didn't see any other hooks I missed on that first run (that were listed in #5). The other functions listed are all templates for hooks, and don't actually have an area to document that I could find. Unless you mean functions beyond the process/preprocess list?

jhodgdon’s picture

Status: Needs work » Needs review

Good, I just wanted to make sure the list was complete. Sounds like it is.

Setting to needs review so the test bot can launch...

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

And unless the bot complains (can't imagine it will, but...), this is good to go. Thanks!

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Needs work » Closed (fixed)
Issue tags: -Novice

Automatically closed -- issue fixed for 2 weeks with no activity.