Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The docblock for function doBookTreeBuild in BookManger.php class is missing both @param and @return directives. The @param directive for $parameters variable should include an '(optional)' string to start its description.
Comment | File | Size | Author |
---|---|---|---|
#58 | interdiff-2608692-55-58.txt | 1.86 KB | imalabya |
#58 | 2608692-58.patch | 5.04 KB | imalabya |
#55 | interdiff-2608692-53-55.txt | 1.14 KB | marvin_B8 |
#55 | 2608692-55.patch | 5.04 KB | marvin_B8 |
#38 | interdiff-2608692-34-38.txt | 656 bytes | ashhishhh |
Comments
Comment #2
heykarthikwithuWorking on this.
Comment #3
heykarthikwithuAdded @param and @return to the function.
Comment #4
Lars Toomre CreditAttribution: Lars Toomre commentedThanks for the initial patch @heykarthikwithu. You missed my comment from the issue summary "The @param directive for $parameters variable should include an '(optional)' string to start its description." Setting back to needs work for that minimal correction.
While writing or updating a docblock, you might consider that docblocks are intended for a developer to be able to use without needing to inspect the code for the documented method or function. In this case, the description for the $parameters variable is not really helpful. Is this variable required or optional? If optional, what is the default value? If not, what is the expected array content here, a list of node IDs to include in the menu tree? Or a list of strings that control what portion of the menu tree is built? Hopefully, you get my point...
While looking further at the file BookManager.php, I see that a few other methods also need docblock attention. You might consider expanding this issue to address:
- Missing @param and descriptions for __construct().
- Description of @param $link should include that it passed by reference in method setParents().
- Missing @param and description for method doBookTreeCheckAccess().
- Missing @param and @return directives for buildBookOutlineRecursive().
If you want to roll an updated patch, I will stay in a reviewer mode so that I can RTBC the final result. If not, let me know and I will roll a patch for this file. Also as a suggestion when rolling a patch that includes added type hinting, use the -U switch on git diff to expand the surrounding lines of context to six or even seven. That way the reviewer and/or committer can generally perform the necessary review without also applying the patch for a review.
Comment #5
anil280988 CreditAttribution: anil280988 at Publicis Sapient for Publicis Sapient commentedAdded new patch
Comment #6
heykarthikwithuComment #7
jhodgdonThanks for the patches and reviews! Sorry for my not reviewing sooner; I've been on vacation...
Anyway, this latest patch still needs some work:
ids => IDs
don't use "plids" in docs text. Write out "parent link IDs" instead.
Well it looks like also max_depth can affect whether the whole outline is built, right?
nids => node IDs
And ... coordinates??!?
remove the comma
Redundant wording here. Tighten up.
Remove word "return" here.... and what is an "array of menu trees" anyway? It seems like it is just returning the tree for one book?
extra space on line end. Set up your editor to remove these or at least highlight them.
extra space on line end
extra space
I doubt it is an array of trees, should just be one tree?
extra space
Comment #8
kaushalkishorejaiswal CreditAttribution: kaushalkishorejaiswal as a volunteer and at Publicis Sapient for Publicis Sapient commentedComment #10
anil280988 CreditAttribution: anil280988 at Publicis Sapient for Publicis Sapient commentedHi,
Created patch.
Comment #12
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedExtra Space
Extra Space
Extra Space
Comment #13
r_sharma08 CreditAttribution: r_sharma08 at Publicis Sapient for Publicis Sapient commentedCorrected and applied patch. Please review.
Comment #14
jhodgdonThanks! Getting better but still needs some work:
What are coordinates?
Please copy the corrected documentation from the other method in this patch to this section, instead of making the same mistakes that have already been corrected in the patch (see previous reviews). The lines here and below have several problems that have already been addressed in this patch, and I don't really want to go through them one by one again. Thanks!
plids => parent link IDs
Needs to end in .
Um, I doubt it... what's a "menu" tree? I think it's returning a book tree?
Also don't start return value docs with "Return a".
Comment #15
anil280988 CreditAttribution: anil280988 at Publicis Sapient for Publicis Sapient commentedHi jhodgdon,
Added Patch. For #2 kindly tell if more changes are required
Comment #16
jhodgdonThanks for the patch! But where's the interdiff file please? In the future, when you attach a new patch on an existing issue that previously had a patch, ALWAYS make an interdiff file.
See https://www.drupal.org/documentation/git/interdiff for instructions.
Anyway, there are STILL the same problems with this patch as in previous reviews, plus a few new ones:
The second line here should be indented 1 space less.
a book => the book
a whole tree => the whole tree
sigh. AGAIN please instead of making the same mistakes that were already mentioned in previous reviews and fixed in the other part of this patch, please COPY this section from the part of the patch that has already been fixed.
Sorry for shouting, but it is REALLY annoying to have to make the same review comments over and over. Probably the problem is that so many different people are working on this patch and they aren't reading the whole issue. It would be a LOT better if ONE person worked on an issue and kept working on it until it was fixed, rather than new people picking it up all the time and making the same mistakes over and over and over. Please.
This should say something like:
An array with links representing the tree structure of the book.
or maybe check what the other function's @return docs say and copy that?
Comment #17
r_sharma08 CreditAttribution: r_sharma08 at Publicis Sapient for Publicis Sapient commentedThanks @jhodgdon for your valuable comments and suggestions.
Patch attached for review.
Comment #19
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedPlease don't use we, them, those etc.
which build a tree for a book.
How's it ?
Don't know what jhodgodon says about it.
See 1st one comment.
currently really ?
Please see my second comment.
of the book
OR
of a book.
Use same wording on similar lines.
You wish ???
Comment #20
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedComment #21
r_sharma08 CreditAttribution: r_sharma08 at Publicis Sapient for Publicis Sapient commentedupdated patch attached.Please review.
Comment #22
anil280988 CreditAttribution: anil280988 at Publicis Sapient for Publicis Sapient commentedComment #23
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commenteds/are/is
Not sure about this.
use "the book" everywhere.
The book tree to operate on.
Comment #24
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedComment #25
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedComment #26
jhodgdonThanks for all the patches and reviews!
But there are *still* problems with this patch:
This is garbled and ungrammatical. The original line is much clearer.
See above note.
Sigh. CAN YOU PLEASE COPY THE FIXED-UP DOCUMENTATION FROM THE OTHER PART OF THE PATCH INTO HERE?????????
This is only about the 5th time I have asked for this to be done. It is getting very tiresome. Look at the patch. We are putting the same documentation into two places. One of them has been revised and fixed up. The other one was copied from the old version and still has problems. Why is this so difficult to take care of?
This is garbled and ungrammatical.
Comment #27
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedHi @Jhodgdon Sorry for making you shout here.
In future we will take care the same and ONE person will work on an issue and keep working on it until it is fixed, rather than new people picking it up all the time and making the same mistakes over and over and over.
Please see attached patch and interdiff.
Comment #28
jhodgdonThank you, and even though I have been very frustrated lately with people ignoring my review comments, I should not have shouted -- so please accept my apology. It is definitely best if a single person assigns themself an issue and leaves it assigned (with only that one person working on it) until the patch is committed, so I would definitely appreciate it if people adopted that workflow!
Anyway, the new patch is almost perfect. One very small thing to fix:
a book => the book
[the reason is this is the return docs, so "the" refers to the book that we're making the tree for]
Comment #29
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedThanks for motivating us and your patience. I know we all are doing silly mistakes over and over again, i hope it will not be repeated again.
Anyway i uploaded the final patch with interdiff .
Comment #30
jhodgdonThanks! Looks fine now.
Comment #31
catchComment #32
alexpottLet's fix this whilst we are here - menu_build_tree() no longer exists. I think this should be replaced with an @see to BookOutlineStorageInterface::getBookMenuTree()
Comment #33
jhodgdonGood idea. Whoever makes the next patch, remember to put the full namespace on the class when you do this.
Comment #34
anil280988 CreditAttribution: anil280988 at Publicis Sapient for Publicis Sapient commentedHi alexpott/jhodgdon,
Replaced menu_build_tree(). Kindly suggest if any other changes are required.
Comment #35
Manjit.SinghChanges that suggested in #32are there in #34. Looks good now.
Comment #36
alexpottSorry I should have noticed this before - it should be
self::setParents()
and there should be an @see with a fqdn linkComment #37
ashhishhh CreditAttribution: ashhishhh at Valuebound commentedComment #38
ashhishhh CreditAttribution: ashhishhh at Valuebound commentedAddressed #36 in this patch.
Thanks
Comment #39
no_angel CreditAttribution: no_angel as a volunteer commentedI'll give it a go.
Comment #40
no_angel CreditAttribution: no_angel as a volunteer commentedI'll give it a go.
Comment #41
jhodgdonThanks for the new patch! Still not quite right though...
Oh, we should also fix this -- function _menu_build_tree(), as far as I can tell, does not exist. It's most likely a method on this class now?
Same here.
Um. This doesn't make sense to me. Why are we having a link to the function that is being documented here? (This is the docs header for the setParents() method.)
So what we should be doing here is just something like:
The book link to update, passed by reference.
We should not have an @see to the same method that is being documented.
Sorry for the confusion... most likely Alex didn't realize which method was being documented when he said we wanted a @see added and the above modification.
Comment #42
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedComment #43
claudiu.cristeaComment #44
rakesh.gectcrComment #45
rakesh.gectcr@jhodgdon,
I have done the changes according to your comments above, I am not able to create the interdiff file from #35. So for
1 & 2)
3)
4) removed the @see
Comment #46
rakesh.gectcrComment #48
rakesh.gectcrComment #49
claudiu.cristeaComment #50
jhodgdonThanks! Still some problems to fix in this patch...
This line has MANY problems:
- The word "see" has vanished. We need it.
- Should not be "the" before "details".
- The namespace/class are missing for this. There is no Drupal::menuTree() method. It is on some other class.
- There should not be a space between the ()
- There should not be a ; after the ()
Note: there's another line below with similar problems...
Book should not be capitalized here.
See note above about multiple problems in this line.
Comment #51
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedPlease review this one.
Comment #52
jhodgdonThanks, but:
This class/method does not exist, as far as I can tell. Method names never begin with capital letters anyway... Something is wrong.
Same here
Comment #53
marvin_B8 CreditAttribution: marvin_B8 as a volunteer and at comm-press commentedComment #54
jhodgdonThanks, almost!
Thanks for fixing this, but now this documentation line goes over 80 characters. Please rewrap.
Here too.
Comment #55
marvin_B8 CreditAttribution: marvin_B8 as a volunteer and at comm-press commentedComment #56
Manjit.Singh@jhodgdon If i am not wrong this issue should be move into 8.1.x branch. What do you think ?
Comment #57
jhodgdonSo, this is an API docs issue. It will eventually need to be committed to 8.0, 8.1, and 8.2. Our policy (which is NOT sustainable) has been that such issues are marked 8.0 and then committed to all three at the same time... I think this policy will need to be revised at some point but that is what we're doing at the moment.
Regarding the last patch, looking at the interdiff, the rewrapping still isn't quite right:
At least some of the words in that last line "for the actual query" can be moved up to the previous line... same in the other doc block in the interdiff too.
Comment #58
imalabyaHave added a patch for the above comment.
Comment #59
jhodgdonLooks good now, thanks!
Changing version to 8.2.x and adding tags for backport, because this should go into all 3 8.x branches. The "backport" probably just means "apply the same patch to all 3".
Comment #63
catchCommitted/pushed to all three 8.x branches, thanks!