This module provides new functionality to split a field into three parts. The code for this module is based on the double_field module developed by Chi.

Jen Ware and Ashley Hall, both PhD students in digital rhetoric and new media, created this module for the 2012 Computers and Writing Conference so that presenters can enter data for their conference presentation that will appear in the printed program.

We needed an easy way for our users to create a node with an abstract field and a "presenter info" field. The triple field module allows us to collect the speaker name, university name, and presentation title for all the members of a particular panel accepted to present at the conference. We set the number of values for the field to unlimited so that users can add as many speakers, universities, and presentation titles as needed within the presenter info field. This also allows us to build specific views more easily for displaying the conference schedule on our drupal site.

This module is useful for anyone who is building a conference web site but may also be useful for anyone who needs to collect data from users in a single field with sub-divisions. This module is similar to the field set module but for use cases when separate fields are not desired, this module may provide a better solution.

Project page is here: http://drupal.org/sandbox/knowledges33ker/1392132

Repository page is here: http://drupalcode.org/sandbox/knowledges33ker/1392132.git/commit/7050be8...

This module is for Drupal 7.x

CommentFileSizeAuthor
#14 pareview.txt5.39 KBanwar_max

Comments

jasonrichardsmith@gmail.com’s picture

Status: Needs review » Needs work

Hi,
This seems awesome and thanks for contributing to Drupal. I reviewed the code and noticed that it duplicates a lot of the original module. In general we would recommend collaborating with that project instead of creating a new one. May I suggest expanding the double field module to have a N-field module. Also, the field_collection module in D7 adds very similar functionality. Maybe you could look at that project and file any issues for features you'd like to see added?

Duplication is an ever growing issue with Drupal, please read under the section Module Duplication.

I look look forward to your feedback.

misc’s picture

@knowledges33ker has been contacted to ask if the application is abandoned.

After ten weeks with a status of needs work: the applicant may be contacted by a reviewer to determine whether the application was indeed abandoned. The action taken by the reviewer should be documented in the project application issue.

http://drupal.org/node/894256

knowledges33ker’s picture

Hello all, no this project hasn't been abandoned, I think I forgot to change the needs work status. We've been testing it on several sites and it's been working well. I like the suggestion provided by jasonrichardsmith and will look into collaborating with the double field module developer! My co-collaborator and I were excited to have expanded the module and wanted to share it with the community!

knowledges33ker’s picture

Status: Needs work » Needs review
chi’s picture

Hey, knowledges33ker.
I agree with jasonrichardsmith. It would be better to have one N-Field module instead of Triple field or Quadruple Field. Look this issue: #1273510: More than double field, x# field? for futher information.
Yes, there is Field collection module but it based on Entity API and operate with Fields not with FAPI elements as this one.
I suggest you give users possibility to choose number of subfields.
Good Luck!

sbrattla’s picture

I absolutely agree with Chi in #5. I've been looking for this kind of module in earlier projects...that is; a module where i could define two, three of four fields depending on the use case. It would be a great feature, and you would most likely see much more use of your module as people will find it suitable for far more scenarios.

jygastaud’s picture

As mentioned in the issue link posts by Chi, I thought field group multiple can do that: http://drupal.org/project/field_group_multiple

geertvd’s picture

I agree with Chi, could you look into adding an x#field module, the field_group_multiple seems nice but it looks like it is used for more advanced edit pages.
Some extra functionality could also be linking the 3 fields to each other.
For example if the maxlength is reached in the first textfield, automatically give focus to the second one.
Off course this should be optional.

Also you've got some code styling issues
http://ventral.org/pareview/httpgitdrupalorgsandboxknowledges33ker139213...

novalnet’s picture

Hi,

Manual Review :

