It would be good to use default views instead of the hard coded listing pages like the webform submissions listing (webform_results_submissions).

It would make it easy for administrators to modify the listings.

CommentFileSizeAuthor
#5 webform_views_dependency-2036805.patch326 bytesquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Thanks for opening this issue, I've been thinking about doing this in the 4.x branch, though it will mean that Views (and CTools) become a dependency for Webform. I don't think that's a problem, especially with the majority of both modules built into Drupal 8 core.

Although it's an issue to follow-up on this one, I'd like end-users to be able to add/remove columns for components for individual webform listing pages. The main submissions listing page just isn't very helpful showing usernames for example if only anonymous users fill out the forms. I imagine this would be implemented as a special field type in Views, but I haven't figured out exactly how that would work yet.

This relates to #1589582: Add checkbox on the webform result page so user can select multiple result and delete them (Views Bulk Operation style) pretty heavily also.

rooby’s picture

Your anonymous user example is exactly why I went looking for this.

I think it would be one of the more common use cases.

quicksketch’s picture

I think a good first step is simply requiring CTools and Views as dependencies for Webform 4.x, even if we're not using them yet. That enables us to add these pages as views later.

bharata’s picture

I would think that this brilliant move would also open the door for the much desired ability to "score" webform results.

For example, with a series of true/false questions the total number of true responses could now easily be added up using Views calculate function.

There are TONS of other applications coming to mind related to this functionality.

quicksketch’s picture

Issue summary: View changes
FileSize
326 bytes

Although I'm sad the effect this has on the modules page (lots more module dependencies being listed), I think making Webform depend on Views is the right move and it will enable us to convert listings later. So for now I've committed this patch as a stop-gap to allow us to move to a final release and convert listings to Views later.

  • Commit 9364a73 on 7.x-4.x by quicksketch:
    Issue #2036805: Use default views instead of hard coded listing pages.
    
fenstrat’s picture

Version: 7.x-4.x-dev » 8.x-4.x-dev
Assigned: Unassigned » fenstrat
Status: Active » Patch (to be ported)

#5 needs porting to 8.x-4.x.

fenstrat’s picture

Version: 8.x-4.x-dev » 7.x-4.x-dev
Assigned: fenstrat » Unassigned
Status: Patch (to be ported) » Active

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

Moving back to Active as the dependency is only the first step here.

  • Commit 1e63217 on 8.x-4.x by fenstrat:
    Issue #2036805 by quicksketch: Require the views module.
    
DanChadwick’s picture

Status: Active » Closed (duplicate)
Related issues: +#2330557: Replace hard-coded tables with views

Even though this is the older issue, there is more discussion about removing hard-coded tables in the related issue.