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.

CommentFileSizeAuthor
#58 interdiff-2608692-55-58.txt1.86 KBimalabya
#58 2608692-58.patch5.04 KBimalabya
#55 interdiff-2608692-53-55.txt1.14 KBmarvin_B8
#55 2608692-55.patch5.04 KBmarvin_B8
#53 interdiff-2608692-51-53.txt1.23 KBmarvin_B8
#53 2608692-53.patch5.02 KBmarvin_B8
#51 interdiff.txt1.72 KBsnehi
#51 2608692-51.patch4.97 KBsnehi
#48 2608692-47.patch4.93 KBrakesh.gectcr
#45 revise-docblock-2608692-45.patch1.77 KBrakesh.gectcr
#38 interdiff-2608692-34-38.txt656 bytesashhishhh
#38 revise-docblock-2608692-38.patch4.96 KBashhishhh
#34 interdiff-2608692-29-34.txt630 bytesanil280988
#34 revise-docblock-2608692-34.patch4.82 KBanil280988
#29 revise-docblock-2608692-29.patch4.7 KBsnehi
#29 interdiff-27-29.txt593 bytessnehi
#27 revise-docblock-2608692-27.patch4.7 KBsnehi
#27 interdiff-25-27.txt2.5 KBsnehi
#25 revise-docblock-2608692-21.patch4.89 KBsnehi
#25 interdiff-21-25.txt1.41 KBsnehi
#21 interdiff-2608692-17-21.txt2.71 KBr_sharma08
#21 revise-docblock-2608692-21.patch4.89 KBr_sharma08
#17 interdiff-2608692-15-17.patch2.18 KBr_sharma08
#17 revise-docblock-2608692-17.patch4.89 KBr_sharma08
#15 revise-docblock-2608692-15.patch4.85 KBanil280988
#13 interdiff-2608692-5-13.txt3.32 KBr_sharma08
#13 revise-docblock-2608692-13.patch5.32 KBr_sharma08
#10 2608692-9.patch3.48 KBanil280988
#8 2608692-8.patch3.15 KBkaushalkishorejaiswal
#5 2608692-5.patch3.2 KBanil280988
#3 2608692-3.patch792 bytesheykarthikwithu
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Lars Toomre created an issue. See original summary.

heykarthikwithu’s picture

Assigned: Unassigned » heykarthikwithu
Status: Active » Needs work

Working on this.

heykarthikwithu’s picture

Assigned: heykarthikwithu » Unassigned
Status: Needs work » Needs review
FileSize
792 bytes

Added @param and @return to the function.

Lars Toomre’s picture

Status: Needs review » Needs work

Thanks 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.

anil280988’s picture

Status: Needs work » Needs review
FileSize
3.2 KB

Added new patch

heykarthikwithu’s picture

Issue tags: +rc eligible, +Quick fix
jhodgdon’s picture

Status: Needs review » Needs work
Issue tags: -rc eligible, -Quick fix

Thanks for the patches and reviews! Sorry for my not reviewing sooner; I've been on vacation...

