Problem/Motivation

#3041924: [META] Convert hook_help() module overview text to topics for the basic_auth, hal, jsonapi, rdf, rest, and serialization modules.

NOTE: What is below is the generic instructions for converting hook_help to topics. We want to end up with task-based topics; in this case, there really aren't "tasks" per se for these modules. So let's just make one topic called something like "Enabling web services on your site" with a filename starting with "core." (so it is not in one module's namespace), and describe what web services are, and what each of these 5 web services modules does.

Proposed resolution

Take the information that is currently in the hook_help module overview section for the module(s), and make sure the information is in one or more Twig help topic files. Steps:

  1. Find the hook_help() implementation function in the core/modules/MODULENAME/MODULENAME.module file(s). For example, for the core RDF module, the module files is core/modules/rdf/rdf.module, and the function is called rdf_help().
  2. Locate the module overview portion of this function. This is located just after some lines that look something like this:
      switch ($route_name) {
        case 'help.page.contact':
    

    And ends either at the end of the function, or where you find another case 'something': line.

  3. We want to end up with one or more topics about the tasks that you can do with this module, and possibly a section header topic. So, read the help and figure out a good way to logically divide it up into tasks and sections. See Standards for Help Topics for information on how to do this.
  4. See if some of these tasks are already documented in existing topics. Currently, all topics are in core/modules/help_topics/help_topics. Note that to see existing topics, you will need to enable the experimental Help Topics module (available in the latest dev versions of Drupal 8.x).
  5. For each task or section topic that needs to be written, make a new Twig topic file (see Standards for Help Topics) in core/modules/help_topics/help_topics. You will need to choose the appropriate module prefix for the file name -- the module that is required for the functionality. Alternatively, if the information spans several modules or if the information should be visible before the module is installed, you can use the "core" file name prefix. For instance, it might be useful to know that to get a certain functionality, you need to turn on a certain module (so that would be in the core prefix), but then the details of how to use it should only be visible once that module is turned on (so that would be in the module prefix).
  6. File names must be MODULENAME.TOPICNAME.html.twig -- for example, in the RDF module, you could create a topic about managing actions with filename rdf.overview.html.twig (and "MODULENAME" can be "core" as discussed above).
  7. Make a patch file that adds/updates the Twig templates. The patch should not remove the text from the hook_help() implementation (that will be done separately).

Remaining tasks

a) Make a patch (see Proposed Resolution section).

b) Review the patch:

  1. Apply the patch.
  2. Turn on the experimental Help Topics module in your site, as well as the module(s) listed in this issue.
  3. Visit the page for each topic that is created or modified in this patch. The topics are files in the patch ending in .html.twig. If you find a file, such as core/modules/help_topics/help_topics/rdf.overview.html.twig, you can view the topic at the URL admin/help/topic/rdf.overview within your site.
  4. Review the topic text that you can see on the page, making sure of the following aspects:
    • The text is written in clear, simple, straightforward language
    • No grammar/punctuation errors
    • Valid HTML -- you can use http://validator.w3.org/ to check
    • Links within the text work
    • Instructions for tasks work
    • Adheres to Standards for Help Topics [for some aspects, you will need to look at the Twig file rather than the topic page].
  5. Read the old "module overview" topic(s) for the module(s), at admin/help/MODULENAME. Verify that all the tasks described in these overview pages are covered in the topics you reviewed.

User interface changes

Help topics will be added to cover tasks currently covered in modules' hook_help() implementations.

API changes

None.

Data model changes

None.

Release notes snippet

None.

Comments

James.Shee created an issue. See original summary.

petedussin’s picture

Status: Postponed » Needs review
StatusFileSize
new1.28 KB

Created patch at Drupalcon 2019! Copied content from hook_help

Andy Farmer’s picture

Hi @DrupalCon19 and I am going to review this patch now

petedussin’s picture

StatusFileSize
new2.18 KB

Updated to fix typo.

petedussin’s picture

