Needs work
Project:
Drupal core
Version:
main
Component:
documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Apr 2016 at 07:59 UTC
Updated:
17 Aug 2024 at 14:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
xanoComment #3
dawehnerNice, this improves the documentation!
Comment #4
alexpottI dunno perhaps we should improve this at the same time because tbh this is not much better than no documentation.
Comment #5
xanoSee the related issue #2712367: Extend EntityTypeBundleInfoInterface's docblocks and make them more explicit.
Comment #6
alexpott@Xano imo this issue should just be merged into that one that. It's all the same scope to me.
Comment #7
xanoI've been told off for scope creep when it comes to documentation several times now, and I fail to see consistency in the reasons I've been given. These issues actually come from another in which that happened. I don't feel much for doing it differently again, to be honest.
Comment #8
xjmThanks @Xano for keeping patch sizes manageable and for fixing this documentation inconsistency.
In the case of these issues, I think a single patch is best because one is not really complete without the other -- they are all a part of fixing the same conceptual gap in the docs about the bundle info array. When we split patches up, it should be because they are different concepts, or because they are unmanageably large. https://www.drupal.org/core/scope#examples gives examples. In this case it's confusing because one of the issues removes documentation, another adds it back in a different place, and a third adds a reference to that documentation in a third place. This makes it so that reviewers cannot actually see the whole picture of what's being fixed.
Attached combines this with #2712367: Extend EntityTypeBundleInfoInterface's docblocks and make them more explicit and #2712373: Improve hook_entity_bundle_info()'s and hook_entity_bundle_info_alter()'s docblocks. The interdiff shows changes I did not include from the combination of all three issues, because those should just be part of #2571965: [meta] Fix PHP coding standards in core, stage 1. Let's review this one as a whole.
Comment #9
xjmHeh except I did not actually exclude what I said I did. ;) Attached does.
Comment #10
jhodgdonThanks for the patch! I have no opinion on what should and shouldn't be in this patch, but I do have opinions on the documentation in the patch (which is mostly great). A few small things to address:
This is very clear, except that we normally want to start the @return docs with a description of what is returned, like what was in here before: "An array of all bundle information." Or better yet: "An associative array of all bundle information, where the keys are... and the values are...".
See note above.
Isn't uri_callback deprecated?
boolean => Boolean
Another (perhaps clearer) way to write this would be:
TRUE if the bundle has translation support; FALSE (default) if not.
See not above about the start of @return docs.
And here too.
Comment #11
xanoWhy is this done? It duplicates information from the one-line summary and the type hint.
Comment #12
jhodgdonOur documentation is normally written in English, and the description of the return value normally starts by stating what the function returns. Why is this so much of a problem to ask that the way it was already documented is not removed, but added to?
Comment #13
xanoNo problem at all. I was just curious why you gave the feedback you did as I was not familiar with the documentation standard that requires us to write this way, and the duplication sounded unnecessary to me.
Comment #14
jhodgdonThanks! This looks pretty good. I have a few suggestions for improvement:
@var doesn't have a description, so this text should go above.
This is correct, but a little bit hard to read.
Suggest something like:
An associative array of bundle information. In the outer array, the keys are ... and the values are arrays whose keys are ... and whose values are ...
of which -> whose
So, uri_callback is deprecated for entities. Is this normally even in here?
Comment #15
xanoWhere is the deprecation notice? I'd say
EntityTypeInterface::getUriCallback()is the part of the API responsible for these callbacks, and it does not mention deprecation. Even if it is deprecated, it is officially supported and should therefore be documented.Comment #16
jhodgdonAh. Issue not done yet, apparently:
#2667040: Deprecate uri_callback in routes for entities
Comment #17
xanoRe-roll because of duplicate issue #2720077: EntityTypeBundleInfo::getBundleInfo() @return needs more detail, and incorporating the feedback from #14.
The dictionaries do not seem to agree on this one, especially because whose traditionally is for living subjects only. I corrected it as @jhodgdon requested, but there does not seem to be a universal correct way of writing this.
Comment #27
ranjith_kumar_k_u commentedRe-rolled for 9.2
Comment #30
srilakshmier commentedI am working on it.
Comment #31
srilakshmier commentedFixed the error from #27, attaching the patch.
Comment #32
joachim commentedLooks like a good docs clean-up!
Just a couple of points:
Should be array[], since it's always an array of arrays?
What does it mean for a return value to be optional? Does it mean that the 'translatable' key might sometimes not be there at all?
If that is the case, then the docs should say what it means if it's not there. Presumably it's the same as FALSE?
Comment #33
srilakshmier commentedI will work on this.
Comment #34
srilakshmier commentedThanks for the feedback @joachim.
Point 1- Has been addressed and uploading the patch.
Point 2: This has been already addressed:
Please review.
Thanks
Comment #35
joachim commentedThanks!
However, this still says 'optional' in a return description.
What does it mean to say part of a return array is optional?
Comment #39
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #40
nikhil_110 commentedAttached patch against drupal 10.1.x
Comment #44
bharath-kondeti commented@joachim translatable key is set, only if the language modules are enabled and setup. Maybe that's the reason its marked optional.
Comment #45
bharath-kondeti commentedComment #46
smustgrave commentedDid a small review but don't think the MR was reviewed before being put into review as it contains tons of out of scope changes. Also this was a documentation change with code changes now.