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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ocastle’s picture

Issue tags: -Drupal.org Project Application
PA robot’s picture

Status: Active » Needs work

Git 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.

ocastle’s picture

Issue summary: View changes
Status: Needs work » Active

Added git clone command as mentioned by review robot.

ocastle’s picture

Issue summary: View changes
PA robot’s picture

Status: Active » Needs work

There 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.

ocastle’s picture

Status: Needs work » Active

Pareview Report errors fixed.

ocastle’s picture

Issue summary: View changes
er.pushpinderrana’s picture

Status: Active » Needs review

Reviewers 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

ocastle’s picture

Thanks for the note. Much Appreciated.

pkamerakodi’s picture

Hi,

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

pkamerakodi’s picture

Status: Needs review » Needs work
ijortengab’s picture

manual 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

/**
 * Implements theme_field_multiple_value_form().
 */
function bartik_field_multiple_value_form($variables){
  // bla bla
  return $output;
}

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.

ijortengab’s picture

ocastle’s picture

Issue summary: View changes

Updated Git Clone URL

ocastle’s picture

Status: Needs work » Needs review

Thanks 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.

ijortengab’s picture

Status: Needs review » Needs work
FileSize
9.03 KB

Hi @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

ocastle’s picture

@ijortengab
Thanks. Thats a good idea!
Let me take a look at that patch.

ocastle’s picture

Status: Needs work » Needs review

Okay, 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.

ocastle’s picture

Status: Needs review » Needs work

Pareview has some suggestions since the updates.

ocastle’s picture

Status: Needs work » Needs review
ijortengab’s picture

Great, your module combined custom_add_another very suitable.

Now, as said by PA robot, you need review bonus like me.

naveenvalecha’s picture

Hi @ocastle
Thanks for your contribution. Nice module !

Automated Review

Review of the 7.x-1.x branch (commit 730d35a):

  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and fragmentation.
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: Follows the guidelines for in-project documentation and the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes. If "no", list security issues identified.
Coding style & Drupal API usage

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

  1. Image field with "Numbered MultiValue Field" enabled it is now showing number.if it is not with image field then please specify on the project page.Please correct me if I am wrong somewhere.
  2. Fields with "Autocomplete widget" selected.We choose the selected item in the autocomplete seperated by comma.So I think there is not need on the field with the Autocomplete widget.What do you think ?
    1. Thanks Again!

gisle’s picture

Status: Needs review » Reviewed & tested by the community

Automated Review

PAReview came up clean.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Marginally follows the guidelines for project length and complexity.

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.)
Secure code
Yes: Meets the security requirements
Coding style & Drupal API usage
  1. There is no schema and not enough of a user inteface to review how author handles user input security, but coding style is fine and it show fair use of the Drupal API.
  2. There is a typo in hook_help: "Numberd MultiValues".



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.

kscheirer’s picture

Status: Reviewed & tested by the community » Fixed

This 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.

Status: Fixed » Closed (fixed)

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