StatusFileSize
new2.18 KB

Changed opening line of text so "the" not updated.

aburrows’s picture

Reviewing and testing with my mentoree @Andy Farmer

petedussin’s picture

StatusFileSize
new1.28 KB

Replacing older patches that accidentally committed changes from parent issue patch

benjifisher’s picture

Thanks to

  • @James.Shee for creating the issue
  • @petedussin for the patches
  • @aburrows and @Andy Farmer for reviewing!
eojthebrave’s picture

We're going to need a better way to deal with the link to the Rest modules help page. The issue right now is that the link isn't going to work if the Rest module isn't enabled. The link will render appropriately, but when you click it you'll get a 404. This is handled in the current hook_help implementation by using the module service to check if the Rest module is enabled before linking to it.

(\Drupal::moduleHandler()->moduleExists('rest')) ? \Drupal::url('help.page', ['name' => 'rest']) : '#'])

There's not really a Twig friendly way of doing this. It's mentioned in this issue https://www.drupal.org/project/drupal/issues/3027054#comment-12934232 but without a method to resolve it yet.

petedussin’s picture

StatusFileSize
new1.28 KB

Removed escape for apostrophe. Works without it.

jhodgdon’s picture

Status: Needs review » Postponed

We need to postpone this until the #2920309: Add experimental module for Help Topics gets committed. No idea when/if that might happen right now...

jhodgdon’s picture

Status: Postponed » Needs review

That issue was committed, so we can un-postpone this now!

jhodgdon’s picture

Title: Convert basic_auth module hook_help() to topic(s) » Convert basic_auth, hal, jsonapi, rdf, rest, serialization module hook_help() to topic(s)
Issue summary: View changes
Status: Needs review » Needs work

We're adding some more modules to this issue. So, it needs more in the patch. I haven't reviewed the existing patch yet. None of the other modules were started yet.

jhodgdon’s picture

Regarding linking to the module help pages, the answer is don't do it! Those links were for when we had module overview help pages, and we will not have them any more. So if you mention another module, just say something like

the core Node module

and don't make it a link.

jhodgdon’s picture

Issue summary: View changes

Updated issue summary with better instructions/guidelines

jhodgdon’s picture

Issue summary: View changes

And one more iteration on the guidelines.

jhodgdon’s picture

Issue summary: View changes

We've migrated the help topic standards to https://www.drupal.org/docs/develop/documenting-your-project/help-topic-... so updating issue summary again.

gaurav.kapoor’s picture

Assigned: Unassigned » gaurav.kapoor
gaurav.kapoor’s picture

Status: Needs work » Needs review
StatusFileSize
new10.01 KB

I have added overviews for newly added modules in this issue. Please review and add feedbacks. Thanks!. Not adding an interdiff as the difference in the patches is only addition of overview for new modules. I haven't changed anything in basic auth overview.

gaurav.kapoor’s picture

jhodgdon’s picture

Status: Needs review » Needs work

Thanks for the patch... But please read the instructions in the issue summary. We do not want module overview topics at all. What we want is task-oriented topics.

volkswagenchick’s picture

Issue tags: +badcamp2019

Tagging for badcamp2019, thanks! (October 2-5)

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

jhodgdon’s picture

Issue summary: View changes

We just found out that all topic Twig files currently need to go into core/modules/help_topics/help_topics (with their finalized module-based file names), for the time being until the Help Topics module is stable. Updating issue summary. Patch will need to be updated too.

mradcliffe’s picture

Issue tags: +Amsterdam2019

Tagging for DrupalCon Amsterdam 2019

mradcliffe’s picture

I am going to help mentor a table at Amsterdam 2019 to work on moving this issue forward.

havran’s picture

Hi, my name is Juraj Chlebec and i would like work on patch to this issue :)

pminf’s picture

I'm taking screenshots of the patch results to check if the solution is working.

vitor faria’s picture

I'm Vitor and I am at the DrupalCon Amsterdam 2019 and I am going to write a patch for this issue

