Problem/Motivation

In #3121340: Fix up minor copy problems in help topics, we collected a bunch of minor issues with help topics. It has been converted to a "plan" issue with separate issues created for each problem.

alexpott found this in contact.setting_default.html.twig

<p>{% trans %}Set a site-wide contact form to be the default contact form (the form that is shown on the <em>/contact</em> URL).{% endtrans %}</p>

It's possible the /contact path is altered so might not be on /contact. I think we should link to the site wide contact form using the contact.site_page route.

Additional notes (from #10):

1. The route to /contact (e.g. the default contact form page) is contact.site_page. We don't have Twig variables set up for that route yet. (Use the existing pair of Twig variables in this topic as a guide. Both the route and the link text will need to be updated.)
2. The Goal (the sentence we are updating with this link) need to be rephrased so that the link to the contact.site_page route can be added. It needs to be rephrased in a multilingual-context-friendly way. Since we won't know the title, this is tricky! Perhaps if we link the entire parenthetical phrase, that will work, because the entire context can be translated.

Steps to reproduce

  1. Install the latest version of Drupal
  2. Install Help Topics module, or if Help Topics has been merged with Help, install Help module.
  3. In a code editor or IDE, locate the help topic contact.setting_default.html.twig. (Since Help Topics is being merged into Help, and the core topics are being merged into their respective modules, it may be in 1 of several places:
    • core/modules/help_topics/help_topics
    • core/modules/help/help_topics
    • core/modules/contact/help_topics
  4. Looking at the Twig file (not in the UI), see if there are any mentions of the literal string /contact. Those should be replaced with the contact.site_page route using the help_route_link() function. As of the time of writing, there are already variables set up for this route, the variable just needs to be used to replace the remaining instance of "/contact".

Proposed resolution

Updated after review in #15.

The rendered HTML will be:

Set a site-wide contact form to be the default contact form (the form displayed on the default contact page; for example, /contact).

That shows that the URL might be /contact, but describes the page, just in case it isn't. And the whole phrase is linked, allowing for hopefully enough context for translators to make sense of it.

1. Add the following to the top of the file, above or below the current set of {% set %} statements.

{% set contact_page_link_text %}{% trans %}the form displayed on the default contact page{% endtrans %}{% endset %}
{% set contact_page_link = render_var(help_route_link(contact_page_link_text, 'contact.site_page')) %}

2. Update the paragraph immediately following the

Goal

heading to:

<p>{% trans %}Set a site-wide contact form to be the default contact form ({{ contact_page_link }}; for example, <em>/contact</em>).{% endtrans %}</p>

Remaining tasks

  1. Update contact.setting_default.html.twig per the proposed resolution.
  2. View the topic in the UI at admin/help/topic/contact.setting_default (you can use the Tugboat link in the issue to do this!) and verify the link to the default contact form in 2 places (the place you edited and the 2nd instance in the steps). (Note: Install Help Topics to see the change (or if Help Topics has been merged into Help, Help module))
  3. Make a patch or merge request. Note that this file may be in one of several places (see above), depending on the state of Help Topics' merge with Help.
  4. Review and approve
  5. Commit

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

The contact.setting_default help topic has been updated to reflect that the path to the default contact form will be at the configured contact.site_page route and not necessarily at the "/contact" path (which is the default). Uninstall and reinstall Help Topics module or Help (if Help Topics module has already been merged with Help) to see the change.

Issue fork drupal-3358575

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Amber Himes Matz created an issue. See original summary.

amber himes matz’s picture

Issue summary: View changes

Updated remaining tasks to include instructions for testing.

andypost’s picture

Issue tags: +Novice

Rassoni made their first commit to this issue’s fork.

rassoni’s picture

Status: Active » Needs review
StatusFileSize
new260.94 KB
new264.65 KB

After making changes, please refer to the images below to see how the page will appear.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

I believe this is ready.

The tasks "Uninstall/Install Help Topics (or if Help Topics has been merged into Help, Help module)" seems out of scope of the title but could be wrong.

amber himes matz’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs review

Updated issue summary's remaining tasks for clarity.

Looking at MR, it's doing what I suggested in the issue summary (thank you!) but I'm not crazy about the resulting grammar, now that I look at it. Going to ask for a 2nd opinion on that before we finalize this.

Thank you all for the quick MR and review.

smustgrave’s picture

What about

"Set a site-wide default contact form (the form show on Contact Forms)"

amber himes matz’s picture

Issue summary: View changes
Status: Needs review » Needs work

Oh, wait a minute, I made a mistake and confused the routes. Sorry about that! The route we already have is the route to the admin page that lists all contact forms entity.contact_form.collection. We don't have vars for the route to the default contact page (contact.site_page).

Also, although I couldn't find where /contact is configurable (or maybe it's just alterable in a custom module?), apparently it is, which is why this issue exists. So we shouldn't use the literal text "/contact" or its default route title, "Contact". The title of the page will vary, depending on which contact page is configured to be the default contact page (that's what this help topic describes in fact).

