Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Process and preprocess descriptions are identical and this is confusing.
Identical:
http://api.drupal.org/api/drupal/modules--system--theme.api.php/function...
http://api.drupal.org/api/drupal/modules--system--theme.api.php/function...
Identical:
http://api.drupal.org/api/drupal/modules--system--theme.api.php/function...
http://api.drupal.org/api/drupal/modules--system--theme.api.php/function...
Comment | File | Size | Author |
---|---|---|---|
#10 | 1020906-differentiate_process_preprocess.patch | 2.65 KB | RoboPhred |
#7 | 1020906-differentiate_process_preprocess.patch | 3.44 KB | RoboPhred |
Comments
Comment #1
jhodgdonThey 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.
Comment #2
simeFor 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?
Comment #3
simeBetter title
Comment #4
simeI'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...
Comment #5
simeSummary of hooks documentation that needs to be updated AFAICT:
template_preprocess
template_process
hook_preprocess
hook_process
hook_preprocess_HOOK
hook_process_HOOK
Comment #6
jhodgdonYes, 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.
Comment #7
RoboPhred CreditAttribution: RoboPhred commentedDocumentation 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().")
Comment #8
RoboPhred CreditAttribution: RoboPhred commentedComment #9
jhodgdonThere'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.
Comment #10
RoboPhred CreditAttribution: RoboPhred commentedOops, 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?
Comment #11
jhodgdonGood, I just wanted to make sure the list was complete. Sounds like it is.
Setting to needs review so the test bot can launch...
Comment #12
jhodgdonAnd unless the bot complains (can't imagine it will, but...), this is good to go. Thanks!
Comment #13
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.