1. It seems README.txt is missing, see the guidelines for in-project documentation.
2. triple_field.info => Please remove version, project and datestamp from .info file.It will be added by drupal.org
3. You should PARREVIEW your script. You have many errors.
See http://ventral.org/pareview/httpgitdrupalorgsandboxknowledges33ker139213...
4. triple_field.install :
25 | ERROR | Spaces must be used to indent lines; tabs are not allowed
25 | ERROR | Line indented incorrectly; expected at least 2 spaces, found 1
25 | ERROR | Array indentation error, expected 4 spaces but found 1
26 | ERROR | Array indentation error, expected 3 spaces but found 6
27 | ERROR | Array indentation error, expected 3 spaces but found 6
28 | ERROR | Array indentation error, expected 3 spaces but found 6
29 | ERROR | Array closing indentation error, expected 1 spaces but found 4
34 | ERROR | Spaces must be used to indent lines; tabs are not allowed
34 | ERROR | Line indented incorrectly; expected at least 2 spaces, found 1
34 | ERROR | Array indentation error, expected 4 spaces but found 1
39 | WARNING | A comma should follow the last multiline array item. Found:
| | $indexes
41 | ERROR | Files must end in a single new line character

aaronelborg’s picture

Hi knowledges33ker.

Looks like the stuff pointed out by Novalnet still hasn't been fixed but I'm sure you're aware of that.

It looks like you're working on the master branch, which is not the preferred way within Drupal. Also, when I do a 'git branch -a' I'd expect to see something similar to this:
* 7.x-1.x
remotes/origin/7.x-1.x
remotes/origin/HEAD -> origin/master
remotes/origin/master

Instead I see:
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master

So it doesn't look like there's a proper, working branch to switch to? You should probably fix that.

Also, there's a 'rogue' 'triple_field' folder within the main 'triple_field' directory that doesn't need to be there.

You don't need to include a 'License.txt' file as the Drupal.org packaging script will add one automatically.
Looks like you've included a 'README' but it's been named 'readme' in lowercase as opposed to upper case which is the convention.

Currently your info file is full of kruft. This would suffice:

name = Triple field
description = Provides a field with three text widgets
package = Fields
core = 7.x

You know how you might be able to just create the uber, all-encompassing 'Multi-field Module'? OK....maybe that's a bad name. Maybe the forementioned 'N-field module'? (Oooooh......The "Nth-Field Module"!!!!!)

Give the user a number spinner to choose from and then you could do something like this:

array('first', 'second', 'third', .....);
foreach ($array as $key => $value) {
  echo "$value index is $key";
}

.....so that then you could change the x number of text-boxes to whatever and then nobody would ever have to worry about the 'Quad-field Module' or the even more horrifying 'Penta-Field Module'. I mean, really, imagine this situation by the time Drupal 12 rolls around. Things could get ugly!

THINK OF THE CHILDREN!!!!

;-)

Finally, it's probably beside the point but in your .module file the code sniffer's finding all sorts of problems:

