This is part of the larger issue #1331240: [Meta] Correct documentation for 'list' related issues.
This issue contains a larger patch that fixes the 'easy' stuff regarding lists documentation in /includes (A-G).
The intention of this patch is that it should be easy to review without needing to look at the resulting patched code files. It also designed to only include changes that might be acceptable for backport to D7.
Comment | File | Size | Author |
---|---|---|---|
#43 | 1333534-43.patch | 21.96 KB | Lord_of_Codes |
#40 | 1333534-40.patch | 21.97 KB | piyuesh23 |
#37 | 1333534-37.patch | 21.97 KB | piyuesh23 |
| |||
#34 | 1333534-34.patch | 22.37 KB | kaushalkishorejaiswal |
| |||
#30 | 1333534-29.patch | 22.37 KB | jhodgdon |
|
Comments
Comment #1
Lars Toomre CreditAttribution: Lars Toomre commentedAttached is the first pass at the patch for this issue. It may well need to be re-rolled once the base API documentation sprint patches are committed. However, this contains the bulk of the 'easy' changes for lists and '(optional)' that need to be added (without review of function signatures).
This patch should wrap around the current patch from #1315886: Clean up API docs for includes directory, files starting with A-C in comment #63 covering /includes directory [A-C].
The other changes in this patch covering /includes directory [D-G] were entered without any other patch reference. A patch from #1317620: Clean up API docs for includes directory, files starting with D-G also should be committed before this patch.
Comment #2
jhodgdon#1: Easy_Lists_Fixes_A_G-1333534-1.patch queued for re-testing.
Comment #4
Lars Toomre CreditAttribution: Lars Toomre commentedIs the D-G patch committed yet? I have not gone back to change this yet with the A-C side in.
Comment #5
Albert Volkman CreditAttribution: Albert Volkman commentedRe-roll.
Comment #6
jhodgdonI gave this a quick look and found some issues:
In ajax.inc:
--> A CSS selector
In bootstrap.inc:
"flag set so"... that is not good English. How about "With this flag setting, the ..."
Sorry, I don't have time to review the rest of the patch right now. It's a big one.
Comment #7
Albert Volkman CreditAttribution: Albert Volkman commentedYeah, this re-roll was definitely a pain. Here's those two items fixed.
Comment #8
jhodgdonThanks! I'll try to get the rest of it reviewed soon too.
Comment #9
jhodgdonAlso, sorry, but I just committed a patch that will require a reroll (removal of a bit of the bootstrap.inc patch) on
#1853050: Fix docs and param names for drupal_send_headers()
Comment #10
Albert Volkman CreditAttribution: Albert Volkman commentedRe-rolled. Much easier this time :)
Comment #12
Albert Volkman CreditAttribution: Albert Volkman commented#10: easy_list_fixes_a_g-1333534-10.patch queued for re-testing.
Comment #13
jhodgdonI gave a lot of this this patch a thorough review, and most of it is ... well...
It just seems to be a huge waste of time to create/review/commit this patch. If a function signature has a default value for a parameter, it is really not necessary for the @param to tell us the parameter is (optional), and it's also a waste of time for the docs to tell us what the default value is. So ... I'm not going to review the rest of the patch that I didn't get to right now -- I can find better ways to spend my time...
I did find these errors in the parts I did review:
a) common.inc -- l() function docs:
Default to FALSE -> Defaults to FALSE. Also it would be nice if this information about the default value could be moved back up to the beginning of this section. Maybe the first sentence could say "Whether $text is HTML (TRUE) or plain text (FALSE, the default)."?
b) common.inc
We don't need this. The function is already referenced in the relevant section of the documentation.
c) Somewhere in common.inc
Boolean should be capitalized. And can we possibly start the @param docs with an explanation of what the parameter *does*, not the overly wordy sentence that just tells us the default value? What was wrong with the previous docs?
e) common.inc function drupal_parse_dependency()
In the 'name' component, can we say "('foo' in this example)" at the end instead of using "e.g."? It's referring to the example in the parameter. And I'm not sure what the 'version' part of 'versions' really means? Maybe that can be reworded?
f) file.inc
All of the elements in $options are optional. A more concise way to state this would be to put in the first line "An associative array of additional options, which can contain any of the following elements:" and then we wouldn't need to clutter the list by putting (optional) on every single element.
g) file.inc
Take this out. I wouldn't say "optional" here since the docs say **not** to use it.
h) file.inc
Should be . at end of first line not ,
Comment #14
jhodgdonapparently I forgot to change the status earlier.
Comment #15
krknth CreditAttribution: krknth as a volunteer and commentedI'm working on these issue.
Comment #16
krknth CreditAttribution: krknth as a volunteer and at Valuebound commentedAdded patch.
Updated following files by adding *(optional)* for @param description wherever function params has default value assigned.
Comment #17
krknth CreditAttribution: krknth as a volunteer and at Valuebound commentedNeeds review.
Comment #18
jhodgdonSo in general, this patch is kind of OK, but when you put (optional) on a parameter, it is usually helpful to state what the default behavior or value would be. Not all of these parameter docs have that information. So please go through and check for that.
Also, what happened to the previous patch, which had some additional fixes in it? It seems like you just started over... which maybe was appropriate since it had been 3 years, but it would have been nice to say something about it since this was an existing issue.
A few other concerns:
This makes the line go over 80 characters. Needs rewrapping.
It looks like you put (optional) on the other $options parameters, but this one was missed.
Really, this is optional? What is the default value? The function docs say "Sets a new active database" so if you don't set a key... what would this do?
Line goes over 80 chars, rewrap
over 80
over 80
Comment #19
krknth CreditAttribution: krknth as a volunteer and at Valuebound commentedComment #21
krknth CreditAttribution: krknth as a volunteer and at Valuebound commentedRestarted test & it passing.
Moving to old state as it moved by BOT
Comment #22
jhodgdonLooking better! So I think there are a few things that still could be improved, in an issue titled "cleanup":
Thanks for providing a default value explanation here!
So, in English, "text" is not a countable noun. That means you cannot say "one text", "two texts", or "a text".
I think I would change this to just say
If empty, a message is generated containing exception information.
Because it's also not really (probably?) correct that "all useful information" about the exception is included... so let's just leave it at that. :)
Name should be lower-case here.
Since this is optional, I think it should say "A" instead of "The"?
Also since this function is called
drupal_register_shutdown_function()
it is a bit odd that the shutdown function is optional!
So this might require a bit more explanation.
Maybe it would be better to say:
(optional) An additional shutdown function to register().
The next param ... is also optional.
And then in the @return maybe change this to say
@return array
The list of all registered shutdown functions.
That might make it clearer that if you call with no parameters, you're basically just asking for the list to be returned.
Does that make sense?
Language should be lower-case.
Also we have changed the wording on this in t() and other functions I thought... it should say:
(optional) A language code, to translate to a language other than what is used to display the page.
That second line would be slightly clearer, I think, if it said:
Defaults to 'default'.
I know we're just putting (optional) here, but the grammar/wording here could be cleaned up... "assured" is wrong... how about:
After a database import, it could be that the sequences table is behind. Passing in a minimum ID ensures that we never issue the same ID.
What is the default value here?
default value?
default value?
default value?
default value?
Let's fix the list formatting.
Instead of using - it should have :
So for example:
- FILE_EXISTS_REPLACE: Replace the...
...
- FILE_EXISTS_RENAME: (default) Append ...
Fix list formatting as in previous comment please.
default value?
list formatting
This line goes over 80 characters.
Comment #23
krknth CreditAttribution: krknth as a volunteer and at Valuebound commented@jhodgdon : Improved all points #22. Pls let me know something missing.
Comment #24
jhodgdonNice! This is getting very close. There are only a few small things to fix up:
The pre-existing last line needs to be wrapped with the rest of the newly wrapped paragraph.
I don't think register() is a function name, so it shouldn't have () on it?
This needs to be types. So probably URI is really "string" type? And instead of "FALSE" we would put "false" for @param/@return types. So I think it should say:
@return string|false
See https://www.drupal.org/node/1354#types
for more information.
We need to know what the default is here? The rest of these similar lists have (default) in there, but this one was missed.
See note above about return types.
See above note about return types.
This is a comma splice. Before the "if", the comma should be a ; instead.
See above note about return types.
Comment #25
r_sharma08 CreditAttribution: r_sharma08 at Publicis Sapient for Publicis Sapient commentedPatch attached, please review.
Comment #26
r_sharma08 CreditAttribution: r_sharma08 at Publicis Sapient for Publicis Sapient commentedComment #27
r_sharma08 CreditAttribution: r_sharma08 at Publicis Sapient for Publicis Sapient commentedComment #28
krknth CreditAttribution: krknth as a volunteer and at Valuebound commented@r_sharma08 : You wasted my 1 hour. Please assign your self before you want to work on any issue.
Thanks for patch. Please add interdiff file too.
@jhodgdon :
Comment #29
heykarthikwithuComment #30
jhodgdonnitpick: 2 spaces here instead of 1
I edited the patch directly and re-uploaded to fix this one problem. Everything else looks fine. Thanks!
Comment #33
jhodgdonLooks like this needs a reroll.
Comment #34
kaushalkishorejaiswal CreditAttribution: kaushalkishorejaiswal as a volunteer and at Publicis Sapient for Publicis Sapient commentedComment #36
jhodgdonThat patch doesn't apply either.
Comment #37
piyuesh23 CreditAttribution: piyuesh23 at QED42 commentedRe-rolled. Uploading a new patch.
Comment #38
piyuesh23 CreditAttribution: piyuesh23 at QED42 commentedComment #40
piyuesh23 CreditAttribution: piyuesh23 at QED42 commentedOops! Looks like an incorrect patch was uploaded. Uploading another one here.
Comment #41
piyuesh23 CreditAttribution: piyuesh23 at QED42 commentedComment #42
jhodgdonCan you kindly make a patch with more context lines in it? This one is difficult to review because I would need to open up all of the files affected, for instance to check whether parameters that this patch marks as (optional) really are optional in the function signature. Something like 6 or 8 context lines would be helpful. Thanks!
Comment #43
Lord_of_Codes CreditAttribution: Lord_of_Codes commentedRerolled the most recently uploaded patch on Drupal 8.0.1 stable release .Leaving one conflict, it was basically an auto-merge . Tested the patch- worked absolutely fine.
Comment #45
jhodgdonApparently the latest patch doesn't apply.
Comment #46
Lord_of_Codes CreditAttribution: Lord_of_Codes commentedComment #47
Lord_of_Codes CreditAttribution: Lord_of_Codes commentedComment #48
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedAny update on this where are we ?
Comment #49
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commented@jhodgdon can i start from #30 if i am right here.
Comment #50
jhodgdon@snehi: yes that seems like a good idea.
Comment #51
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedComment #52
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedComment #53
deepakaryan1988Comment #54
jhodgdonThis issue is badly scoped according to our current Issue Scope guidelines. As it is a "cleanup misc. standards stuff" issue I am just going to close it as Won't Fix. Please do not make a patch. Thanks!
See https://www.drupal.org/core/scope for more on this...
Comment #55
deepakaryan1988@jhodgdon Thanks for letting me know about this.