christian.gerdes’s picture

Hi, I'm Christian, I'm @ DrupalCon2019 in Amsterdam and I'm trying to Review the issue.

ChrisBee’s picture

Hi i'm Christopher Braun and i will apply and test the patch.

joycelam’s picture

Hi I'm Joyce and I'll be helping testing/reviewing the patch.

mradcliffe’s picture

@vladigor is also participating and pairing with Vitor here at Amsterdam2019. They do not have a laptop.

havran’s picture

StatusFileSize
new9.92 KB

I create patch which move files to core/modules/help_topics/help_topics and fix metadata.

havran’s picture

Status: Needs work » Needs review
vitor faria’s picture

StatusFileSize
new17.94 KB

Interdiff of previous patch with current patch

ChrisBee’s picture

Checked Path and Interdiff.

Topic Twig files where created for modules basic_auth, hal, jsonapi, rdf, rest, serialization in core/modules/help_topics/help_topics.

Great work!

ChrisBee’s picture

There is an error in the Topic Twig for rdf. Label is "basic Auth" but should be RDF.

christian.gerdes’s picture

During Review of #34 I expected the following Issues:
HTTP Basic-Auth Help Page Shows RDF Help Page Content if Basic Auth isn't enabled:
If you click on Help in the Menu Bar and after that on "HTTP Basic Auth", it points you to "/admin/help/topic/rdf.overview".
Probably this is caused by a wrong label in rdf.overview.html.twig

joycelam’s picture

StatusFileSize
new65.46 KB

Hi, thanks for the patch.

In the admin/help, the link to 'HTTP Basic Authentication' is displayed twice. See also screenshot.

One link goes to the HTTP Basic Authentication(admin/help/topic/basic_auth.overview), the other link goes to the RDF(/admin/help/topic/rdf.overview).

joycelam’s picture

Status: Needs review » Needs work
vitor faria’s picture

Status: Needs work » Needs review
StatusFileSize
new9.81 KB
new2.16 KB

Fix for some minor issues in patch #34 also made by Havran

Removed meta tags to be consistent with other help topics from HAL topic and also removed a "." typo.

Changed label for RDF help topic as well.

Also uploaded interdiff from previous patch

joycelam’s picture

StatusFileSize
new72.8 KB

Thanks for the new patch! The label was changed and we can now see the difference between HTTP Basic Auth and RDF. Everything worked as we expected.

screenshot

joycelam’s picture

Status: Needs review » Reviewed & tested by the community
joycelam’s picture

Issue summary: View changes

I updated the summary a little bit to be coherent with the modules we are using.

OanaIlea’s picture

StatusFileSize
new9.81 KB
new2.19 KB

The previous patch had no functionality issues but a typo in 'JSON:API'. #42

_m’s picture

I am reviewing #46 at Amsterdam2019

_m’s picture

Confirmed that the spelling correction is present. Still RTBC.

mradcliffe’s picture

Assigned: gaurav.kapoor » Unassigned
Status: Reviewed & tested by the community » Needs review

Thank you for all the thorough screenshots, reviews and patches. The contributors here found a couple of bugs in the initial patch, and fixed them. The patch in #46 will create the help topic files within the help topic module instead of their respective core modules.

Good job, everyone working on the issue today at DrupalCon Amsterdam 2019: oanailea, joyceCY, ChrisBee, christian.gerdes, Vitor Faria, havran, vladigor, and _m.

_m’s picture

Status: Needs review » Reviewed & tested by the community
jhodgdon’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for the patches and reviews!

However, I don't think we want all these top-level topics for these somewhat esoteric subjects. We want to keep the main Help page fairly short, so people can find topics of interest quickly. So... This information is all background (no tasks)... Can we make just one top-level topic with the title of "Overview of web services" or something like that (not sure if that is the right overview topic name), and maybe just put all of this information in that one topic?

Another problem:

