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.
In includes/common.inc, the comments for base_path() are not useful. They do not describe what the function actually returns (i.e., the root folder of the drupal installation), the fact that it prefixes but does not suffix a "/", etc. Examples are also useful and lacking.
Here's a first try:
Comment | File | Size | Author |
---|---|---|---|
#30 | 0001-Issue-432864-by-mcrittenden-andypost-Improve-comment.patch | 1.08 KB | marvil07 |
#26 | base_path_D6.patch | 962 bytes | andypost |
#23 | base_path.patch | 1.31 KB | mcrittenden |
#21 | base_path.patch | 1.41 KB | mcrittenden |
#19 | base_path.patch | 1.51 KB | mcrittenden |
Comments
Comment #1
mcrittenden CreditAttribution: mcrittenden commentedComment #2
mcrittenden CreditAttribution: mcrittenden commentedComment #3
mcrittenden CreditAttribution: mcrittenden commentedComment #4
Dries CreditAttribution: Dries commentedWhy does every second line intends with an additional space? We don't do that elsewhere in our code, so let's fix that up.
The second paragraph seems to have one 'at' or one 'into' too many -- does it have a grammar issue? (I'm not a native English -- just pointing things out.)
Other than that, it would be _great_ to have better documentation for this function. Thanks for your help!
Comment #5
mcrittenden CreditAttribution: mcrittenden commentedThanks for the comments. Here's a second try.
Comment #6
mcrittenden CreditAttribution: mcrittenden commentedRerolled with change to example 2 in the comments (looks like I was wrong...refer to chx's comment here: http://drupal.org/node/431976#comment-1519150)
Comment #7
mcrittenden CreditAttribution: mcrittenden commentedForgot the patch. Sorry guys.
Comment #8
franskuipers CreditAttribution: franskuipers commentedFor me its very clear now.
Comment #9
franskuipers CreditAttribution: franskuipers commentedBy changing example 2, this note is not needed anymore:
* NOTE: base_path prefixes "/" onto the returned path but
* does not suffix one. See examples below.
Comment #10
mcrittenden CreditAttribution: mcrittenden commentedGood point. Here's a fixed patch.
Comment #11
Dries CreditAttribution: Dries commentedLooks good. Committed to CVS HEAD. Thanks.
Comment #12
andypostShould it be ported to 6?
Comment #13
mcrittenden CreditAttribution: mcrittenden commentedSounds good to me.
Comment #14
andypostComment #15
andypostPatch against DRUPAL-6
Forget to change status
Comment #16
mcrittenden CreditAttribution: mcrittenden commentedD6 patch looks good to me.
Comment #17
mcrittenden CreditAttribution: mcrittenden commentedAdding a couple tags.
Comment #18
sunPHPDoc function summaries need to be on one line. Additionally, there needs to be a blank PHPDoc line between the PHPDoc summary and PHPDoc description. Please revert the summary to the original and add a blank PHPDoc line before the description.
In general, comments should wrap at 80 chars. The comments in this patch are wrapping at 65 chars (with 1 exception).
Use a trailing
()
when referring to function names (i.e.base_path()
).NOTE:
is superfluous here, the entire description is a note.No need to wrap URLs in quotes. Additionally, any example URLs should always use example.com. There are plenty of duplicated words in both examples, a simple list would do better:
Comment #19
mcrittenden CreditAttribution: mcrittenden commentedUpdated per sun's review.
Comment #20
sunMuch better.
According to http://drupal.org/node/1354 [which could really use an URL alias],
This was already wrong before, so let's fix it completely.
As you can see in http://api.drupal.org/api/function/base_path/7, the is a bit superfluous. ;)
Simple helper functions that just return something do not necessarily need a @return directive. In this case, all of @return is identical to the function's summary, so, superfluous.
Comment #21
mcrittenden CreditAttribution: mcrittenden commentedUpdated again per sun's review. Thanks sun.
Comment #22
sunMuch better.
Now we have:
Many lines, and I'd even say that the first paragraph makes more sense after the second, i.e.
Probably no longer related after this change, but please also make sure that blank PHPDoc lines are really blank:
i.e. no white-space after the asterisk.
Comment #23
mcrittenden CreditAttribution: mcrittenden commentedThanks again.
Comment #24
sunComment #25
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!
Comment #26
andypostSo let's improve D6 branch
Parch against current DRUPAL-6
Comment #27
mcrittenden CreditAttribution: mcrittenden commentedComment #30
marvil07 CreditAttribution: marvil07 commentedone trailing space less
Comment #31
amontero#30: 0001-Issue-432864-by-mcrittenden-andypost-Improve-comment.patch queued for re-testing.
Comment #32
amonteroCompared comment text against 7.x patch OK. However, patch has aged and it is not word-for-word identical to current 7.15 but has the same meaning, so rerolling seems overkill and might not get enough interested reviewers. Let's close this one.
Patch still applies and passes OK, trivial comment changes.
Comment #34
amontero30: 0001-Issue-432864-by-mcrittenden-andypost-Improve-comment.patch queued for re-testing.