This module adds a new widget to the Node Reference field. It allows the administrator to select an image field from the referenced content types and an image style to output the field as a grid of selectable images, where the user can select a node by clicking on an image. The refered content type must have an Image field for this widget to work correctly.

This is a Drupal 7 only module.

project page: http://drupal.org/sandbox/skein/1429290

git: git clone http://git.drupal.org/sandbox/skein/1429290.git node_reference_selector_widget

Comments

eugene.ilyin’s picture

Status: Needs review » Needs work

Hello. I spent manual review of your module.

'#title' => check_plain(t('!name Image Field', array('!name' => node_type_get_name($type)))),
Use @ instead of ! then check_plan will not need.

function nodereference_selector_field_widget_form - double space between function and name.

skein’s picture

Thanks for the quick review.

The issues you mentioned are now fixed and commited

skein’s picture

Status: Needs work » Needs review

Forgot to change status

vaibhavjain’s picture

Status: Needs review » Needs work

Hello skein,

Please move your code from master repo to version specific branch. Check this for more - http://drupal.org/node/1127732

skein’s picture

Status: Needs work » Needs review

done

gopagoninarsing’s picture

Status: Needs review » Needs work

There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732

skein’s picture

Status: Needs work » Needs review

#6 removed evrything except README.txt

KhaledBlah’s picture

First of all, thank you for contributing!

Automatic review of 7.x-1.x branch:
Review of the 7.x-1.x branch:

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. Get a review bonus and we will come back to your application sooner.

FILE: ...all/modules/pareview_temp/test_candidate/css/nodereference_selector.css
--------------------------------------------------------------------------------
FOUND 5 ERROR(S) AFFECTING 5 LINE(S)
--------------------------------------------------------------------------------
 13 | ERROR | Multiple CSS properties should be listed in alphabetical order
 17 | ERROR | Multiple CSS properties should be listed in alphabetical order
 18 | ERROR | Multiple CSS properties should be listed in alphabetical order
 20 | ERROR | Multiple CSS properties should be listed in alphabetical order
 22 | ERROR | Multiple CSS properties should be listed in alphabetical order
--------------------------------------------------------------------------------

Source: http://ventral.org/pareview - PAReview.sh online service

Manual review of 7.x-1.x branch:

  1. function nodereference_selector_field_widget_info() Is there a hook_widget_info() in D7? It's not listed on api.drupal.org but I am not very familiar with CCK in 7.x
  2. line 84 of nodereference_selector.module: $query = db_select('node', 'n'); - Please consider using hook_query_alter as per When to use db_rewrite_sql or hook_query_alter()
  3. Please consider use the placeholders for readability and security. Please have a look here.
KhaledBlah’s picture

Status: Needs review » Needs work

status updated.

skein’s picture

Status: Needs work » Needs review

0. Fixed the Code Sniffer Issues
1. it's hook_field_widget_info : http://api.drupal.org/api/drupal/modules!field!field.api.php/function/ho...
2.Added a tag for hook_query_alter support
3.Not sure what you mean here. I only use db_select, while placeholders are used in db_query

KhaledBlah’s picture

1. D'Oh! I must have been blind!
3. Point taken!

As far as I can tell this is good to go. Maybe a more experienced reviewer could review it and see if it is RTBC ready.

funkeyrandy’s picture

hmm..my selections are not saving...has anyone experienced this? its a multi select field

skein’s picture

Hello. I just tried my latest code with a multi selection field. Everything worked. If you're still experiancing the issue can you provide a test website with an example or your field configuration settings?

brunogoossens’s picture

Status: Needs review » Reviewed & tested by the community

Review by Pareview:
Good.

Manual review:
Major issues:
None

Small issues:

  • I can enable node types that don't have an image field. Therefore I can not complete the next settings page where I have to chose the image field. I have to go back and than it works. Maybe a check for this can be made at the first settings page.
  • $(".field-widget-nodereference-selector input").hide();
    Why is this code in js file and not in css?
  • You have some kind of javascript searcher of your nodes. It's better to implement this with the form API with the ajax parameters. Then your input field will also be themed correctly. It's also better if you want to extend your module with more advanced searches. With your way of doing things, you can only search the image title.

I also tested the multiple select and it works fine.

klausi’s picture

Status: Reviewed & tested by the community » Fixed

Sorry for the delay, but you have not listed any reviews of other project applications in your issue summary as strongly recommended in the application documentation.

Thanks for your contribution, skein! Welcome to the community of project contributors on drupal.org.

I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.

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.

As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.

Thanks to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

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