The documentation for hook_search at http://api.drupal.org/api/function/hook_search/6 is missing documentation of the 'admin' operation. The example provided (which comes from node_search) includes it.

Suggest adding, in the 'op' parameter definition section:

'admin': The hook should return a form array, containing any fieldsets the module wants to add to the Search settings page at admin/settings/search.

Also, it should be made clear in the "Return Value" section that this return value only applies to the 'search' operation, by adding a short note.

Note that this is an issue in Drupal 5.x, 6.x, and 7.x. So all three should be patched.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Issue tags: +Novice

This would be a good "Novice" project.

There is some instruction at http://drupal.org/node/144223 (Updating API Documentation) about how to modify API documentation. Note that in Drupal 7, the hook_search API doc page is generated from a page in the main Drupal source code tree, but in earlier versions, it is in the "contrib" tree (see referenced page on Updating API Documentation for more information).

JamesAn’s picture

Assigned: Unassigned » JamesAn
Status: Active » Needs work
FileSize
2.72 KB

Thanks for the bite-size task. ^_^

Here's the patch. I took the liberty of fleshing out the return value in more detail, as I've been frustrated before reading incomplete documentation. I've documented the expected return value for all the operations.

I've gotta go, but Drupal 5 and 6 versions are coming up. I'll finish them tonight.

JamesAn’s picture

Here are the D5 and D6 patches.

JamesAn’s picture

Status: Needs work » Needs review

Gah. Always forgetting to flip the status to needs review. Here we go!

mr.baileys’s picture

Status: Needs review » Needs work

Probably needs some fine-tuning: capitalization and periods at the end of sentences are a bit inconsistent. Sometimes colons are followed by a capitalized letter, sometimes they're not. Some sentences end with a period, others do not.

JamesAn’s picture

JamesAn’s picture

Status: Needs work » Needs review

Blah. Forgot to flip the switch.

JamesAn’s picture

Assigned: JamesAn » Unassigned
mcrittenden’s picture

Couple of really picky things: lines 38, 53, 56, and 63 go over the recommended 80 characters. There's a period in the middle of the sentence "... indexing bookkeeping so that it. starts from scratch ...". Line 32 should have a comma after "the module name" (common mistake when dealing with items in a series...see http://www.chompchomp.com/terms/iteminaseries.htm).

Sorry to be so picky, somebody's gotta do it :).

mcrittenden’s picture

Status: Needs review » Needs work

Forgot to switch status.

lilou’s picture

FileSize
4.81 KB

Reroll according to #9

lilou’s picture

Category: bug » task
Status: Needs work » Needs review

...

Dries’s picture

Status: Needs review » Fixed

I've committed this to CVS HEAD because it is an improvement. Feel free to add follow-up patches with refinements to this issue, if necessary. I don't think it is. Thanks!

jhodgdon’s picture

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

Needs port to D6, and possibly to D5 (are we still patching D5?).

JamesAn’s picture

Status: Patch (to be ported) » Needs review

#6 contains the D6 and D5 patches. Can someone review this? Thanks.

jhodgdon’s picture

Status: Needs review » Needs work

See #9 - it looks like the D5 and D6 patches in #6 suffer from the same problems.

JamesAn’s picture

Status: Needs work » Needs review
FileSize
4.6 KB
4.59 KB

Oy vey! Apologies for not reading everything... I assumed everything was fixed with I saw the D7 commit message.

Here's the D6 and D5 patches fixed according to #9.

jhodgdon’s picture

Pickiness:

+ * hook_update_index() should update their indexing bookkeeping so that it.
* starts from scratch the next time hook_update_index() is called.

This sentence has a period in the middle of it.

Otherwise, it looks great!

jhodgdon’s picture

Status: Needs review » Needs work

Jamesan - do you have Contrib access to commit those patches (with the minor period change)? If so, I say go ahead and commit them.

JamesAn’s picture

Status: Needs work » Needs review
FileSize
4.52 KB
4.52 KB

Nice catch. Silly me and inserting periods at the wrong places. All fixed.

I just got my CVS account a couple days ago for GSoC. Still figuring out how to do what and where. Let me figure out how to commit this patch as a test run. ^_^

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Sounds good, JamesAn. If you need any guidance, please ask for help.

JamesAn’s picture

Status: Reviewed & tested by the community » Fixed

Methinks I did it!

Question about the commit message:
The doc (and most people) format the message with "#12345 by username: Brief description of changes.", but Dries consistently commits with "- Patch #12345 by username: Brief description of changes.". I know its minor, but does the difference matter?

jhodgdon’s picture

The important thing is that someone looking at the commit message can find what issue it came from, see who contributed to the changes, what you changed, and why. So I don't think the difference is significant.

Status: Fixed » Closed (fixed)
Issue tags: -Novice

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