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
When utilizing the webform ecosystem for any advanced application such as event registration, application portal or employee performance evaluations, it is often required that the submission results tab be manipulated to show different data based on what roles are viewing the information.
Solution
With views in core and with the Webform Views Integration modules being stable, providing a default view with a dependency on Webforms Views Integration, would give site-builders a powerful tool to build submission results interfaces. This view could utilize views url's to override the tab.
Feature Requests
- Default View: A default view that Overrides the Submission Results Tab
- Additional Tab: Provide an example view that creates an additional results tab. To be used if people want different tabs to show for different permissions, roles etc.
- Override Results View Per Webform or Webform Node: Allow default view to only override results tab of specific webforms or specific webform nodes. To be used if a user only wants to override the results tab of Event #2. Maybe using views url to override the results tab.
Additional Notes
- This feature was one of the highest requested features of the Entity Registration module, with over 100 comments and 70 followers this is an important feature. I can see many Entity Registration users utilizing webforms for events, due to lack of event registration modules available for Drupal 8.
Comment | File | Size | Author |
---|---|---|---|
#39 | 2993327-39.patch | 409.79 KB | jrockowitz |
| |||
#33 | 2993327-33.patch | 414.22 KB | jrockowitz |
| |||
#30 | 2993327-30.patch | 413.17 KB | jrockowitz |
#23 | 2993327-23.patch | 388.96 KB | jrockowitz |
#18 | 2993327-17.patch | 358.11 KB | jrockowitz |
|
Comments
Comment #2
kclarkson CreditAttribution: kclarkson as a volunteer and at Kennesaw State University commentedComment #3
kclarkson CreditAttribution: kclarkson as a volunteer and at Kennesaw State University commentedComment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #11
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThe attached patch has no test coverage. I just need to confirm that it is not breaking anything.
Comment #14
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #18
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #23
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #30
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #33
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #35
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI just messed up and merged 2993327-views with 8.x-5.x and I reverted the changes and will create a new branch.
Comment #39
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedHopefully, this final patch passes all the tests and this change can now be reviewed.
I created a change record to help people understand how views integration is set up.
A few notes about the original feature request.
Comment #43
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented@see https://www.youtube.com/watch?v=Qs_m5ybxeXk
Comment #45
bucefal91 CreditAttribution: bucefal91 at Websolutions Agency commentedCool video out there! :)
I reviewed your branch and also checked it out locally to actually execute your code. While reviewing your code I found this spot, which looks like a logical "misspelling" to me (it's
WebformSubmissionListBuilder
):As I told you in an email, in webform views I also at some point faced a similar task, but actually the implementation (and needs of our client) were slightly different. There we would let the client build a normal view for a webform A and have its URL be
/form/webform-a/my-cool-view
, then they'd expect this view to nicely integrate with routing, i.e. display local tabs in both directions: when you're on the URLform/webform-a
, among others, there must be the tab that leads to the view.. and other way around, whenever you open/form/webform-a/my-cool-view
we had to show all "normal" webform tabs.Then they'd repeat the same for webform B (and would place it under URL
/form/webform-b/my-cool-view-or-any-other-url
) and would expect again this new view to nicely integrate with the Routing system. The condition was that they are placing such views as a "subfolder" of the main webform route. But we did not substitute the pre-existing routes.I assume I could refresh my memories about how I managed routing in webform views for that part (actually the stuff I described above is part of webform_views, I decided to put it into a contrib module instead of just keeping in a custom one within the project; hoping that one day I'll have time to polish it and allow users to do some cool stuff on top of that). So I could refresh my memories and maybe offer a way to inject the submission views as a tabs and not as a dropdown list. But to be frank, it would mean a 3rd level of tabs and I do not think that is UX-friendly. I actually liked the dropdown list you have placed :)
Comment #46
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented@bucefal91 Good catch on the coding mistake.
I did not see any clean way to implement a third level and/or dynamic tabs to display webform submission views, especially because several admin themes have different ways of handling local tasks (aka tabs).
Views ability to add new local tasks/tabs to existing menu items and tabs is very limited. If have found any solution that helps solve this problem, please consider contributing it back as code or documentation.
Comment #48
bucefal91 CreditAttribution: bucefal91 at Websolutions Agency commentedAnd do you want to provide these tabs as 3rd level or append them to the 2nd level? By "3rd level" I mean more or less like you have done it right now with dropdown links but just to convert it to look&feel of tabs whereas by "2nd level" I mean to have the following tabs:
As the views can be injected on multiple routes, the 1st part of the tabs (the "webform own" tabs as I called them) would vary depending on the current route but still the logic stays the same: display "webform own" tabs whatever they are and then append the submission views tabs, if any, for the current route.
To be honest I prefer to append to the 2nd level because having 3 levels of tabs sounds like a little bit confusing to me but I do not insist on my preference since I am not a UX expert :)
Comment #49
kclarkson CreditAttribution: kclarkson as a volunteer and at Kennesaw State University commentedAlex,
would you still have the functionality to allow the dropdown? I like how jrockowitz had it as a dropdown if you wanted to use both tabs.
Also with your option would you be able to override the default submissions tab? That was really the key ingredient that I needed so that end users are not tempted to hit the wrong tab.
I owe both Alex and Jake a few beers, so come to Atlanta in November :)
Comment #50
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedBoth options can be supported. Right now only the dropdown is supported via the UI. Adding additional tabs requires some custom code.
I agree with the approach from #48. Ideally, the Views related tabs would appear after the 'Submissions' tab.
I am going to commit this patch now.
Comment #52
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #53
kclarkson CreditAttribution: kclarkson as a volunteer and at Kennesaw State University commented@jrock,
to use webform views though you need to use the dev version correct?
Comment #54
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedYes, I'll be tagging the next release next week.