Anyway, this latest patch still needs some work:

  1. +++ b/core/modules/book/src/BookManager.php
    @@ -618,6 +618,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *   - expanded: An array of parent link ids to return only book links that
    

    ids => IDs

  2. +++ b/core/modules/book/src/BookManager.php
    @@ -618,6 +618,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *     are children of one of the plids in this list. If empty, the whole
    

    don't use "plids" in docs text. Write out "parent link IDs" instead.

  3. +++ b/core/modules/book/src/BookManager.php
    @@ -618,6 +618,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *     outline is built, unless 'only_active_trail' is TRUE.
    

    Well it looks like also max_depth can affect whether the whole outline is built, right?

  4. +++ b/core/modules/book/src/BookManager.php
    @@ -618,6 +618,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *   - active_trail: An array of nids, representing the coordinates of the
    

    nids => node IDs

    And ... coordinates??!?

  5. +++ b/core/modules/book/src/BookManager.php
    @@ -618,6 +618,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *     trail. This option is ignored, if 'expanded' is non-empty.
    

    remove the comma

  6. +++ b/core/modules/book/src/BookManager.php
    @@ -618,6 +618,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *     Defaults to 1, which is the default to build a whole tree for a book.
    

    Redundant wording here. Tighten up.

  7. +++ b/core/modules/book/src/BookManager.php
    @@ -618,6 +618,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *   Return array of menu trees.
    

    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?

  8. +++ b/core/modules/book/src/BookManager.php
    @@ -930,6 +950,9 @@ public function bookTreeCheckAccess(&$tree, $node_links = array()) {
    +   * ¶
    

    extra space on line end. Set up your editor to remove these or at least highlight them.

  9. +++ b/core/modules/book/src/BookManager.php
    @@ -1010,6 +1033,20 @@ protected function buildBookOutlineData(array $links, array $parents = array(),
    +   * ¶
    

    extra space on line end

  10. +++ b/core/modules/book/src/BookManager.php
    @@ -1010,6 +1033,20 @@ protected function buildBookOutlineData(array $links, array $parents = array(),
    +   * ¶
    

    extra space

  11. +++ b/core/modules/book/src/BookManager.php
    @@ -1010,6 +1033,20 @@ protected function buildBookOutlineData(array $links, array $parents = array(),
    +   *   Return array of menu trees.
    

    I doubt it is an array of trees, should just be one tree?

  12. +++ b/core/modules/book/src/BookManager.php
    @@ -1010,6 +1033,20 @@ protected function buildBookOutlineData(array $links, array $parents = array(),
    +   * ¶
    

    extra space

kaushalkishorejaiswal’s picture

Status: Needs work » Needs review
FileSize
3.15 KB

Status: Needs review » Needs work

The last submitted patch, 8: 2608692-8.patch, failed testing.

anil280988’s picture

Status: Needs work » Needs review
FileSize
3.48 KB

Hi,
Created patch.

Status: Needs review » Needs work

The last submitted patch, 10: 2608692-9.patch, failed testing.

snehi’s picture

  1. +++ b/core/modules/book/src/BookManager.php
    @@ -1009,6 +1032,20 @@ protected function buildBookOutlineData(array $links, array $parents = array(),
    +   * ¶
    

    Extra Space

  2. +++ b/core/modules/book/src/BookManager.php
    @@ -1009,6 +1032,20 @@ protected function buildBookOutlineData(array $links, array $parents = array(),
    +   * ¶
    

    Extra Space

  3. +++ b/core/modules/book/src/BookManager.php
    @@ -1009,6 +1032,20 @@ protected function buildBookOutlineData(array $links, array $parents = array(),
    +   * ¶
    

    Extra Space

r_sharma08’s picture

Status: Needs work » Needs review
FileSize
5.32 KB
3.32 KB

Corrected and applied patch. Please review.

jhodgdon’s picture

Title: Revise docblock for BookManger->doBookTreeBuild() » Revise docblock for BookManger methods
Status: Needs review » Needs work

Thanks! Getting better but still needs some work:

  1. +++ b/core/modules/book/src/BookManager.php
    @@ -586,15 +586,15 @@ protected function buildItems(array $tree) {
    +   *   - active_trail: An array of node IDs, representing the coordinates of
    

    What are coordinates?

  2. +++ b/core/modules/book/src/BookManager.php
    @@ -617,6 +617,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   * @param array $parameters
    +   *   (optional) An associative array of build parameters. Possible keys:
    +   *   - expanded: An array of parent link ids to return only book links that
    

    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!

  3. +++ b/core/modules/book/src/BookManager.php
    @@ -617,6 +617,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *     are children of one of the plids in this list. If empty, the whole
    

    plids => parent link IDs

  4. +++ b/core/modules/book/src/BookManager.php
    @@ -992,7 +1015,7 @@ public function bookLinkTranslate(&$link) {
    +   *     'in_active_trail' (TRUE if the link ID was in $parents)
    

    Needs to end in .

  5. +++ b/core/modules/book/src/BookManager.php
    @@ -1009,6 +1032,20 @@ protected function buildBookOutlineData(array $links, array $parents = array(),
    +   *   Return a menu tree.
    

    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".

anil280988’s picture

Status: Needs work » Needs review
FileSize
4.85 KB

Hi jhodgdon,
Added Patch. For #2 kindly tell if more changes are required

jhodgdon’s picture

Status: Needs review » Needs work

Thanks 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:

  1. +++ b/core/modules/book/src/BookManager.php
    @@ -583,18 +583,18 @@ protected function buildItems(array $tree) {
    +   *   - active_trail: An array of node IDs, representing the currently active
    +   *      book link.
    

    The second line here should be indented 1 space less.

  2. +++ b/core/modules/book/src/BookManager.php
    @@ -583,18 +583,18 @@ protected function buildItems(array $tree) {
    +   *     Defaults to 1, which is to build a whole tree for a book.
    

    a book => the book
    a whole tree => the whole tree

  3. +++ b/core/modules/book/src/BookManager.php
    @@ -617,6 +617,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *   (optional) An associative array of build parameters. Possible keys:
    +   *   - expanded: An array of parent link ids to return only book links that
    +   *     are children of one of the parent link IDs in this list. If empty,
    +   *     the whole outline is built, unless 'only_active_trail' is TRUE.
    +   *   - active_trail: An array of nids, representing the coordinates of the
    +   *     currently active book link.
    +   *   - only_active_trail: Whether to only return links that are in the active
    +   *     trail. This option is ignored, if 'expanded' is non-empty.
    +   *   - min_depth: The minimum depth of book links in the resulting tree.
    +   *     Defaults to 1, which is the default to build a whole tree for a book.
    +   *   - max_depth: The maximum depth of book links in the resulting tree.
    +   *   - conditions: An associative array of custom database select query
    +   *     condition key/value pairs; see _menu_build_tree() for actual query.
    

    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.

  4. +++ b/core/modules/book/src/BookManager.php
    @@ -617,6 +617,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *   Tree of a book.
    

    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?

r_sharma08’s picture

Thanks @jhodgdon for your valuable comments and suggestions.
Patch attached for review.

Status: Needs review » Needs work

The last submitted patch, 17: interdiff-2608692-15-17.patch, failed testing.

snehi’s picture

Status: Needs work » Needs review
  1. +++ b/core/modules/book/src/BookManager.php
    @@ -583,18 +583,18 @@ protected function buildItems(array $tree) {
    +   *   The ID of the book that we are building the tree for.
    

    Please don't use we, them, those etc.

  2. +++ b/core/modules/book/src/BookManager.php
    @@ -583,18 +583,18 @@ protected function buildItems(array $tree) {
    +   *     Defaults to 1, which is to build a whole tree for a book.
    

    which build a tree for a book.
    How's it ?
    Don't know what jhodgodon says about it.

  3. +++ b/core/modules/book/src/BookManager.php
    @@ -617,6 +617,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *   The ID of the book that we are building the tree for.
    

    See 1st one comment.

  4. +++ b/core/modules/book/src/BookManager.php
    @@ -617,6 +617,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *     currently active book link.
    

    currently really ?

  5. +++ b/core/modules/book/src/BookManager.php
    @@ -617,6 +617,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *     Defaults to 1, which is to build the whole tree for the book.
    

    Please see my second comment.

  6. +++ b/core/modules/book/src/BookManager.php
    @@ -617,6 +617,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *   An array with links representing the tree structure of the book.
    

    of the book
    OR
    of a book.
    Use same wording on similar lines.

  7. +++ b/core/modules/book/src/BookManager.php
    @@ -929,6 +949,9 @@ public function bookTreeCheckAccess(&$tree, $node_links = array()) {
    +   *   The book tree you wish to operate on.
    

    You wish ???

snehi’s picture

Status: Needs review » Needs work
r_sharma08’s picture

updated patch attached.Please review.

anil280988’s picture

Status: Needs work » Needs review
snehi’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/book/src/BookManager.php
    @@ -618,14 +618,14 @@
    +   *   The ID of the book that are used to build the tree for.
    

    s/are/is

  2. +++ b/core/modules/book/src/BookManager.php
    @@ -618,14 +618,14 @@
    +   *     active book link.
    

    Not sure about this.

  3. +++ b/core/modules/book/src/BookManager.php
    @@ -635,7 +635,7 @@
    +   *   An array with links representing the tree structure of a book.
    

    use "the book" everywhere.

  4. +++ b/core/modules/book/src/BookManager.php
    @@ -951,7 +951,7 @@
    +   *   The book tree which have to operate on.
    

    The book tree to operate on.

snehi’s picture

Assigned: Unassigned » snehi
snehi’s picture

Assigned: snehi » Unassigned
Status: Needs work » Needs review
FileSize
1.41 KB
4.89 KB
jhodgdon’s picture

Status: Needs review » Needs work

Thanks for all the patches and reviews!

But there are *still* problems with this patch:

  1. +++ b/core/modules/book/src/BookManager.php
    @@ -583,18 +583,18 @@ protected function buildItems(array $tree) {
    -   *   The Book ID to find links for.
    +   *   The ID of the book that are used to build the tree for.
    

    This is garbled and ungrammatical. The original line is much clearer.

  2. +++ b/core/modules/book/src/BookManager.php
    @@ -617,6 +617,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *   The ID of the book that are used to build the tree for.
    

    See above note.

  3. +++ b/core/modules/book/src/BookManager.php
    @@ -617,6 +617,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   * @param array $parameters
    +   *   (optional) An associative array of build parameters. Possible keys:
    +   *   - expanded: An array of parent link IDs to return only book links that
    +   *     are children of one of the parent link IDs in this list. If empty,
    +   *     the whole outline is built, unless 'only_active_trail' is TRUE.
    +   *   - active_trail: An array of node IDs, representing the coordinates of the
    +   *     active book link.
    +   *   - only_active_trail: Whether to only return links that are in the active
    +   *     trail. This option is ignored if 'expanded' is non-empty.
    +   *   - min_depth: The minimum depth of book links in the resulting tree.
    +   *     Defaults to 1, which is to build the whole tree for the book.
    +   *   - max_depth: The maximum depth of book links in the resulting tree.
    +   *   - conditions: An associative array of custom database select query
    +   *     condition key/value pairs; see _menu_build_tree() for actual query.
    

    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?

  4. +++ b/core/modules/book/src/BookManager.php
    @@ -929,6 +949,9 @@ public function bookTreeCheckAccess(&$tree, $node_links = array()) {
    +   *   The book tree which have to operate on.
    

    This is garbled and ungrammatical.

snehi’s picture

Status: Needs work » Needs review
FileSize
2.5 KB
4.7 KB

Hi @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.

jhodgdon’s picture

Status: Needs review » Needs work

Thank 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:

+++ b/core/modules/book/src/BookManager.php
@@ -617,6 +617,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
+   *   An array with links representing the tree structure of a book.

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]

snehi’s picture

Status: Needs work » Needs review
FileSize
593 bytes
4.7 KB

Thanks 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 .

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! Looks fine now.

catch’s picture

Title: Revise docblock for BookManger methods » Revise docblock for BookManager methods
alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/book/src/BookManager.php
@@ -617,6 +617,26 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    * @see menu_build_tree()

Let'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()

jhodgdon’s picture

Good idea. Whoever makes the next patch, remember to put the full namespace on the class when you do this.

anil280988’s picture

Status: Needs work » Needs review
FileSize
4.82 KB
630 bytes

Hi alexpott/jhodgdon,
Replaced menu_build_tree(). Kindly suggest if any other changes are required.

Manjit.Singh’s picture

Status: Needs review » Reviewed & tested by the community

Changes that suggested in #32are there in #34. Looks good now.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/book/src/BookManager.php
@@ -884,7 +904,7 @@ protected function updateOriginalParent(array $original) {
+   *   The book link to update. It is passed by reference to setParents().

Sorry I should have noticed this before - it should be self::setParents() and there should be an @see with a fqdn link

ashhishhh’s picture

Assigned: Unassigned » ashhishhh
ashhishhh’s picture

Assigned: ashhishhh » Unassigned
Status: Needs work » Needs review
FileSize
4.96 KB
656 bytes

Addressed #36 in this patch.
Thanks

no_angel’s picture

Assigned: Unassigned » no_angel

I'll give it a go.

no_angel’s picture

Assigned: no_angel » Unassigned

I'll give it a go.

jhodgdon’s picture

Status: Needs review » Needs work

Thanks for the new patch! Still not quite right though...

  1. +++ b/core/modules/book/src/BookManager.php
    @@ -586,15 +586,15 @@ protected function buildItems(array $tree) {
        *     condition key/value pairs; see _menu_build_tree() for the actual query.
    

    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?

  2. +++ b/core/modules/book/src/BookManager.php
    @@ -617,7 +617,27 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *     condition key/value pairs; see _menu_build_tree() for the actual query.
    

    Same here.

  3. +++ b/core/modules/book/src/BookManager.php
    @@ -884,9 +904,11 @@ protected function updateOriginalParent(array $original) {
    +   *   The book link to update. It is passed by reference to self::setParents().
    

    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.

  4. +++ b/core/modules/book/src/BookManager.php
    @@ -884,9 +904,11 @@ protected function updateOriginalParent(array $original) {
    +   * @see \Drupal\book\BookManager::setParents()
        */
       protected function setParents(array &$link, array $parent) {
    

    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.

snehi’s picture

Assigned: Unassigned » snehi
claudiu.cristea’s picture

Assigned: snehi » Unassigned
Issue tags: +#SprintLUX2016, +SprintWeekend2016
rakesh.gectcr’s picture

Assigned: Unassigned » rakesh.gectcr
rakesh.gectcr’s picture

@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)

   *   - conditions: An associative array of custom database select query
   *     condition key/value pairs; see \Drupal::menuTree( ); for the details.

3)

/**
   * Sets the p1 through p9 properties for a book link being saved.
   *
   * @param array $link
   *   The book link to update, passed by reference.

4) removed the @see

rakesh.gectcr’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 45: revise-docblock-2608692-45.patch, failed testing.

rakesh.gectcr’s picture

Status: Needs work » Needs review
FileSize
4.93 KB
claudiu.cristea’s picture

Issue tags: -#SprintLUX2016
jhodgdon’s picture

Status: Needs review » Needs work

Thanks! Still some problems to fix in this patch...

  1. +++ b/core/modules/book/src/BookManager.php
    @@ -586,18 +586,18 @@ protected function buildItems(array $tree) {
    -   *     condition key/value pairs; see _menu_build_tree() for the actual query.
    +   *     condition key/value pairs; \Drupal::menuTree( ); for the details.
    

    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...

  2. +++ b/core/modules/book/src/BookManager.php
    @@ -617,7 +617,27 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *   The Book ID to find links for.
    

    Book should not be capitalized here.

  3. +++ b/core/modules/book/src/BookManager.php
    @@ -617,7 +617,27 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *     condition key/value pairs; see \Drupal::menuTree( ); for the details.
    

    See note above about multiple problems in this line.

snehi’s picture

Status: Needs work » Needs review
FileSize
4.97 KB
1.72 KB

Please review this one.

jhodgdon’s picture

Status: Needs review » Needs work

Thanks, but:

  1. +++ b/core/modules/book/src/BookManager.php
    @@ -586,18 +586,19 @@ protected function buildItems(array $tree) {
    +   *     condition key/value pairs; see \Drupal\Core\Menu::MenuLinkTree() for
    

    This class/method does not exist, as far as I can tell. Method names never begin with capital letters anyway... Something is wrong.

  2. +++ b/core/modules/book/src/BookManager.php
    @@ -617,7 +618,28 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *     condition key/value pairs; see \Drupal\Core\Menu::MenuLinkTree() for
    

    Same here

marvin_B8’s picture

Status: Needs work » Needs review
FileSize
5.02 KB
1.23 KB
jhodgdon’s picture

Status: Needs review » Needs work

Thanks, almost!

  1. +++ b/core/modules/book/src/BookManager.php
    @@ -586,18 +586,19 @@ protected function buildItems(array $tree) {
    +   *     condition key/value pairs; see \Drupal\book\BookOutlineStorage::getBookMenuTree()
    

    Thanks for fixing this, but now this documentation line goes over 80 characters. Please rewrap.

  2. +++ b/core/modules/book/src/BookManager.php
    @@ -617,7 +618,28 @@ protected function bookTreeBuild($bid, array $parameters = array()) {
    +   *     condition key/value pairs; see \Drupal\book\BookOutlineStorage::getBookMenuTree()
    

    Here too.

marvin_B8’s picture

Status: Needs work » Needs review
FileSize
5.04 KB
1.14 KB
Manjit.Singh’s picture

@jhodgdon If i am not wrong this issue should be move into 8.1.x branch. What do you think ?

jhodgdon’s picture

Status: Needs review » Needs work

So, 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:

+++ b/core/modules/book/src/BookManager.php
@@ -598,7 +598,8 @@
+   *     condition key/value pairs; see
+   *     \Drupal\book\BookOutlineStorage::getBookMenuTree()
    *     for the actual query.

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.

imalabya’s picture

Status: Needs work » Needs review
FileSize
5.04 KB
1.86 KB

Have added a patch for the above comment.

jhodgdon’s picture

Version: 8.0.x-dev » 8.2.x-dev
Status: Needs review » Reviewed & tested by the community
Issue tags: +needs backport to 8.1.x, +needs backport to 8.0.x

Looks 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".

  • catch committed d3d0fac on 8.2.x
    Issue #2608692 by snehi, r_sharma08, anil280988, marvin_B8, rakesh....

  • catch committed f850181 on 8.1.x
    Issue #2608692 by snehi, r_sharma08, anil280988, marvin_B8, rakesh....

  • catch committed b180bd5 on 8.0.x
    Issue #2608692 by snehi, r_sharma08, anil280988, marvin_B8, rakesh....
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to all three 8.x branches, thanks!

Status: Fixed » Closed (fixed)

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