CVS edit link for gionnibgud

I have created a module called Webform Taxonomy Select to extend Webform's pre-built option list functionality and I'd like to share it.
The module enables the use of taxonomy terms from selected vocabulary to populate select list components in Webform.
It's easy to add new pre-built options using Webform's hooks but this module can be useful to people with no knowledge of php and few other scenarios.
The module is working but requires a patch to Webform that has already been approved and committed (http://drupal.org/node/907762) but not released yet.
Depends on Taxonomy and Webform.

Comments

gionnibgud’s picture

StatusFileSize
new7.88 KB

Here is the module to checkout.
Requires drupal 6.x, Taxonomy, Webform + this patch http://drupal.org/node/907762

avpaderno’s picture

Status: Postponed (maintainer needs more info) » Needs work
Issue tags: +Module review

Hello, and thank you for applying for a CVS account. I am adding the review tags, and some volunteers will review the code, pointing out what it needs to be changed.

As per requirements, the motivation message should be expanded to contain more features of the proposed project. For themes, it should include also a screenshot of the theme, and (when possible) a link to a working demo site; for modules, it should include also a comparison with the existing solutions.

gionnibgud’s picture

StatusFileSize
new74.17 KB

I'm posting the content of the README file.

Webform Taxonomy Select
=======================

Adds a pre-built option list of terms for each vocabulary in Taxonomy

Configuration
=============

This is a very simple module and there is no configuration at all.

Instructions
============

Enable the module. REQUIRES TAXONOMY + WEBFORM (+ this patch http://drupal.org/node/907762 until next webform update)

1. Create a Vocabulary if you do not have one
2. If needed add some terms to your newly created vocabulary
3. Create or edit a Webform
4. Add a select component
5. Use the pre-built option list select to choose a Vocabulary
6. Save the component

You should now have a select component populated with all the terms from the selected Vocabulary.

I also plan to add the possibility of choosing which vocabularies will be exposed to Webforms (for now i just show all) this is why there is an .install file in the module that doesn't do anything at the moment.
I did not set up any specific permissions for the module since its functions are only called from within webform.

I'm adding a screenshot of Webform's select component editing page with my module activated.

You select the vocabulary from the list (a)
Options field is filled with values from the terms list as tid|term name (b)

The module is really two functions. I checked it with coder and it's pretty clean now.

Use case scenarios:
-I have no knowledge of php but I'd like to reuse and keep up to date commonly used options lists for my Webforms
-I need to build a questionnaire that involves selecting terms from the taxonomy

In the future the module could go beyond taxonomies and start supporting custom lists from different sources like views or nodequeue.

gionnibgud’s picture

Status: Needs work » Needs review
avpaderno’s picture

Status: Needs review » Needs work
  • The points reported in this review are not in order of importance / relevance.
  • Most of the times I report the code that present an issue. In such cases, the same error can be present in other parts of the code; the fact I don't report the same issue more than once doesn't mean the same issue is not present in different places.
  • Not all the reported points are application blockers; some of the points I report are simple suggestions to who applies for a CVS account. For a list of what is considered a blocker for the application approval, see CVS applications review, what to expect. Keep in mind the list is still under construction, and can be changed to adapt it to what has been found out during code review, or to make the list clearer to who applies for a CVS account.
  1. License files cannot be committed in Drupal.org repository. Projects committed in Drupal.org repository have the same license used by Drupal.
  2. Hook implementation comments should be like the following one:
    /**
     * Implements hook_menu().
     */
    

    As reported in Documenting hook implementations:

    If the implementation of a hook is rather standard and does not require more explanation than the hook reference provides, a shorthand documentation form may be used in place of the full function documentation block described above:

    /**
     * Implements hook_help().
     */
    function blog_help($section) {
      // ...
    }
    

    This generates a link to the hook reference, reminds the developer that this is a hook implementation, and avoids having to document parameters and return values that are the same for every implementation of the hook. Optionally, you can add more information in a separate paragraph to describe the particular quirks of your hook implementation.

    In the case of hooks that have variables in the names, such as hook_form_FORM_ID_alter(), a slightly expanded syntax should be used:

    /**
     * Implements hook_form_FORM_ID_alter() for node_type_form().
     */
    function mymodule_form_node_type_form_alter(&$form, &$form_state) {
      // ...
    }
    

    This generates a link to the hook reference, as well as to the particular form that is being altered. Again, optionally you can add more information in a separate paragraph to describe the particular quirks of your hook implementation.

  3.       return t('1. Create a Vocabulary
    2. Add some terms to your newly created vocabulary
    3. Create or edit a webform
    4. Add a select component
    5. Use the pre-built option list select to select a Vocabulary
    6. Save the component
    
    You should now have a select component populated with all the terms from the Vocabulary you\'ve chosen.');
    
    

    Avoid to escape a string delimiter inside a string, especially if the string is passed to t(). Why isn't the string using HTML tags?

gionnibgud’s picture

StatusFileSize
new4.01 KB

Thanks for the review, kiamlaluno.

1. Removed licence file
2. Hook implementations corrected
3. Lazy me. Now I'm using html. No escaping.

gionnibgud’s picture

Status: Needs work » Needs review
drupalshrek’s picture

Status: Needs review » Needs work

Hi,

As far as I see functionally it looks OK.

All text needs translating with t() which you have done, but all HTML output (as I understand it) needs to be themeable (so that someone can override the layout, rather like with t() people can override the translation). See:
http://drupal.org/node/306
http://drupal.org/node/165706

Specifically, for the following code, I think you should use http://api.drupal.org/api/drupal/includes--theme.inc/function/theme_item... :

function webform_taxonomy_select_help($path, $arg) {
  switch ($path) {
    case 'admin/help#webform_taxonomy_select':
      return t('<ol>
        <li>Create a Vocabulary</li>
        <li>Add some terms to your newly created vocabulary</li>
        <li>Create or edit a webform</li>
        <li>Add a select component</li>
        <li>Use the pre-built option list select to select a Vocabulary</li>
        <li>Save the component</li>
        </ol>
        <p>You should now have a select component populated with all the terms from the Vocabulary you have chosen.</p>');
  }
}

I think the convention for README naming is README.txt rather than README.TXT

gionnibgud’s picture

Status: Needs work » Needs review
StatusFileSize
new3.93 KB

Hi drupalshrek, thanks for taking the time to check my module.
I've implemented some changes in hook_help.
The item list now uses the theme function and each string, paragraphs too, is translatable.
The rest of the module's output is plain text and gets themed by Weform.

drupalshrek’s picture

Hi,

I don't have CVS rights so I can't help much further than the initial review. You will need to wait for someone else to take this further.

Good luck!

gionnibgud’s picture

Thank you!

zzolo’s picture

Component: Miscellaneous » miscellaneous
Status: Needs review » Postponed

Hi. Please read all the following and the links provided as this is very important information about your CVS Application:

Drupal.org has moved from CVS to Git! This is a very significant change for the Drupal community and for your application. Please read the following documentation on how this affects and benefits you and the application process:
Migrating from CVS Applications to (Git) Full Project Applications

  • The status of this application will be put to "postponed" and by following the instructions in the above link, you will be able to reopen it.
  • Or if your application has been "needs work" for more than 5 weeks, your application will be marked as "closed (won't fix)". You can still reopen it, by reading the instructions above.
avpaderno’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

As per previous comment, I am setting this issue to won't fix.

Since new users can now create full projects, applications have a different purpose and they are handled on a different issue queue. See Apply for permission to opt into security advisory coverage for more information.

avpaderno’s picture

Component: miscellaneous » new project application