Overview

This module provides a ctools content type plugin to display nodes that have webform components attached to them.

It also provides subtypes to allow you to specify the node type of the node you want to display, as well as the view mode you want to display it in, and it will only show nodes that actually 'are' webforms (have instanced webform components), instead of showing all nodes that 'can be' webforms (content types configured with webform enabled).

Background

This module was created in the scope a project I was working on where we basically developed a landing page builder using Panels and Panelizer.

The client was able to add predefined types of objects (beans, pages etc) but he had no way to explicitly add webforms (nodes with forms) to the panel. What makes it a bit confusing in terms of UX for clients sometimes is the fact that any kind of content can be a webform, so without this module if the client wanted to add a page with a form to the panel he would add a node and a list of literally hundreds of pages would be available.

Enter Webform Panels.

By providing a content type and subtype we can not only have easy access through the panels UI to add forms to a panel, but we can even limit certain roles to add only forms to the panel, while others would be able to add beans for example.

This made the builder much more powerful. Ever since then we have used this module everytime we need to work with Panels and define exactly what can be added to the Panel by the site manager.

See screenshot for an example.

There are no other modules that add this functionality, at least not to my knowledge. I actually created a similar sandbox called Webform Views filter, that allows users to filter nodes showing only the ones that have webforms, but though it maybe to small to submit as an application (https://www.drupal.org/sandbox/kyuubi/2180385)

Features

  • Allows the user to select from only nodes that have actual webform components attached.
  • Provides subtypes to allow the user to choose the node type of the webform he wants to display.
  • Only displays subtypes for nodes that have webform components.
  • Provides view mode support to specify the view mode in which the node is to be displayed.
  • If you have Panelizer installed you can define access permissions for this content type only, allowing site managers to only add webforms to a panel for example.

Project Page

https://www.drupal.org/sandbox/kyuubi/2180399

Git Instructions

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/kyuubi/2180399.git webform_panels

Reviews of other projects

https://www.drupal.org/node/2390855#comment-9447981
https://www.drupal.org/node/2394329#comment-9448049
https://www.drupal.org/node/2394747#comment-9448085

Hope everything is in order!

Thanks,

Duarte

CommentFileSizeAuthor
webform_panel.png74.85 KBkyuubi
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

kyuubi’s picture

Issue summary: View changes
kyuubi’s picture

Issue summary: View changes
zeeshan_khan’s picture

Status: Needs review » Reviewed & tested by the community

Hi kyuubi,

I've tested your module on http://pareview.sh/pareview/httpgitdrupalorgsandboxkyuubi2180399git found no issue.
Then I've downloaded and installed the module and found no issue.
This module is working fine to me, I am changing status to reviewed.

Best,
Zeeshan

ameymudras’s picture

Hi kyuubi,

Please find my comments below to improve your module:

  1. Rather than using a foreach loop here
    foreach ($query->execute() as $result) {
        $results[] = $result->nid;
      }

    You can simply make use of $query->execute()->fetchCol()

  2. Make use of t() function '#value' => $options ? key($options) : 'default',
  3. In function webform_panels_get_all_forms, you have fetched the nid's first, then node is loaded then you make an array of nid=>title. Rather modify your query such that you get nid => title and make use of fetchAllKeyed.
  4. Rather than node load just for fetching a node title make use of a separate function which will do this using a query
kyuubi’s picture

Hey ameymudras,

Thanks for your feedback.

Will look into this as soon as I can.

Thanks for the help!

kyuubi’s picture

Hey ameymudras,

First thanks for your feedback, some of your tweaks were well spotted.

1. Didn't appy this as this becomes redundant once I modified the query to return the nids and use a fetchAllKeyed (already get a keyed array of nid->title, so no point)
2. Well spotted. I was using t() everywhere, must have missed this spot for some reason.
3. Done. This saved not only the foreach above but especially the node_load_multiple.
4. No need the node_load is already eliminated by doing 2.

Thanks mate for your effort.

Cheers,

Duarte

kyuubi’s picture

Issue summary: View changes
kyuubi’s picture

Issue summary: View changes
kyuubi’s picture

Issue summary: View changes
kyuubi’s picture

Issue tags: +PAreview: review bonus

Adding PAReview: review bonus tag.

klausi’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -PAreview: review bonus

Review of the 7.x-1.x branch (commit 800ccf8):

  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  1. webform_panels_get_all_forms(): does not respect node access with the db_select() call. There can be admins that should not have access to certain nodes, but they can see the title here. So you should add the node_access tag here. See https://www.drupal.org/node/93737 . I'm not sure if this is a security issue or not - what do other panel plugins do in this case when nodes can be selected? Also please add a comment to the code once you found out.
  2. Same for webform_panels_webform_panels_content_type_admin_title() which should probably call node_access() before printing the title into the summary.
  3. And webform_panels_webform_panels_render() where you probably should not display the node if the current user does not have access to it. I'm not completely sure what the policy for that case is in Panels plugin, if access is only determined by visibility conditions or if plugins check access themselves, too.

I'm setting this to "needs work" since I'm not sure if this is a security issue or not. Either fix the issue or add comments to the code explaining why node access is ignored.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

kyuubi’s picture

Status: Needs work » Needs review

Hi klausi,

Thanks first of all for your review you raise some definitely good issues.

1. Even though it does not seem a security issue to me (but I am really not qualified to confirm that) it makes total sense to manage leverage the access control capabilities by adding that tag. Fixed and also tested with content access module.
2. Here I think the title should be present for panel admin purposes. If a user has panel administration privileges (i.e the ability to restructure a node panel order) it makes sense they can see the title of the item even if he doesn't have access to it. Similarly to how several permission modules work, you can view a title administratively but when you click to view you get a access denied, except in this there isn't even anything to click, its just an title to make administration tasks easier.
3. Agree 100% with this one. Fixed and commented.

Thank you for your review!

tomz0r’s picture

Hi kyuubi,

I've tested your module on a fresh install.

Automated Review

No issues found.

http://pareview.sh/pareview/httpgitdrupalorgsandboxkyuubi2180399git-7x-1x-0

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
No issues found

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

Regards,
tomz0r

klausi’s picture

@tomz0r: so it seems you did not find any problems with this project - could you set the status to RTBC in this case?

tomz0r’s picture

Status: Needs review » Reviewed & tested by the community

Sorry. Updated status to RTBC.
Thanks klausi.

kyuubi’s picture

Thanks for your review tomz0r!

kyuubi’s picture

Hi Klausi,

Is there anything else I need to do from my end?

How does the process go from RTBC?

Cheers,

kscheirer’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution, kyuubi!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

kyuubi’s picture

Thanks kscheirer!

Will start by going through those readings and will definitely will help out on other applications.

Thanks to all reviewers that helped sharp the edges!

Status: Fixed » Closed (fixed)

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

apaderno’s picture