+{% set field_help_url = render_var(path('help.page', {'name': 'field'})) %}
+{% set hal_help_url = render_var(path('help.page', {'name': 'hal'})) %}
+{% set basic_auth_help_url = render_var(path('help.page', {'name': 'basic_auth'})) %}
+{% set node_help_url = render_var(path('help.page', {'name': 'node'})) %}

We definitely do *not* want to be linking to the old hook_help pages for these modules. We are going to be getting rid of the hook_help pages. Instead, use the "related" meta-data field at the top to make links between related Help Topics.

mradcliffe’s picture

I think @jhodgdon has a good idea here.

I added the Needs issue summary update to follow-up to make sure that the issue summary contains the new proposed resolution.

jhodgdon’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

OK, updated the issue summary. We have a standard issue summary, from Proposed Resolution on down, for these "convert" issues, which I think covers the idea that we *don't* want module overview topics. And we update it from time to time, via copy/paste, so I don't want to make changes to the Proposed Resolution step. So what I did was add a note to the top problem/motivation section instead. In bold type. :)

pratik_kamble’s picture

Assigned: Unassigned » pratik_kamble
pratik_kamble’s picture

StatusFileSize
new8.32 KB
new16.89 KB

Created patch to have all the web services related at one place.

pratik_kamble’s picture

Assigned: pratik_kamble » Unassigned
Status: Needs work » Needs review
jhodgdon’s picture

Status: Needs review » Needs work

This is looking pretty good, thanks for the patch! A few things to look at:

a) "Web service provides an interface, to be utilized by another Web server or by a mobile app." ... This sentence needs some grammar attention... Maybe just needs to start with "A" or "The"? I am not sure.

b) HTML nitpick: the headings changed from H3 to H2 after the first one. They should all be H3 I thin.

c) A few of the headings don't start with "What is" or "What are". They should.

d) It bothered me that in a section like "What is JSON:API" the answer started out with "the xyz module provides". I think we should start by explaining what JSON:API is, and then after answering the question in the heading, point out that the module is available to implement it. This applies to multiple sections. I think the information is there -- just the order bothered me (leading off with the module instead of answering the question). I think that must have been copy/pasted from the module overview hook_help topics, which are trying to answer the question about what a specific module does, but we are moving away from module-oriented help here, towards concept-oriented and task-oriented help (i.e., oriented towards what people want to do with their web site, and the concepts they need to understand to do it).

e) The "for more information" links... only include if they are actually useful and contain information not in this topic. Also they're generally supposed to be at the end in their own section.

f) The DL list under the RESTful web services section doesn't have any context introducing it, so it doesn't really seem to make sense. If it is giving steps, maybe it should be in its own topic, like "Setting up RESTful web services"?

pratik_kamble’s picture

Assigned: Unassigned » pratik_kamble
jhodgdon’s picture

Assigned: pratik_kamble » jhodgdon

I'm working on a new patch for this now.

jhodgdon’s picture

Status: Needs work » Needs review
StatusFileSize
new4.36 KB

Here's a new patch... interdiff is not useful because pretty much every line in the topic changed. I updated the structure, simplified down to the essential information, and reorganized.

pratik_kamble’s picture

Status: Needs review » Reviewed & tested by the community

@jhodgdon Patch LGTM. The patch provides all basic information about web services and Modules that can be used to enable web services with Drupal.

jhodgdon’s picture

Thanks for reviewing!

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 60: 3047703-60.patch, failed testing. View results

jhodgdon’s picture

Status: Needs work » Reviewed & tested by the community

Unrelated test fail:

Drupal\Tests\jsonapi\Functional\EntityFormModeTest::testRelated
Drupal\Core\Database\SchemaObjectExistsException: Table sequences already exists.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

