Create a webform with a non-root parent menu item.

  1. The breadcrumbs will appear correctly on the form completion page. However, the submission confirmation page will contain only the homepage and the form, not any intermediate pages.
  2. The menu containing the webform will be correctly expanded on the form completion page, but it will not be on the submission confirmation page.

Comments

danchadwick’s picture

Title: Breadcrumb incorrect on submission confirmation page » Breadcrumb and active menu trail incorrect on submission confirmation page
Issue summary: View changes
danchadwick’s picture

Update. I've spent some time looking at this. Webform tries very hard to create breadcrumbs where the webform is as if it were directly under the home menu, at the top of the the menu hierarchy. It then tries to infer what the right breadcrumb is. And it puts the title of the webform into the breadcrumb, even when that is the title of the page. In short, it is making a bunch of changes to the breadcrumbs, not entirely positive.

The better action is to set menu item of the current page to be as if it were node/NID. The creates the correct breadcrumbs and expands the menu. It does not set the active class of the node's menu item, but it does set the active-trail class. If desired, CSS could be used to highlight the active menu item. At least the menu is expanded.

The breadcrumbs are set in the following situations:

  1. Form completion confirmation page. Still needed.
  2. Results / Table (but oddly none of the other tabs). Not needed; default menu is adequate.
  3. Submission view / edit. Needs submission breadcrumb.
  4. Submission delete confirmation page. Needs submission breadcrumb.
  5. Submission e-mail re-send page. Needs submission breadcrumb.

I will continue to investigate and test. I see some different behavior for submissions when the webform in in the menu somewhere.

danchadwick’s picture

Desired behavior:

Form completion confirmation page. The menu path is set to the node and the node title is added to the end of the breadcrumbs, since the confirmation page isn't the node page. The behavior is identical for the default menu path (home / webform node title) and when the node is in a menu and has a preferred menu path (home / path / to / node / webform node title).

Webform node and its tabs. Removed special processing for results tab. The breadcrumb is now the Drupal default, which is to include the node title when you aren't on the default View tab. I don't love this behavior, but it's what core does. So the webform-related tabs behave the same as the core Edit tab. Core properly provides the preferred menu path, if there is one.

View/Edit/Delete submission. I now see the wisdom of the current implementation. The idea is to pretend that the submission in in the menu hierarchy under either the results or submissions. The path is home / [optional preferred path to node] / webform node title / Webform results or Submissions, if use has appropriate access.

Resend emails for submission.. Same as above.

Patch for review.

danchadwick’s picture

Status: Active » Needs review
liam morland’s picture

Thanks, Dan.

"Webform confirmation" is appearing before the name of the form. It should appear after and maybe just be "Confirmation".

Check the indentation on line 4536.

danchadwick’s picture

@Liam - I'm not seeing this at all. The only place in the code that 'webform confirmation' appears is as the title of the menu for the .../done menu item. The callback for this sets the page title to the node's title.

Are you saying that you are seeing this in the breadcrumb? I would not expect that at all. I think we need detailed steps-to-reproduce.

liam morland’s picture

Status: Needs review » Reviewed & tested by the community

Sorry, must be something funny with our install profile. I don't see "Webform confirmation" at all on a standard install. It is working as it should.

  • DanChadwick committed 554a6ef on 7.x-4.x
    Issue #2327993 by DanChadwick: Breadcrumb and active menu trail...
  • DanChadwick committed 4e64169 on 8.x-4.x
    Issue #2327993 by DanChadwick: Breadcrumb and active menu trail...
danchadwick’s picture

Version: 7.x-4.x-dev » 8.x-4.x-dev
Status: Reviewed & tested by the community » Fixed

Committed to 7.x-4.x and 8.x.

liam morland’s picture

Thank you!

danchadwick’s picture

Version: 8.x-4.x-dev » 7.x-4.x-dev
torotil’s picture

Backport to 7.x-3.x.

  • torotil committed d6e736c on
    Issue #2327993 by torotil, DanChadwick: Breadcrumb and active menu trail...

Status: Fixed » Closed (fixed)

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

cornelyus’s picture

I am working with webform, and just noticed that the page where I see my own submissions, has "lost" it's breadcrumb. Page is node/%webform_menu/submissions and is rendered by webform_results_submissions in webform.report.inc.
On the commited patch the rendering of the breadcrumb was removed from the function.

It's true that breadcrumb does work for submissions on node/%webform_menu/webform-results, as said before: Results / Table (but oddly none of the other tabs). Not needed; default menu is adequate. but not for the other page.

Can someone give input on this? Should I open a new ticket and post a patch there for this?

thank you

liam morland’s picture

This should go in a new ticket. If you think it is related to this one, you can list it as a related ticket. Please provide steps to reproduce the problem. It would be helpful if you can identify when the breadcrumbs became "lost"; which version or commit.

cornelyus’s picture