For D6, at least...

http://api.drupal.org/api/function/filter_filter/6

does not match the function @612 of filter.module

I think this is the proper place to post this...

Please update!

Thank-you.

Comments

jhodgdon’s picture

Project: Documentation » Drupal core
Version: » 6.x-dev
Component: Correction/Clarification » documentation
Category: task » bug

Issues with API documentation go in the Drupal queue, not Documentation.

jhodgdon’s picture

Version: 6.x-dev » 7.x-dev

It looks like this is an issue in D7 as well as D6 and D5.

The problems I see with the API doc for filter_filter():
- Description does not list all of the included filters.
- Description uses different names for the included filters from the names the module actually uses.
- Description for the HTML filter doesn't say what it actually does (limit HTML tags)
- Description for the URL/email filter has a completely wrong description.

Probably the D7 issue should be fixed first, then the patch ported to D6 (which will involve removing a few lines of the description, as D7 has more filters than D6). Are we still fixing D5 too?

jhodgdon’s picture

Status: Active » Needs review
StatusFileSize
new1.25 KB

Here is a patch for review, for D7.

catch’s picture

Status: Needs review » Needs work

"Implementation of" has changed to just "Implement" in D7. There should also be a gap between the initial one-line function summary and the rest of it.

jhodgdon’s picture

StatusFileSize
new1.24 KB

Ah.

It appears also that the doc style in this file uses "Do something" rather than "Does something" in descriptions of functions. I am not sure why, since "Does something" is standard elsewhere in the software industry, and has been for decades. See, for instance http://java.sun.com/j2se/javadoc/writingdoccomments/#styleguide :

Use 3rd person (descriptive) not 2nd person (prescriptive). The description is in 3rd person declarative rather than 2nd person imperative.
- Gets the label. (preferred)
- Get the label. (avoid)

So the decision should have been to use "Implements" rather than "Implement". But that's a separate issue. Where/when was this discussed?

Anyway, I'll stay consistent with the rest of the file and D7, good decision or bad... how's this patch?

jhodgdon’s picture

3rd-person is also the standard for Pear PHP doc:
http://www.php-editors.com/pear_manual/standards.sample.html

 /**
     * Registers the status of foo's universe
     *
     * Summaries for methods should use 3rd person declarative rather
     * than 2nd person imperative, begining with a verb phrase.
     *
     * Summaries should add description beyond the method's name. The
     * best method names are "self-documenting", meaning they tell you
     * basically what the method does.  If the summary merely repeats
     * the method name in sentence form, it is not providing more
     * information.
jhodgdon’s picture

Status: Needs work » Needs review

Forgot to change status

jhodgdon’s picture

I filed a separate issue on the question of 1st person vs. 2nd person #487802: Function doc standard for Drupal is non-standard in industry

Until (or unless) that issue results in a change in coding standards, the current patch conforms to the current standards, I think.

dries’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. Marking RTBC so I can commit it later.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks!

jhodgdon’s picture

Version: 7.x-dev » 6.x-dev
Status: Fixed » Patch (to be ported)

This still needs to be ported to D6.

Are we patching D6 documentation still? The reason I am asking is that I have 2 or 3 simple doc patches for D6 marked "needs review" that have been in the queue for as long as 6+ weeks with no action. I don't want to waste time porting this patch to D6 if there is little chance it will be committed.

catch’s picture

jhogdon - I think patches will still get committed, but Drupal 6 patches don't show up in Drupal 7 patch queues from contributor links - which means they generally have a lot less eyes on them.

jhodgdon’s picture

I got that impression. ;}

It would be nice if doc patches for api.drupal.org (which is probably much much more highly used right now on D6 than D7, I would think) got more attention... sigh. I guess I could do my part and review some. :)

jhodgdon’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.13 KB

Here is a patch for D6. It looks a bit different from the D7 patch (filter names are different and D7 has one filter D6 lacks). So it probably needs a review for accuracy before application.

sun’s picture

Status: Needs review » Needs work

Once for all, I finally took the time to document the proper and *required* syntax for lists'n'stuff in Doxygen: http://drupal.org/node/1354

The syntax of this patch needs work. The code D7 was fixed already.

jhodgdon’s picture

Status: Needs work » Needs review
StatusFileSize
new1.19 KB

OK, this one has better (I hope) formatting.

pfrenssen’s picture

Status: Needs review » Reviewed & tested by the community

This looks good.

jhodgdon’s picture

The patch is more than a year old. Did you verify that it still applies to the Drupal 6 source?

pfrenssen’s picture

patching file modules/filter/filter.module
Hunk #1 succeeded at 610 (offset 9 lines).

I just tested it, I guess it would still apply cleanly.

jhodgdon’s picture

Thanks!

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Superb, thank you, committed, pushed.

Status: Fixed » Closed (fixed)

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