catch’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/modules/help_topics/help_topics/core.web_services.html.twig
    @@ -0,0 +1,28 @@
    +---
    +<h2>{% trans %}What are web services?{% endtrans %}</h2>
    +<p>{% trans %}According to the <a href="https://www.w3.org">W3C</a>, a web service is a software system designed to support interoperable machine-to-machine interaction over a network. In other words, a web service is any software that allows two or more servers, computers, or mobile devices (machine-to-machine) to exchange information and/or instructions (interoperable interaction) across the Internet or a local area network. Typically, the data is transported via <a href="https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol">HTTP</a> in a machine-readable file format.{% endtrans %}</p>
    +<h2>{% trans %}What is serialization?{% endtrans %}</h2>
    

    The long explanation of what a web service is feels like it should ideally be a footnote rather than a standfirst. I was expecting something more like 'Web services allows your Drupal site to expose data to other websites and services in various formats'.

  2. +++ b/core/modules/help_topics/help_topics/core.web_services.html.twig
    @@ -0,0 +1,28 @@
    +<p>{% trans %}Serialization is the process of converting complex data structures into text strings, so that they can be exchanged and stored (for example, for transmission over the Internet or for storage in a local file system). The reverse process is called <em>deserialization</em>. JSON and XML are the two most-commonly-used data serialization formats for web services. The core Serialization module provides a framework for adding specific serialization formats for other modules to use. {% endtrans %}</p>
    +<h2>{% trans %}What is Hypertext Application Language (HAL)?{% endtrans %}</h2>
    +<p>{% trans %}<a href="http://stateless.co/hal_specification.html">Hypertext Application Language (HAL)</a> is a serialization format that supports the linking required for hypermedia APIs, which are a style of Web API that uses URIs to identify resources and the <a href="http://wikipedia.org/wiki/Link_relation">link relations</a> between them, enabling API consumers to follow links to discover API functionality. The core HAL module provides HAL serialization to a JSON format.{% endtrans %}</p>
    +<h2>{% trans %}What is HTTP Basic authentication?{% endtrans %}</h2>
    

    HAL is mentioned in this introduction, but the HAL module isn't mentioned in the list of modules below?

  3. +++ b/core/modules/help_topics/help_topics/core.web_services.html.twig
    @@ -0,0 +1,28 @@
    +  <dd>{% trans %}Exposes <em>entities</em> (such as content items, comments, and taxonomy terms) using a fully compliant implementation of the <a href="https://jsonapi.org">JSON:API Specification</a>.{% endtrans %}</dd>
    +  <dt>{% trans %}RESTful Web Services module{% endtrans %}</dt>
    +  <dd>{% trans %}Exposes entities and other resources using a <a href="https://en.wikipedia.org/wiki/Representational_state_transfer">REST</a> implementation.{% endtrans %}</dd>
    +  <dt>{% trans %}RDF module{% endtrans %}</dt>
    

    The description for REST is a bit tautological, mentioning which formats are available (like HAL) might help with that though.

pratik_kamble’s picture

Issue tags: +DIACWJuly2020
jhodgdon’s picture

Status: Needs work » Needs review
StatusFileSize
new4.35 KB
new6.49 KB

Thanks for taking a look! Here's a new patch that tightens up and simplifies much of the text. I also moved all of the information about modules to the modules list, since (based on the previous review) the information about the HAL module wasn't easy to find in the previous version, even though it was mentioned.

batigolix’s picture

StatusFileSize
new4.39 KB
new1.93 KB

I reviewed the patch, and found 1 more thing I would change to make it easier to read. See the interdiff.

Besides that I think this is ready to be RTBTC'ed.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Your change in #69 looks fine, and I tested the patch in #69 and it displays fine. So, I hereby RTBC your changes. Since you indicated in #69 that aside from the small change you made you think the patch is RTBC, I will go ahead and mark it RTBC. Thanks!

  • catch committed 4a8ea54 on 9.1.x
    Issue #3047703 by petedussin, jhodgdon, Vitor Faria, pratik_kamble,...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the changes in #68 and #69, that's a lot easier to read.

Committed 4a8ea54 and pushed to 9.1.x. Thanks!

Status: Fixed » Closed (fixed)

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

gaurav.kapoor’s picture