Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Nov 2012 at 14:40 UTC
Updated:
8 Feb 2013 at 00:35 UTC
Jump to comment: Most recent file

Comments
Comment #1
adamelleston commentedHi,
There is already a chosen field. From a quick glance they seem very similar. If your project is clearly different then can you update your project page and explain the differences.
http://drupal.org/project/chosen
Comment #2
sreynen commentedHi ann.matrosova,
Thanks for your contribution. I did a manual review and it looks pretty good in general, but I noticed a few issues:
1. I think chosenselect_autocomplete() should look a bit more like taxonomy_autocomplete(), specifically in the way you're loading arguments. Directly referencing $_GET is pretty rare in PHP code.
2. chosenselect_autocomplete() returns plain text on an error but JSON on success. I didn't see anything in the JavaScript suggesting it would handle these different response formats, but maybe that's in the Select2 plugin. I'm not sure this is a problem, but it looks like it might be, so maybe you can confirm this is how the JavaScript expects errors?
3. There's some TODO comments in the JavaScript. These should be done before a release.
The automated review also found some code formatting issues. Nothing there looks very important, but worth fixing anyway.
Comment #3
kevinquillen commentedSounds like the major difference between the two projects is Chosen integrates the jQuery plugin into the Drupal admin UI so you can enter classes you want Chosen to apply itself to, whereas this module wants to make it available as a new FormAPI element.
Comment #4
sreynen commentedThis module also uses Select2, which seems to be a fork of the Chosen plugin. So changing the name of the project might be good to reduce confusion between the two. Describing the differences in the project description is important either way.
Comment #5
vineet.osscube commentedHi,
I suggest you to take a look at this page:
http://ventral.org/pareview/httpgitdrupalorgsandboxannmatrosova1817534git
Here you can check source code whether it meets drupal coding standards or not, and advise you what to change in your code. You can repeat review after your commits, and can fix those errors.
Comment #6
ann.matrosova commentedHi,
Module Chosen select has some advantages:
- You can create your custom form element ('#type' => 'chosenselect'). It is not only a widget plugin
- It has an autocomplete taxonomy reference widget.
- It is based on Select2 library (http://ivaynberg.github.com/select2/) which is more powerful than Chosen library
- And our js files are loading only in cases where they are needed, not on every page
Thank you for issues.
We use $_GET because implementation is different from taxonomy autocompletion, if you ment to provide a security on using $_GET, on last commit filter_xss() function was applied.
And about JSON response, it is just Select2 implementation.
Comment #7
pere orgaIf this module doesn't use the Chosen library why do you put the word 'chosen' in its name?
Comment #8
pere orgainside css/chosenselect_block.css. Otherwise in some themes (such as the default theme in Commerce Kickstart) the field is not displayed correctly (see screenshot).
Comment #9
pere orgaComment #10
ardas commentedDear Pere,
1. JS degrade feature will be developed later. It is not very important feature since everybody today has JS even mobiles support it. So, this is a very low priority.
2. We didn't test this module with Commerce Kickstart as well as other open Drupal builds. We realize that there may be several conflicts but it is a matter of time we can invest right now into development.
We want to launch this module into community and give people ability to start using it. Later on, we will gather requirements and be improving it. So, lets start with some version that will satisfy many people as it is now.
Thank you for your help and review!
Comment #11
ann.matrosova commentedHi,
I've fixed two first issues. Now user gets a message that select2.js file is not found. And added into css file:
box-sizing: content-box;Comment #12
ardas commentedBecause Chosen sounds like a normal name that is quite famous today. Select2 doesn't mean anything.. it is too technical and not user-friendly. Our module behaves like Chosen and it is important to make its name self explanatory.
Can you imagine this:
$form['myselect']['#type'] = 'select2';
As for me it sounds strange... no semantic in 'select2' naming at all.
The module uses another library but who cares? Developers just need to create a 'chosenselect' element.
And what if tomorrow Select2 will be stopped in favor of a more powerful Select3 component like it usually happens in open source community? We will just change a library but keep the API the same.
The main point for us was how people would use the form element. We think 'chosenselect' is a good name for a form element.
Comment #13
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.
If you reopen this please keep in mind that we are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)
Comment #13.0
klausiEdit description.