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.
Part of meta-issue #1310084: [meta] API documentation cleanup sprint.
Comment | File | Size | Author |
---|---|---|---|
#20 | d7-color.patch | 10.29 KB | xjm |
#16 | doc-cleanup-color-module-1332580-9.patch | 10.46 KB | sven.lauer |
#14 | doc-cleanup-color-module-1332580-8.patch | 10.14 KB | sven.lauer |
#11 | doc-cleanup-color-module-1332580-7.patch | 10.13 KB | sven.lauer |
#10 | doc-cleanup-color-module-1332580-6.patch | 398.4 KB | sven.lauer |
Comments
Comment #1
sven.lauer CreditAttribution: sven.lauer commentedNone of the functions in color.module has any param / return value documentation. Created a separate issue for those, as specified in the instructions in #1310084: [meta] API documentation cleanup sprint:
#1332584: Add param / return value documentation to color.module
(Edited to fix reference to meta issue.)
Comment #2
sven.lauer CreditAttribution: sven.lauer commentedCaveat about this patch: My editor killed extraneous whitespace on empty lines in two instances---is it okay to include this in the patch, or should I manually remove this?
Comment #3
jhodgdonKilling extraneous whitespace is always good, and doesn't make the patch harder to review, so go for it! :)
This mostly looks good. A couple of things to fix:
a)
Refer to modules either as "the Color module" (capitalized) or "color.module" (without "the"). The latter makes a link on api.drupal.org so is somewhat preferable in API docs.
b)
I think the word "then" can fit on the first line here, if you are going to rewrap it.
c)
I don't think "the" is good here.
d)
What is system_themes? I can't find that in a search on api.drupal.org. Please use the name of the actual form function if possible (and follow by () ). See also (a) above. Also, maybe this should have an @see to the function above that is using it as a helper?
e)
html -> HTML.
f) Also maybe this should have an @see to the function that is using this? If it's really a callback, follow the "callback function" guildelines in this section (scroll down):
http://drupal.org/node/1354#functions
And same for the next callback function.
f)
return -> returns
g)
a -> an
h)
This needs an update:
http://drupal.org/node/1354#classes
i)
The original wording here was OK, but without "to see", the "if" in your modified line should be "whether".
Comment #4
sven.lauer CreditAttribution: sven.lauer commentedThe attached patch fixes some of the issues, but not all. In particular:
Well, I just went by the name of the calling function. The function documented here is called only once, by hook_form_system_themes_alter() (just above in the same file). This is also the only thing that this function does, so really the documented function should just be that alter hook. And, as the name of the alter hook indicates, it alters the form with the form ID "system_themes" form.
Now it gets interesting: There is no such form. I THINK what this was supposed to alter was the page that is now available under "admin/appearance", which used to be a form in D6. So this tries to alter a form that does not exist anymore. Even more weird: Even in D6, there was no form with form ID "system_themes", there only was one with ID "system_themes_form". So it looks to me like this function has not done anything since at least D5.
I did not change anything about the doc header as I am at a loss about what to do.
Are you sure? Note that this is the 'html' template, as in
html.tpl.php
ortheme_html()
so this is not a reference to HTML (the markup language), but rather a lower-case named theme/template.This is not QUITE a callback. Or at least, calling it that is somewhat misleading. The way I understand it, these two functions should be called by themes that want to be compatible with Color module, in the right place. Only Bartik is using these in core, they are called in bartik_process_html() and bartik_process_page(), respectively. Maybe we should @see these? And add a general comment that these ought to be called by themes? I am a bit hesitant about my interpretation, though, as it strikes me as odd that a function that should be called from outside the module would have a name starting with an underscore (though this might be simply to avoid having 'color_page_alter' to be taken to be an implementation of hook_form_alter()?)
[Edited to fix a weird typo where I wrote "settings_form" instead of "themes_form".]
Comment #5
sven.lauer CreditAttribution: sven.lauer commentedComment #6
jhodgdonAh.... let's see.
(d) - yeah, let's leave those functions completely alone for now and file a separate issue saying they are not being used and should be removed.
(e) - In that case, call it html.tpl.php directly (which will make a link to the file on api.drupal.org). If you want to use HTML in text as "the HTML template", yes it should be capitalized.
(f) - Ah, OK. So it was misdocumented as a callback in the original. I think adding an extra line to the docs saying something like "Themes can call this function to ..." would be helpful, yes. Putting an @see to the Bartik functions that call it is not necessary (on api.drupal.org, the list of calling functions is shown anyway).
I took a closer look at those functions. Maybe a better description would be:
(html function)
Replaces style sheets with color-altered style sheets.
A theme that supports the color module should call this function from its themename_process_html() function, so that the correct style sheets are included when html.tpl.php is rendered.
(page function)
Replaces the logo with a color-altered logo.
A theme that supports the color module should call this function from its themename_process_page() function, so that the correct logo is included when page.tpl.php is rendered.
Comment #7
sven.lauer CreditAttribution: sven.lauer commentedOkay.
I adopted your suggestion (which makes (e) a non-issue), except that I referred to the functions as "THEME_process_page/html()" to be consistent with how we refer to these in the docblock for theme(). I added a @see theme(), as this is where the purpose of THEM_process_* is explained.
I also opened #1337198: Remove useless form_alter implementation re: (d).
Comment #8
xjmA few files are still missing
@file
blocks. Other thank that, I think this patch is ready.Comment #9
jhodgdonRegarding (d) from the discussion above -- let's not do *anything* to the docblocks for those function(s) that probably need to be removed. So this should not be here:
While you're at it:
This is probably just the color configuration form, right? The description here makes it sound like it's the whole config page for a theme, not specifically about colors.
And this needs a period at the end of the sentence:
And this needs an extra blank line between the @file docblock and the first function:
Comment #10
sven.lauer CreditAttribution: sven.lauer commentedFixing the issues mentioned in @jhodgdon's #9, and also adding the @file docblocks to the css files.
Comment #11
sven.lauer CreditAttribution: sven.lauer commentedArg. Git is hating me today. Proper patch attached.
Comment #12
xjmRead through the patch again and #8 and #9 have been fixed. Everything else looks correct as well.
Comment #13
catchtypo for 'administration'.
Otherwise looks great.
Discussed the comments for CSS and JS files here a bit with xjm. We strip comments for CSS during aggregation, but not JavaScript, so I bumped #352951: Make JS & CSS Preprocessing Pluggable to major.
11 days to next Drupal core point release.
Comment #14
sven.lauer CreditAttribution: sven.lauer commentedRe-roll fixing the typo attached.
(I guess a point could be made for setting this directly back to RTBC, given that both xjm and catch said that the patch is good otherwise---but I am following protocol just to be sure.)
Comment #15
xjmSorry, missed this before:
Should this be "the Color module information"? (Functionality, etc.)
Comment #16
sven.lauer CreditAttribution: sven.lauer commentedRight, sorry for missing this before.
Attached patch fixes those.
Comment #17
xjmAlrighty, re-RTBC. :)
Comment #18
Dries CreditAttribution: Dries commentedCommitted to 8.x. Thanks!
Comment #20
xjmPretty much a straight reroll; just the names of the CSS files have changed in D8. No commit credit please. :P
Comment #21
jhodgdonLooks good for d7, thanks!
Comment #23
xjmComment #24
webchickLooks good, thanks!
Committed and pushed to 7.x.
Comment #26
Lars Toomre CreditAttribution: Lars Toomre commentedI opened up #1808178: Further clean up of API docs for Color module to address additional issues about bringing Color module closer to D8 documentation standards. Reviews there are welcome.