The project basically allow users to work the same way that term reference does, but they can add one or more vocabularies to the select list, that way the entity won't be limited to only one vocabulary as the core does.

Project: Vocabulary Term Reference
Git repository: http://drupalcode.org/sandbox/tatewaky/1705436.git
It is for Drupal 7

Comments

cthiebault’s picture

Automatic review

vocabulary_term_reference.module

  1. Line 39: Control statements should have one space between the control keyword and opening parenthesis
    foreach(taxonomy_get_vocabularies() as $vid => $vid_obj) {
  2. Line 74: missing space after comma
    '#options' =>
    vocabulary_term_reference_taxonomy_options(taxonomy_get_vocabularies(),$instance['widget']['settings']['vid']),
  3. Line 75: Potential problem: FAPI elements '#title' and '#description' only accept filtered text, be sure to use
    check_plain(), filter_xss() or similar to ensure your $variable is fully sanitized.
    '#title' => (!empty($element['#title'])) ? $element['#title'] : t('List of terms and vocabularies'),
  4. Line 164: missing space after comma
    function vocabulary_term_reference_taxonomy_options($vocabularies,$settings) {
  5. Line 169: missing space after comma
    if (count($settings) > 0 && !in_array($v->vid,$settings)) {

vocabulary_term_reference.install

  1. Line 19: missing space after comma
    'indexes' => array('tid' => array('tid'),),

Manual review

Check Drupal coding standards (http://drupal.org/coding-standards#indenting). Some of your code is not well
indented.

vocabulary_term_reference.module

  1. line 40 - $options is not declared
  2. line 57 - typo: goint
  3. line 62 - typo: speciall
  4. line 86 - empty phpdoc
  5. line 111 - typo permited
  6. line 165 - You should use t('- Select a value -') instead of just '- Select a value -'.
  7. line 181 - typo especific

vocabulary_term_reference.install

Implement hook_uninstall() if you implement hook_install().

Anonymous’s picture

Manual review :

  1. Your .info file should not contain informations about the version, the project and the datestamp. Those will be added automatically by Drupal.
  2. The function vocabulary_term_reference_field_widget_settings_form() is not documented
  3. The documentation of vocabulary_term_reference_field_widget_form() should mention that it is an implementation of hook_field_widget_form().
  4. On line 171 of .module you might want to write $options = array(0 => '- '.t('Select a value').' -'); instead.
gellweiler’s picture

I have enabled your module and tested it out, it works as it is suppose to do. I think it's a very practical feature. A small improvement would be maybe to give more field types than multiple select lists, to choose the vocabulary. For example a list of checkboxes or a select list were you can choose multiple values.
I think your code is good documented, but I haven't done a deeper review of code, as it already has been done on the comments before this one.

jygastaud’s picture

Status: Needs review » Needs work

Hi,

I didn't have a look at your module code, but after install it, I think your module is really close from what Entityreference done when you choose Vocabulary Term entities.
Only difference I can see is that your module add a seperation between each vocabulary on display and entityreference doesn't ... But do we really need it?

Maybe it would be better if you help to improve widget for entityreference instead of publish a other module?!

I put the module to "need work" because of 3 previous review.

klausi’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.