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.
Problem/Motivation
Modules are supposed to provide a Help text page, but the hook_help text of the Paragraphs Types module only says "Paragraphs".
Proposed resolution
Write a help text according to https://www.drupal.org/node/632280
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#49 | interdiff-2702561-46-49.txt | 3.21 KB | johnchque |
#49 | provide_a_hook_help_text-2702561-49.patch | 7.92 KB | johnchque |
#48 | interdiff-2702561-43-46.txt | 1.1 KB | chishah92 |
#46 | Provide_a_hook_help_text-2702561-46.patch | 7.85 KB | chishah92 |
#43 | Provide_a_hook_help_text-2702561-43.patch | 7.84 KB | ifrik |
Comments
Comment #2
dbt102 CreditAttribution: dbt102 commentedAssigning this to myself. Should have a decent patch by the end of today.
Changing category from Bug to Task (hook_help is working, the doco is shows is just not complete)
Priority from "normal" to "minor" (help is not intended to provide a substantial amount of info)
Component from UI to Code because the text needs to be put into code and submitted as a patch.
Assigned to myself, so others don't waste their time working on this issue, because I've started on it :-)
Comment #3
dbt102 CreditAttribution: dbt102 commentedComment #4
dbt102 CreditAttribution: dbt102 commentedComment #5
dbt102 CreditAttribution: dbt102 commentedHere are before and after screenshots to help review.
Comment #6
dbt102 CreditAttribution: dbt102 commentedUnassigning the task from myself so others won't shy away from testing this patch
Comment #7
ifrikThanks dbt102. The text describes the functionality provided with a good amount of detail.
However the format doesn't quite follow the Help text standard that we use for core modules. If you are okay with it, then I could just work on it a bit to make it more consistent with that and iron out a few, smaller points that I can see.
Comment #8
dbt102 CreditAttribution: dbt102 commentedThanks for the review @ifrik, and or course your help would be greatly appreciated
However, your comment is quite vague, could you be a bit more specific about what exacty does not meet the standard?
The release notes for Drupal 8.1.0 indicates an " Improved site administration experience: * Improved admin/help page to be more flexible and list tours on it."
The Help text standard (for core and contrib) gives a detailed account of how to do this the 'drupal way'.
The way I've done it elsewhere is to carefully implement each aspect (1-4) and apply patch(s) to meet the specific module's use case. We'll see how that approach works here.
Comment #9
dbt102 CreditAttribution: dbt102 commentedFollowing is my review checklist w/ comments of what is included with this patch.
1. Short description of what the module does. It is displayed on the Extend or Modules page (in Drupal 8 or 7). It is the only texts users will see if the module is not enabled yet.
^-- This was actually already in place and the format looks ok to me.
2. Description on links are displayed with the links on the Configuration and Structure pages and invite users to do something.
^-- This refers to the hover text ( or tooltip) in play when hovering over the link to /admin/structure/paragraph_type . This looks OK to me.
3. Explanations on the administration pages. Ideally this should not be needed, but if they do they are short and do not duplicate the help page.
^-- Not need in this case.
4. Help page displayed by the Help module with three sections: What does the module do, what can users do with it, and a link to the online documentation here on drupal.org. This hook_help() text is in the my_module.module file.
^-- The bulk of the work for this patch resides here. It includes the three required section with descriptive text to help user understand the particulars of this module. Also, Drupal standards call for a readme.txt file to be included with contributed projects. And, there is one for this module
Comment #10
ifrikI think the release notes for 8.1.0 refer to the page that links to all the individual help pages and that now also lists any existing tours - not to the hook_help texts themselves.
The points I noticed on a quick scan are mainly formatting and wording issues, such as structuring the uses with dt and dd tags, not referring to Drupal (because the module can be used in other distributions as well), using capitals, the wording used for linking to documentation on d.o
The item about paragraphs being fieldable could link to the Field and Field UI help pages, and I think we got some wording for that as well.
In this case it might just be faster if I edit the text accordingly (because I've worked on so many of the core module help texts) instead of spending the time to write them up in the comment. I just wanted to check first whether that's okay with you.
Comment #11
ifrikOn #9:
There is a seperate issue and a patch for the points 1-3: #2702557
The texts are certainly there, but could be edited to improve the usability for site builders.
Comment #12
dbt102 CreditAttribution: dbt102 commentedThanks @ifrik
I reviewed your patch @ #2702557: Edit UI texts for admin pages nice job there, and yes ... definately tweaking what I started here would be appreciated.
I've been targeting HELP on the modules we are using on D8 site builds. We'd like to get tours in them for our customers, but want to get decent HELP in place first. Thats why I reference the Release 8.1.0 notes
Appreciate your comments.
Comment #13
ifrikOkay, working on it.
Comment #14
ifrikI've edited the hook_help text following the default format that we used for the D8 core modules. I hope I didn't loose anything along the way.
I also formatted the links in the text according to use the proper routing.
I've also added the hook_help texts for the Paragraphs demo and Paragraphs Type Permission modules.
Comment #15
johnchqueA whitespace missing between ) and {
Extra whitespace.
Indentation.
Comment #16
NitinSP CreditAttribution: NitinSP at Clarion Technologies commentedComment #17
NitinSP CreditAttribution: NitinSP at Clarion Technologies commentedI have added hook_help() with appropriate information, please apply and test this patch.
Comment #18
ifrikHi NitinSP,
is there a particular reason why you disregarded the patch that I provided in #14?
Comment #19
ifrikThanks yongt9412,
Sorry, it looks like I paid more attention to content standards then to coding standards.
I removed the empty lines between comments and functions, removed a trailing whitespace and fixed the indentation.
dbt102,
What do you think about the changes that I made to your wording? Did I miss anything?
Comment #20
ifrikComment #21
johnchqueLooks better to me now but I would like to get more feedback.
Comment #22
tduong CreditAttribution: tduong at MD Systems GmbH commented[and more...]
Please don't use Drupal::url(...), since it is deprecated. Use Url::fromRoute(...)->toString() instead.
Comment #23
dbt102 CreditAttribution: dbt102 commented@ifrik wrt #19
I think the wording definately moved this patch forward, nice job on that
@yongt9412 wrt #21
I agree with you @yongt9412 looks like @ifrik's #19 patch cleaned up the whitespace errors you identified
@tduong wrt #22
guess I'm confused about this comment, the HELP standard were are addressing is here -->https://www.drupal.org/node/632280
on that page there is a section "Drupal 8 note about url() and routing"
??? The way I understand this, @ifrik has followed the standard ???
Comment #24
ifrikThanks tduong, thanks dbt102,
tduong, can you point me to the issue or so that depriciated Drupal::url() ?
I'm happy to change it - and update the help text standard page as well.
Comment #25
tduong CreditAttribution: tduong at MD Systems GmbH commentedI guess that needs to be updated ^^'
I pointed out them yesterday but saw that the comment was too long, so I've truncated it. Basically you need to update the deprecated Drupal::url() each time you put the link to the a-tag with a route name. In details you have:
paragraphs.module
: 2 calls for help.page, 2 for entity.paragraphs_type.collection and 1 for paragraphs.prepare_uninstallparagraphs_demo.module
: 3 calls for help.page and 2 calls for entity.paragraphs_type.collectionparagraphs_type_permissions.module
: 1 call for help.page and 1 for user.admin_permissionsFurthermore, please also switch the
array()
to its shortened syntax[]
according to the array standard coding.And...
double space :P
Btw, I was wondering if it would be better if we start to initialise
$output = '';
outside theswitch
control structure and placereturn $output;
at the end of the hook_help method (?) also to avoid a "missing return statement" when you do an "inspect code" of the module...But this is just my opinion. For now let's fix the remaining things here, and commit nice help pages for Paragraphs! :D
Comment #26
ifrikThanks,
I'll do that.
Comment #27
dbt102 CreditAttribution: dbt102 commented@ifrik @tduong thanks for you comments
yep, looks like the the Help text standard (for core and contrib) needs to be update per the "Deprecated" notice on public static function Drupal::url
Comment #28
ifrikThanks, I've changed the Drupal::url and used the shortened syntax for arrays.
I've also deleted a double space at two places.
Comment #29
tduong CreditAttribution: tduong at MD Systems GmbH commentedStill needs work:
you still have 2
array()
to be shortened in paragraphs.module. And typo: "Adminstrators".Typo: "Adminstrators".
2 typos: "permissons".
what happened ? it was fine as before :)
Otherwise looks fine to me :)
Comment #30
ifrikThanks, I'll do that as well.
Comment #31
ifrikFixed the two arrays and the typing errors.
The white space in 4. probably sneaked in there by accident when I was struggling with my new vim setup.
Comment #32
loopduplicateThese lines should only be indented 2 spaces, right?
Comment #33
loopduplicateHere's a patch with the change I suggested in #32.
Regards,
loop
Comment #34
dbt102 CreditAttribution: dbt102 commentedI applied -32.patch by @ifrik to fresh git clone of --branch 8.x-1.x. It applied cleanly.
I did a visual review of the code to compare -32.patch to another local install patched with the -19.patch. I was interested to learn URL:: and the shortened syntax for the array. I clicked thru all links and read all revised content. It looks good to me.
Thanks for the work on this @ifrik, and for your keen reviews @tdoung. For me, it will provide a good model reference for HELP updates on other core/contrib modules moving forward.
wrt -33.patch by @loopduplicate ... imo ... guess that seems out of scope for this issue, but I guess cleanup of comment spacing is not a bad thing
Comment #35
loopduplicate"guess that seems out of scope for this issue, but I guess cleanup of comment spacing is not a bad thing"
The patch in #33 leaves the comment alone. The patch in #31 altered the comment and put in extra space.
Regards,
loop
Comment #36
tduong CreditAttribution: tduong at MD Systems GmbH commentedYes, until #31 that indentation has been added probably by mistake (as @ifrik wrote, it was probably for his new vim setup). In #33 it has just been reverted as it is on the branch now, so on commit those lines won't be changed, thus "no unrelated changes", just a healthy "patch cleanup" ;)
Comment #37
dbt102 CreditAttribution: dbt102 commentedoooo ... my bad .... so, nice catch @loopduplicate, I didn't pick up on that
Comment #38
ifrikThanks for cleaning up the code further.
Just a short note on consistency and naming patches: If you work further on an existing patch, then it is better to keep the existing patch name - even if you would prefer a different name.
That way it is clear to everybody that this a continuation of the previous work and not a new patch started all over again.
Comment #39
jhodgdonThis help has some problems actually:
This should instead say:
Implements hook_help().
paragraphs types -> paragraph types
paragraphs types -> paragraph types
provide -> provided
paragraphs types -> paragraph types
paragraphs types -> paragraph types
This should say:
Implements hook_help().
What is the real name of this module? I guess it is probably
Paragraph Type Permissions
? Make sure it matches here what is in the .info.yml file.
Also
configure permission -> configure permissions
paragraphs type -> paragraph type
paragraphs type -> paragraph type
Also there should be a comma before and
paragraphs types -> paragraph types
I am getting tired of typing this... please make this fix in the rest of the patch.
This is not grammatical
We don't tell how to uninstall any other similar modules. We should really just drop this.
Comment #40
jhodgdonOh sorry. I was led here by a Drupal Core issue and didn't realize this was a separate module until after that review.
You can ignore me... although I think it would be good if the grammar and standards were cleaned up as suggested there, you can do as you wish in your contrib module. Sorry about intruding!
Comment #41
johnchqueThanks @jhodgdon for the feedback. I am wondering what should be done since the original module is called "Paragraphs" and "Paragraphs types permissions" is a sub module of it. IMHO it looks like a grammar mistake but is because the sub module name is based on the module name. What do you suggest?
Comment #42
ifrikThanks jhodgon,
for reviewing this anyway.
I had been stumbling over the plural in "Paragraphs types" as well, but unfortunately that's what's used in the UI as well so that. (I might make another issue to improve that as well... :-) .
This contrib module has an page that let's the user clear up all the existing fields, so therefore that page should be documented. Without that specific page, I also would have left it out.
I'm fixing the rest of the points raised.
Comment #43
ifrikI fixed the comment about implementing hook_help, and the typos as pointed out in #39
I'm also returning to the original patch name.
Comment #44
johnchqueThis should be changed to: Implements hook_help().
Comment #45
chishah92 CreditAttribution: chishah92 at Blisstering Solutions commentedComment #46
chishah92 CreditAttribution: chishah92 at Blisstering Solutions commentedadded a patch with fixes regarding the issues mentioned in #44
Thanks!
~Chirag
Comment #47
johnchquePlease also provide an interdiff with your changes.
Comment #48
chishah92 CreditAttribution: chishah92 at Blisstering Solutions commentedThe interdiff for the previous patch
Comment #49
johnchqueThanks everyone for such amazing patches, few small things that we needed to change. :)
Comment #50
tduong CreditAttribution: tduong at MD Systems GmbH commentedPersonally I don't see the point writing this, I mean.. it is clear.. but this is also used e.g. in
image_widget_crop
anddropzonejs
...Otherwise I would set it as RTBC ;)
Comment #51
tduong CreditAttribution: tduong at MD Systems GmbH commentedI think is fine anyway...
Comment #52
miro_dietikerCommitted. Finally, the user isn't left alone and has some help. .-)
We can always improve in small follow-ups.
Comment #54
ifrikThanks a lot!
Now I'm happy to use this positive experience as as example in my DevDays talk.
Comment #55
chishah92 CreditAttribution: chishah92 at Blisstering Solutions commentedComment #56
dbt102 CreditAttribution: dbt102 commented+1
Great job everyone on this, especially @ifrik for you persitance and grace in responding to numerous comment/reviews. It represents a lot of work on such a 'minor' task but has led to good discussion on some larger issues wrt core and HELP standards. Some are tagged below for future reference.
#2731835: Fix all hook function bodies so that their example code uses [] instead of array() syntax.
#2731817: Replace all calls to the deprecated Drupal::url() function in Core