/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:19:21: error - If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:49:5: error - Array indentation error, expected 5 spaces but found 4
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:50:5: error - Array indentation error, expected 5 spaces but found 4
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:51:5: error - Array indentation error, expected 5 spaces but found 4
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:52:5: error - Array indentation error, expected 5 spaces but found 4
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:53:5: error - Array indentation error, expected 5 spaces but found 4
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:54:5: error - Array indentation error, expected 5 spaces but found 4
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:55:5: error - Array indentation error, expected 5 spaces but found 4
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:56:3: error - Array closing indentation error, expected 3 spaces but found 2
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:74:44: error - Whitespace found at end of line
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:75:28: error - There must be no space between the Array keyword and the opening parenthesis
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:78:1: error - Spaces must be used to indent lines; tabs are not allowed
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:78:5: error - Line indented incorrectly; expected at least 6 spaces, found 4
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:78:5: error - Array indentation error, expected 10 spaces but found 4
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:79:11: error - Whitespace found at end of line
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:90:15: error - There must be no space between the Array keyword and the opening parenthesis
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:103:1: error - Spaces must be used to indent lines; tabs are not allowed
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:103:3: error - Array indentation error, expected 8 spaces but found 2
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:158:32: error - There must be no space between the Array keyword and the opening parenthesis
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:169:40: error - Whitespace found at end of line
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:170:1: error - Spaces must be used to indent lines; tabs are not allowed
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:170:2: error - Line indented incorrectly; expected at least 4 spaces, found 1
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:179:3: error - AS keyword must be lowercase; expected "as" but found "AS"
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:187:1: error - More than 2 empty lines are not allowed
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:192:15: error - There must be no space between the Array keyword and the opening parenthesis
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:201:1: error - Spaces must be used to indent lines; tabs are not allowed
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:201:2: error - Line indented incorrectly; expected at least 2 spaces, found 1
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:201:2: error - Array indentation error, expected 4 spaces but found 1
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:202:7: error - Array indentation error, expected 3 spaces but found 6
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:203:7: error - Array indentation error, expected 3 spaces but found 6
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:204:5: error - Array closing indentation error, expected 1 spaces but found 4
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:291:5: error - Line indented incorrectly; expected 2 spaces, found 4
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:293:3: error - Closing brace indented incorrectly; expected 4 spaces, found 2
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:311:1: error - Spaces must be used to indent lines; tabs are not allowed
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:311:3: error - Line indented incorrectly; expected at least 6 spaces, found 2
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:311:3: error - Array indentation error, expected 8 spaces but found 2
/var/www/html/drupal7/sites/all/modules/triple_field/triple_field.module:365:1: error - Files must end in a single new line character

Well, I hope I gave you some good insight.

Is this module still in development? Hope I didn't just waste my time.

Keep on keepin' on, amigo!

-Aaron

patrickd’s picture

@Aaron
Please do not paste the full results into the issue, as giant ‘wall-of-wrong’ posts are extremely demotivating to applicants, rather provide a link to the results (or post as an attachment) in the application thread. thanks

aaronelborg’s picture

My apologies, patrickd.

I figured that since I elaborated on a few other things the 'wall of wrong' copy/paste wouldn't be so bad.

Won't do it again.

-still living and learning up in here,
Aaron

knowledges33ker’s picture

Hi everyone,

Thanks for all the helpful feedback. This is my first time going through the process so the learning curve is still pretty steep.

I'm working with a colleague here at UNC who is helping me interpret the comments above and we are now collaborating to develop this into the "n field" module so that (hopefully) we can avoid the problem Aaron mention in #10 above.

Thanks again for all your comments. More soon.

-Ashley

anwar_max’s picture

StatusFileSize
new5.39 KB

Manual Review:

Looks good and you are following proper coding standards. Please try to resolve the automated review issues.

Automated Review:

It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Review of the master branch:

  • README.txt is missing, see the guidelines for in-project documentation.
  • Remove LICENSE.txt, it will be added by drupal.org packaging automatically.
  • Remove "version" from the info file, it will be added by drupal.org packaging automatically.
  • Remove "project" from the info file, it will be added by drupal.org packaging automatically.
  • Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically.
  • Drupal Code Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.

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. You have to get a review bonus to get a review from me.

knowledges33ker’s picture

Thanks again all for the really helpful responses. I'm working now to fix the errors in the current version of this to run through the code sniffer and then upload into a version specific branch and will then be working with a colleague to update to an nth field module.

mitchell’s picture

Status: Needs review » Postponed (maintainer needs more info)

@knowledges33ker: It looks as though Chi and AaronELBorg had some very insightful comments, and that you've taken them into account to extend triple field into n field.

Also, from my investigation, it appears to me that Field Group multiple has gotten the furthest in this arena, so it would be very helpful if you could test that module and report how it suits your needs, too. However, Double Fields also appears to be picking up users, so I hope Chi will help clarify #1671814: What's the relation to Field Group multiple?.

Please let us know if we can help guide you any better, so I'll mark this as waiting for feedback from you until we know which path you intend to take.

Thanks and good luck!!

chi’s picture

Seems to be fixed. composed field is module from FranciscoLuz that allows you to split a single field into as many sub-fields as you like.

Also there is sandbox project based on Form builder from Swentel.

klausi’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

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