block.module has a couple of functions that are missing @phpdocs

Comments

davyvdb’s picture

Assigned: Unassigned » davyvdb
Status: Active » Needs review
StatusFileSize
new7.73 KB
davyvdb’s picture

StatusFileSize
new2.87 KB

Don't trust the previous one. Had some leftovers from another patch. This is the one.

davyvdb’s picture

StatusFileSize
new1.03 KB

Ignore previous one again. I should stop patching for today :(

dries’s picture

Status: Needs review » Needs work

In documentation, we write ID instead of id. Quick reroll?

davyvdb’s picture

Status: Needs work » Needs review
StatusFileSize
new1.03 KB
jhodgdon’s picture

Status: Needs review » Needs work

Function descriptions should be in 3rd person. E.g. "gets" vs. "get" and "saves" vs. "save".

Also, I would prefer to see a bit more description of the return values. block_box_get() should say something like
An associative array containing the box information from the database.
rather than
The box.

What is a box, anyway?

On the save function, is the return value always TRUE? That seems odd. Why would a function return TRUE in all cases?

jhodgdon’s picture

Component: block.module » documentation
Category: task » bug
Priority: Minor » Normal

Changing component also. Normally, API doc issues are put into component "documentation. And it is a doc "bug" of normal priority if some functions are missing doc.

jhodgdon’s picture

Assigned: davyvdb » Unassigned
StatusFileSize
new1.4 KB

Hmmm... It appears that block_box_get() and block_box_save() have changed names in Drupal 7 since this patch was submitted. They are now called block_custom_block_get() etc. And they are still missing doc. All of the other functions in the block module have doc (not necessarily great doc, but at least a doc block).

The corresponding D6 functions are also missing doc, so if this patch is accepted for D7, it should then be backported (with appropriate function names) to D6.

jhodgdon’s picture

Status: Needs work » Needs review
dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks.

jhodgdon’s picture

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

Needs port to D6.

jhodgdon’s picture

Status: Patch (to be ported) » Reviewed & tested by the community
StatusFileSize
new1.41 KB

Here's a Drupal 6 port of the patch. Same functions, different names, exact same functionality. Marking RTBC as it's the same patch approved for D7.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed to Drupal 6.

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix, -Needs documentation, -Novice

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