Ok. So there are 2 things to note/to do:

1. The route to /contact (e.g. the default contact form page) is contact.site_page. We don't have Twig variables set up for that route yet. (Use the existing pair of Twig variables in this topic as a guide. Both the route and the link text will need to be updated.)
2. The Goal (the sentence we are updating with this link) need to be rephrased so that the link to the contact.site_page route can be added. It needs to be rephrased in a multilingual-context-friendly way. Since we won't know the title, this is tricky! Perhaps if we link the entire parenthetical phrase, that will work, because the entire context can be translated. The rendered HTML could be something like:

<p>Set a site-wide contact form to be the default contact form (<a href="/contact">the form that is shown at the default contact page; for example, <em>/contact</em>)</a>).</p>

That shows that the URL might be /contact, but describes the page, just in case it isn't. And the whole phrase is linked, allowing for hopefully enough context for translators to make sense of it.

If we adopt that suggestion, here are the changes that need to be made to this file.

1. Add the following to the top of the file, above or below the current set of {% set %} statements.

{% set contact_page_link_text %}{% trans %}the form that is shown at the default contact page; for example, <em>/contact</em>){% endtrans %}{% endset %}
{% set contact_page_link = render_var(help_route_link(contact_page_link_text, 'contact.site_page')) %}

2. Update the paragraph immediately following the <h2>Goal</h2> heading to:

<p>{% trans %}Set a site-wide contact form to be the default contact form ({{ contact_page_link }}).{% endtrans %}</p>

I've updated the issue summary's proposed resolution with this suggestion -- but discussion and feedback is welcome!

Edit: typo: show/shown

amber himes matz’s picture

Issue summary: View changes

Edited issue summary's proposed resolution to fix typo (show => shown).

sourabhjain’s picture

Assigned: Unassigned » sourabhjain

I will work on #10.

sourabhjain’s picture

Assigned: sourabhjain » Unassigned
Status: Needs work » Needs review

I have updated the MR as per changes suggested in #10. Please review.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC.

amber himes matz’s picture

Status: Reviewed & tested by the community » Needs work

I reviewed the merge request via the generated Tugboat instance and I see that the HTML didn't get rendered properly, as you can see here (login: admin/admin)

https://mr3958-kxepnyr9mnydxhfgeg2mnr0rewij1yfl.tugboatqa.com/admin/help...

I think this is because there's HTML in the link text, so it gets escaped when passed through render_var(help_route_link()).

I'll do some testing and figure out a better suggestion.

amber himes matz’s picture

Also, I rebased the MR to 10.1.x, but maybe the target branch needs be update to 11.x (I'm not sure).

smustgrave’s picture

Think if this is fixing an existing link it can go into a minor release right?

amber himes matz’s picture

Issue summary: View changes

I've pushed a fix after working out a solution. I've updated the issue summary. This is ready for review and testing.

Steps to test:

  1. Use the "Live preview ready" via Tugboat link in this issue to review the merge request. Link
  2. Login as admin/admin
  3. Install Help Topics (admin/extend)
  4. Navigate to admin/help
  5. Click on the top-level topic, "Managing contact forms"
  6. Under "Related topics", click on "Setting a default contact form" (admin/help/topic/contact.setting_default).
amber himes matz’s picture

Status: Needs work » Needs review
andypost’s picture

requeued, failed test looks unrelated

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new189.51 KB

test

Verifying that's what I see.

Keep forgetting we have tugboat on here.

elber made their first commit to this issue’s fork.

elber’s picture

Status: Reviewed & tested by the community » Needs review

Hi I just rebased please revise.

smustgrave’s picture

Status: Needs review » Needs work

Seems the rebase broke something.

amber himes matz’s picture

I'm working on rebasing onto 11.x.

amber himes matz’s picture

First, I squashed the 3 commits and rebased 10.x.

amber himes matz’s picture

Assigned: Unassigned » amber himes matz
andypost’s picture

As a bug it fits into 10.1 and could be backported to 9.5.x

shashank5563’s picture

StatusFileSize
new80.04 KB

I have tested #17 on my local. it is working as expected.
3358575

amber himes matz’s picture

Assigned: amber himes matz » Unassigned
Status: Needs work » Needs review

Ok, looks like it's not necessary (or appropriate) for me to add this to the 11.x branch, since it's a minor bug fix that can go in to 10.1.x (hopefully). The tests are passing now after I rebased again, so this looks good for a final review.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

I think it's ready, no tests as the fix about docs

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

  • longwave committed cb90dcce on 11.x
    Issue #3358575 by Amber Himes Matz, Rassoni, sourabhjain, smustgrave,...
longwave’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed cb90dcce1b to 11.x (10.2.x). Thanks!

Status: Fixed » Closed (fixed)

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