Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sven.lauer’s picture

Status: Active » Needs review
FileSize
5.18 KB

And another quick one.

jhodgdon’s picture

Status: Needs review » Needs work

Looks pretty good, thanks! A couple of things need fixing:

a)

  /**
-   * Send block order to the server, and expand previously disabled blocks.
+   * Sends block order to the server, and expand previously disabled blocks.

expand -> expands

b)

 /**
- * Dashboard page callback.
+ * Page callback: Display dashboard.

Display dashboard -> Displays the dashboard.

c)

  * @param $launch_customize
  *   Whether to launch in customization mode right away. TRUE or FALSE.
+ * @see dashboard_menu()

Leave a blank line before the @see.

d) dashboard_admin_blocks() needs @see for dashboard_menu(), and needs the line saying what path(s) it pertains to.

jhodgdon’s picture

Also, looking through the dashboard.module file, there are a couple of other functions that haven't been fixed up and should be, such as:

/**
 * Ajax callback to show disabled blocks in the dashboard customization mode.
 */
function dashboard_show_disabled() {
sven.lauer’s picture

Re-rolling. With respect to #3: I thought that it would still be useful to retain the information that the function is intended as an ajax callback, so I went with "Ajax callback: VERBs ..." --- though, technically, I guess those are just menu callbacks.

sven.lauer’s picture

Status: Needs work » Needs review
jhodgdon’s picture

Status: Needs review » Needs work

What you did for the Ajax callbacks is probably fine. But if they are hook_menu() callbacks, they should also have the path?

Also, this needs a newline after the file docblock (sorry, probably didn't catch that last review):
+/**
+ * @file
+ * Ataches behaviors for dashboard module.
+ */
(function ($) {

And while we're at it, this could use "the":
+ * Adapts block's position to stay connected with mouse pointer.
Actually should probably be:
Adapts a block's position to stay connected with the mouse pointer.

And this could use "the":
+ * Page callback: Displays dashboard.

sven.lauer’s picture

Status: Needs work » Needs review
FileSize
6.22 KB

Good point about the path's for the ajax callbacks.

Also added the "the"s and the blank line.

xjm’s picture

Status: Needs review » Needs work

Thanks @sven.lauer! I noticed a few small things about the patch:

  1. +++ b/core/modules/dashboard/dashboard.jsundefined
    @@ -1,3 +1,8 @@
    +/**
    + * @file
    + * Ataches behaviors for the Dashboard module.
    + */
    + ¶
    
    @@ -198,8 +201,10 @@ Drupal.behaviors.dashboard = {
    +   * Returns the current order of the blocks in each of the sortable regions.
    +   * ¶
    +   * @return
    +   *   The current order of the blocks, in query string format.
    

    Some trailing whitespace here.

  2. +++ b/core/modules/dashboard/dashboard.jsundefined
    @@ -60,7 +65,7 @@ Drupal.behaviors.dashboard = {
       /**
    -   * Helper for enterCustomizeMode; sets up drag-and-drop and close button.
    +   * Sets up drag-and-drop and close button.
        */
    

    It might be good to make this a little more clear, maybe, "Sets up the drag-and-drop behavior and the 'close' button."

  3. +++ b/core/modules/dashboard/dashboard.moduleundefined
    @@ -630,7 +645,7 @@ function theme_dashboard_region($variables) {
    - * Returns HTML for a set of disabled blocks, for display in dashboard customization mode.
    + * Returns HTML for disabled blocks, used in dashboard customization mode.
    
    @@ -652,7 +667,7 @@ function theme_dashboard_disabled_blocks($variables) {
    - * Returns HTML for a disabled block, for display in dashboard customization mode.
    + * Returns HTML for a disabled block, used in dashboard customization mode.
    

    These two are kinda comma splices. I'd say either make it two sentences, or (better) simply omit the comma and the word "used."

After applying the patch, I also found a few more things in the dashboard module that we can probably fix:

  • DashboardBlocksTestCase does not have a docblock, and its test cases need the right verb tense in their summaries. Some are also two lines.
  • Drupal.behaviors.dashboard could probably have it summary changed to "Implements..." rather than "Implementation of..."
  • The CSS files could use @file blocks again.
  • I'm not sure about this one because I've messed it up before, but in dashboard.api.php, should the hook summary begin "Add" rather than "Adds"? Reference: http://drupal.org/node/1354#hooks

Thanks for your work on all these!

sven.lauer’s picture

Status: Needs work » Needs review
FileSize
9 KB

Fixing all of these except one (and yes, you are right, hook documentations should be in imperative form, so "add" instead of "adds"):

These two are kinda comma splices. I'd say either make it two sentences, or (better) simply omit the comma and the word "used."

What is sometimes called "comma splices" is perfectly grammatical in English. So much so that even Lynn Truss, who is the source and/or progenitor of many LIES about English grammar and orthography, says: "so many highly respected writers observe the splice comma that a rather unfair rule emerges on this one: only do it if you're famous." (By "observe" she seems to mean "use".)

Of course, a managing editor (== doc lead) may decide that random rules are enforced, but unless I hear from one of them, I refuse to abide by those.

Note that the change you are proposing "Returns HTML for disabled blocks, used in dashboard customization mode." => "Returns HTML for disabled blocks in dashboard customization mode." would actually change the meaning, if subtly.

sven.lauer’s picture

Uhm, sorry.

I did not mean to be disrespectful. I appreciate your reviews.

As a linguist by trade, I just have this visceral reaction to invocations of pseudo-rules of English. And there is a lot of misinformation out there, so it is perfectly understandable that someone would want to enforce these pseudo-rules (see also "split infinitives" and "stranded prepositions"). In my profession, we don't believe in these pseudo-rules (given that many well-respected prose writers use the allegedly unacceptable forms, and English (luckily!) does not have an Academie to regulate what is right).

So, please forgive me if I react strongly against certain prescriptions: It's just what I've been taught to loathe.

xjm’s picture

Well, documentation standards are, by their nature, prescriptive, as is any formalized writing really. Different registers. :) I'd use constructions here in a comment that I would never use in the API documentation. Contractions, for instance. Incomplete sentences.

Edit: Also, as a note. Perhaps "comma splice" is just what the 8th grade English teachers call what is (to me) a comma that "sounds wrong." Those commas above sound wrong. That's not how a comma sounds.

Edit 2: I wonder if you would have had a less visceral reaction if I'd not called it a "comma splice"? Hmmm. Of course, none of this is on topic, but perhaps we can debate it some time. Nonsense up with which I will not put! ;)

xjm’s picture

Hmm, reading this:

Note that the change you are proposing "Returns HTML for disabled blocks, used in dashboard customization mode." => "Returns HTML for disabled blocks in dashboard customization mode." would actually change the meaning, if subtly.

I guess that's part of my discomfort with these two summaries. "Used" is ambiguous. Is the HTML used? The disabled blocks? The function itself? The comma does not denote any sort of relationship between "used" and a specific subject. I don't know what the intended meaning is.

However, we both agree it's a minor and (clearly) debatable point, so #9 is probably RTBC pending @jhodgdon's OK. ;)

jhodgdon’s picture

Status: Needs review » Needs work

Regarding comma splices and other usage/grammar/punctuation issues, on drupal.org we have some editorial standards for documentation, and we generally try to follow them in our API docs too.
http://drupal.org/style-guide/content

Basically, we use standard style references for stuff that isn't Drupal-specific. My style reference mentions comma splices as not being standard American English good style.

Anyway, whether or not we care about comma splices, I agree that the comma is not the best punctuation in those two examples mentioned in #8 item 3. I think we can do better at writing this documentation. For instance:

- * Returns HTML for a set of disabled blocks, for display in dashboard customization mode.
+ * Returns HTML for disabled blocks, used in dashboard customization mode.

How about:

Returns HTML for disabled blocks, for use in dashboard customization mode.

sven.lauer’s picture

Re-rolled, adopting the wording suggested by @jhodgdon in #13.

And I do agree that standards are prescriptive (that is why they are standards), which is also why I said that, in the end (in absence of a written standard regulating this), jhhodgdon has final word. And I submit that "comma splices" can be acceptable in quite formal prose (which is not to say that I advocate randomly squishing together independent sentences). Anyhow, the issue is settled.

sven.lauer’s picture

Status: Needs work » Needs review
xjm’s picture

I think dashboard-rtl.css is still missing its @file block. Outside of that, this patch looks ready to me.

sven.lauer’s picture

Right. Also, dashboard.module actually still did not have a @file block.

Fixing both in the attached patch.

xjm’s picture

Ah, missed that too. I don't see the @file for dashboard.module in that patch, though?

sven.lauer’s picture

That is ... odd. I put it there, and it is in my local branch ... but not in the patch.

Anyhow, here is the patch with the @file header.

xjm’s picture

Status: Needs review » Reviewed & tested by the community

Alrighty, everything looks correct now. Thanks @sven.lauer!

David_Rothstein’s picture

Status: Reviewed & tested by the community » Needs review
 <?php
-
 /**
  * @file

Do we really not want a blank line there (and other similar places in the patch)? Pretty much all of core has the blank line.

It makes more sense to me with one, since we always put blank lines before docblocks everywhere else, to separate them from what came before.

jhodgdon’s picture

You mean at the very top of the file? Agreed, it looks like a lot of core has a blank line, but I don't have a strong opinion on whether there should or shouldn't be one. Does it add a lot to readability to have one there?

xjm’s picture

I think literally almost all of core has the blank line. In my patches I was removing a second line where there were two, but leaving when it was one. I guess I think it looks a little nicer with the blank line, but mostly it's probably best to be consistent.

jhodgdon’s picture

Status: Needs review » Needs work

I bow to your greater wisdom. :)

xjm’s picture

Status: Needs work » Needs review
FileSize
931 bytes
9.56 KB

Pffffff. :P

Here's a reroll of @sven.lauer's patch that simply restores the blank line in PHP files.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

okeydokey!

David_Rothstein’s picture

Status: Reviewed & tested by the community » Needs work
+ * @file
+ * Provides a dashboard page in the adminstrative interface.

Sorry, just noticed this ("adminstrative" => "administrative"). I'd reroll but then I'd get commit credit for a patch I didn't actually do anything meaningful for :)

xjm’s picture

Status: Needs work » Needs review
FileSize
387 bytes
9.56 KB

Well, I know webchick at least prunes rerollers and other random-attachment-adders from the commit mentions. Dries, however, just uses whatever dreditor says. Not sure about catch. ;)

Since I already rerolled once, I'll take the risk!

Status: Needs review » Needs work

The last submitted patch, interdiff-25-28.patch, failed testing.

xjm’s picture

Status: Needs work » Needs review

Right, yeah, that second isn't a patch. ;)

David_Rothstein’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
476 bytes
9.56 KB

I need to stop proofreading. (See the attached interdiff.) Now I too can be added to the commit list, I guess...

With this little fix I think it's good to go.

David_Rothstein’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
9.56 KB

Actually, "administrator-only" doesn't really make sense. There is nothing about those blocks that make them only for administrators.

How about "administrator-flagged" instead?

Now I can say I've actually contributed to this patch... sort of :)

xjm’s picture

Maybe just "administrative"?

David_Rothstein’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
9.55 KB

Definitely seems reasonable. Since that's the only change I'm putting this back to RTBC.

David_Rothstein’s picture

#34: dashboard-1332658-34.patch queued for re-testing.

xjm’s picture

Dries’s picture

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

Committed to 8.x. Moving to 7.x.

xjm’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

I checked #36 for the "new" standards, and while there are several changes to summaries that add "Foo callback:" prefixes, in all cases it's just a reordering of words already there that makes the summaries follow our general standards.

Albert Volkman’s picture

D7 backport.

Albert Volkman’s picture

Status: Patch (to be ported) » Needs review
xjm’s picture

Status: Needs review » Needs work

Thanks @Albert Volkman! Everything there looks to be okay to backport, except for these parts:

+++ b/modules/dashboard/dashboard.moduleundefined
@@ -263,10 +267,12 @@ function dashboard_forms() {
+ *
+ * @see dashboard_menu()

@@ -298,11 +304,12 @@ function dashboard_admin($launch_customize = FALSE) {
  *
+ * @see dashboard_menu()

@@ -485,7 +492,9 @@ function dashboard_dashboard_regions() {
+ *
+ * @see dashboard_menu()

@@ -506,12 +515,14 @@ function dashboard_show_disabled() {
+ *
+ * @see dashboard_menu()

We need to not add these @see to the menu hook implementation in D7. (As I stated above, though, I think the changes to the summaries of those same callbacks are fine because they are really just reordering words that are already there.)

Albert Volkman’s picture

@see dashboard_menu() removed!

Albert Volkman’s picture

Status: Needs work » Needs review
xjm’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to go now; thanks!

webchick’s picture

Status: Reviewed & tested by the community » Needs review

All of this makes sense except for:


- * Adds regions to the dashboard.
+ * Add regions to the dashboard.

I thought we always put S on the end of the first word of the function descriptor.

David_Rothstein’s picture

I thought hook documentation does it the other way, without the "s" (although I'm not entirely sure why).

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

#46 is correct. Hook documentation is not the same as others, because we're documenting "If you want your module to do X, implement this hook", not "This function does this action".

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Oh bloody hell. :)

Ok, committed and pushed to 7.x. Thanks.

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