The 'Numbered Multivalue fields' module is a small module which adds numbers to the drag table on multiple value fields within administration.
This currently serves two purposes;
First its useful for knowing which value your at, specifically when you have a large number of values or your value field is large e.g. Field collection Items.
Second it allows you too keep track of rows after a reorder.
Admins can setup specific fields so numbering only shows on certain fields, or they can have it set globally. They can also have exclusions to the list.
Future plans
- Allow admins to decide if numbers get updated on reorder or not.
- Alphabet Chars/Roman Numerals
My Background
Worked with Drupal for 3-4 years as Lead Developer.
Sandbox Link
https://www.drupal.org/sandbox/ocastle/2329803
Git Clone Command
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/ocastle/2329803.git numbered_multivalue_fields
cd numbered_multivalue_fields
Pareview Report
http://pareview.sh/pareview/httpgitdrupalorgsandboxocastle2329803git
Comments
Comment #1
ocastle CreditAttribution: ocastle commentedComment #2
PA robot CreditAttribution: PA robot commentedGit clone command for the sandbox is missing in the issue summary, please add it.
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.
Comment #3
ocastle CreditAttribution: ocastle commentedAdded git clone command as mentioned by review robot.
Comment #4
ocastle CreditAttribution: ocastle commentedComment #5
PA robot CreditAttribution: PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxocastle2329803git
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #6
ocastle CreditAttribution: ocastle commentedPareview Report errors fixed.
Comment #7
ocastle CreditAttribution: ocastle commentedComment #8
er.pushpinderrana CreditAttribution: er.pushpinderrana commentedReviewers examine your code, if Issue status is Needs Review. So switching status from Active to Needs Review. You can go through from following links again for ensuring a smooth review.
https://www.drupal.org/node/1011698
https://www.drupal.org/node/1187664
Comment #9
ocastle CreditAttribution: ocastle commentedThanks for the note. Much Appreciated.
Comment #10
pkamerakodi CreditAttribution: pkamerakodi commentedHi,
Thanks for the contribution, mean while some small suggestions if you like to update.
Automated Review as some warnings and errors
http://pareview.sh/pareview/httpgitdrupalorgsandboxyelban2330529git
Manual Review
Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements
3rd party code
Yes: Follows the guidelines for 3rd party code.
README.txt/README.md
Yes
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
YES
Coding style & Drupal API usage
1) In numbered_multivalue_fields_admin i dont think checkbox has a attribute multiple
2) This is line not needed $form['#submit'][] = 'numbered_multivalue_fields_admin_submit'; by default it will be called
3) Avoid creating unnecessary variable
$active = variable_get('numbered_multivalue_fields_active', 1);
if (!$active) {
return array();
}
could be changed to
if (!variable_get('numbered_multivalue_fields_active', 1)) {
return array();
}
4) If possible in theme_numbered_field_multiple_value_form try returning a renderable array so that it will be easier for overriding. Atleast try using theme_html_tag for creating div markup
5) Delete the variables in uninstall hook
6) missing hook_help
7) i didnot see hook_theme implemented.
Prajwal
Comment #11
pkamerakodi CreditAttribution: pkamerakodi commentedComment #12
ijortengab CreditAttribution: ijortengab commentedmanual review
Your git clone must be
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/ocastle/2329803.git numbered_multivalue_fields
please change in issue summary.
your code is a potential conflict if there theme which implemented
theme_field_multiple_value_form in their template.php.
for example: i use a bartik theme.
in bartik's template.php, I add function
when I install your module, my bartik_field_multiple_value_form() not work.
IMHO, hook_theme_registry_alter intended only for the use of custom modules
to particular websites.
I suggest you to use preprocess function.
I give you a patch.
Comment #13
ijortengab CreditAttribution: ijortengab commentedComment #14
ocastle CreditAttribution: ocastle commentedUpdated Git Clone URL
Comment #15
ocastle CreditAttribution: ocastle commentedThanks for the feedback.
@pkamerakodi
I've made the relevant suggested changes on unnecessary variables, and also implemented hook_help.
In regards to removing $form['#submit'][]; I've added this to ensure it gets called before system_settings_form, as this preprocesses the $form_state['values'] ready for system_settings_form_submit().
@ijortengab
Thanks for the patch. A much better way to go about it. - I was anxious about completely overriding the theme function, but wasn't sure the best way to go about it. Thanks for the help here. I've applied the patch and commited it.
I did start to get errors on this line:
if (isset($values['data'][1]) && preg_match('/\[numbered_multivalue_fields\]/', $values['data'][1])) {
Mentioning that $values['data'][1] wasn't a string, so i've put the check in place.
Comment #16
ijortengab CreditAttribution: ijortengab commentedHi @ocastle
Your idea is great.
About configuration, I think is better if not only per field_name
but also per field_name per entity_type per bundle.
example:
i have field_links, it is multivalue.
field_links is part of node>article and part of taxonomy_term>tags
i want numbered field_links only in node>article but not in taxonomy_term>tags
so I give you a patch to implement that.
the patch is inspire form module https://www.drupal.org/project/custom_add_another
this patch is makes you no longer need function hook_menu and file numbered_multivalue_fields.admin.inc
Comment #17
ocastle CreditAttribution: ocastle commented@ijortengab
Thanks. Thats a good idea!
Let me take a look at that patch.
Comment #18
ocastle CreditAttribution: ocastle commentedOkay, I think this is a better way to go about it.
I've patched the files, updated the docs and removed the unnecessary code.
Take a look.
Comment #19
ocastle CreditAttribution: ocastle commentedPareview has some suggestions since the updates.
Comment #20
ocastle CreditAttribution: ocastle commentedComment #21
ijortengab CreditAttribution: ijortengab commentedGreat, your module combined custom_add_another very suitable.
Now, as said by PA robot, you need review bonus like me.
Comment #22
naveenvalechaHi @ocastle
Thanks for your contribution. Nice module !
Automated Review
Review of the 7.x-1.x branch (commit 730d35a):
Manual Review
The coding style seems to me.
This review uses the Project Application Review Template.
I have not seen any release blocker so far please help to review other project applications to get a review bonus. This will put you on the high priority list, then git administrators will take a look at your project.
Here are some of the queries
Thanks Again!
Comment #23
gisleAutomated Review
PAReview came up clean.
Manual Review
The project is only 128 lines and 7 functions of PHP code (includings comments and blank lines), just passing the bare minumum (120 lines and 5 functions).
However, I belive this is just enough for the "Create Full Projects" permission. (But I shall leave it to a git administrator to make a final call on this.)
The starred items (*) are big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are release blockers and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
There are IMHO no more blockers. Moving to RTBC. Note that promotion will not happen until a git administrator has given this a second set of eyeballs.
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.
To give your application a higher priority, please join the review bonus system. If you participate in the system by doing manual reviews, you can put yourself on the high priority list. Applications with
PAReview: bonus
tag are more likely to receive attention from reviewers and git administrators.Comment #24
kscheirerThis module is short, but there's good code in the other sandbox as well (Bootstrap Formatters), so
Thanks for your contribution, ocastle!
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.