Features

Field Import module enables you to import fields to a content type from a csv file.
Fields can be imported into an existing content type or a new one which will be created upon import.
Drupal naming conventions should be followed for the fields to be imported.

Basic Installation & Configuration

Refer to the Readme.txt file included with the module which contains additional information.

Dependency

Any field type specified in the csv file should have it's dependent module installed else exception will be thrown.
For example to create a field of type "email" the necessary dependent Email module should be installed.

Git Clone Command

git clone --branch 7.x-1.x https://git.drupal.org/sandbox/jack_ry/2788849.git field_import

cd field_import

Project Page - https://www.drupal.org/project/fieldimporter

Reviews of other project

https://www.drupal.org/node/2756909#comment-11652683
https://www.drupal.org/node/2606194#comment-11677249
https://www.drupal.org/node/2771203#comment-11655739
https://www.drupal.org/node/2683891#comment-11736078
https://www.drupal.org/node/2687695#comment-11829023

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jack_ry created an issue. See original summary.

PA robot’s picture

Status: Needs review » 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.

yogeshmpawar’s picture

Title: D7 Field Import » [D7] Field Import
jack_ry’s picture

Issue summary: View changes
jack_ry’s picture

Issue summary: View changes

I have updated with the git clone command

yogeshmpawar’s picture

Issue summary: View changes
yogeshmpawar’s picture

Issue summary: View changes

Pareview.sh is giving following errors.

http://pareview.sh/pareview/httpsgitdrupalorgsandboxjackry2788849git

Will do a manual review in some time.

PA robot’s picture

Status: Needs work » Closed (duplicate)
Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: https://www.drupal.org/node/2803019

Project 2: https://www.drupal.org/node/2796315

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

I'm a robot and this is an automated message from Project Applications Scraper.

jack_ry’s picture

Issue summary: View changes
Status: Closed (duplicate) » Needs work
jack_ry’s picture

Pareview.sh errors are fixed

jack_ry’s picture

Issue summary: View changes
jack_ry’s picture

Status: Needs work » Needs review
jack_ry’s picture

Assigned: jack_ry » Unassigned
jack_ry’s picture

Issue summary: View changes
jack_ry’s picture

Issue summary: View changes
jack_ry’s picture

Issue summary: View changes
jack_ry’s picture

Issue tags: +PAreview: review bonus
jludwig’s picture

Please link to your Project page in the issue.

Automated Review

All Pareview.sh errors are now fixed and it's only recommending setting up tests. http://pareview.sh/pareview/httpsgitdrupalorgsandboxjackry2788849git

Manual Review

Individual user account
Yes
No duplication
The closest functionality out there that I have found allow import/export of field definitions into code, but that is a different use case.
Master Branch
Yes
Licensing
Yes
3rd party assets/code
I'm not sure here. XLSX is technically an Open format, but I'm not sure if including the template.xlsx file violates the the guidelines for 3rd party assets/code. My personal recommendation would be to include a plain text CSV file instead, since it can be imported into anything that takes XLSX easily and could only make the approval process smoother.
README.txt/README.md
Yes
Code long/complex enough for review
Yes
Secure code
Uses appropriate APIs. Security issue: uses 'access administration menu' as the access callback for the form.
Coding style & Drupal API usage
  1. (*) The permission for accessing field_import_form(), 'access administration menu', is innapropriate for a form that allows a user to create fields.
  2. I'd strongly recommend adding permissions specifically for this module rather than just swapping 'access administration menu' to the the existing perm for adding fields. Adding fields via CSV may require additional skills vs. creating them from the UI.
  3. field_create_instance() may throw an exception. Handling this would be ideal.
  4. Missing a space on line 142, after the period in "successful.One" (very minor).

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

This review uses the Project Application Review Template.

jludwig’s picture

Status: Needs review » Needs work
ganesan g’s picture

I tried using this module and found the following errors.

  1. Throwing error when uploading the template file which is given in module. Attaching screenshot(template_error.png). Please use plain text csv format instead of xlsx.
  2. Throwing the error when field name is given in human readable format.
    Attaching screenshot(field_name.png). Please convert human readable name to machine name while saving the field.

Edit: Following error i got when i try to import the field which has human readable name.
FieldException: Attempt to create a field field_Demo_two with invalid characters. Only lowercase alphanumeric characters and underscores are allowed, and only lowercase letters and underscore are allowed as the first character in field_create_field() (line 67 of /var/www/html/gango-learning/modules/field/field.crud.inc).

ganesan g’s picture

FileSize
28.17 KB
14.11 KB

Attaching the screenshot of errors.

jack_ry’s picture

Ganesan Gopal,

I fixed all the errors you have mentioned. About that template error please have a look into read me.txt file. I have mentioned reasons there.

jack_ry’s picture

Hi Ludwig,

I have added a custom permission for my module as per your suggestion.
The reason I have added an xlsx file is to reduce the additional effort/skills required by a user compared to when creating them via UI. Beginners may not be aware of field types as they choose field type in UI. That's why I have provided possible field types as a dropdown in xlsx file which is not possible if it were a csv. I am open to your suggestions and alternatives in this.

jack_ry’s picture

Issue summary: View changes
Status: Needs work » Needs review
PA robot’s picture

Issue summary: View changes

Fixed the git clone URL in the issue summary for non-maintainer users.

I'm a robot and this is an automated message from Project Applications Scraper.

ARUN AK’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus

field_import_info_form_submit(): While importing label is not creating properly from field name. If set "My Name" as FIELDNAME in template, machine name of field will be field_my_name as well as Label also same.

$instance = array(
        'field_name' => $prefix . $field_name_array[$i],
        'entity_type' => 'node',
        'bundle' => $name,
        'description' => $field_array[$i]['description'],
        'required' => $field_array[$i]['required'],
        'label' => $field_name_array[$i],
      );

field_import_info_form(): As the "Skip Header" checkbox is a required field in form, it should be checked always when executing an import. Either remove it or implement conditional field functionality.

Thanks for your participation, but I'm afraid the reviews you did are not very detailed and not really "reviews". Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects. Make sure to read through the source code of the project. For more detail please go here https://www.drupal.org/node/1975228.

jack_ry’s picture

Issue summary: View changes
jack_ry’s picture

Hi Arun,

I have fixed the errors you mentioned. Will do the rest of the reviews in sometimes later. For now I am changing the status.

jack_ry’s picture

Status: Needs work » Needs review
gopagoninarsing’s picture

Status: Needs review » Needs work
FileSize
11.21 KB
85.63 KB
60.84 KB

Hi,

I have tested this module with Drupal 7.53 , below are few findings.

  1. After uploading the CSV file, created the content type with warning.Screenshot Attached.
  2. Label name not uploaded correctly.
jack_ry’s picture

Hi Narsing,

I have fixed the warnings & label issue. Thanks for reviewing my module.

jack_ry’s picture

Status: Needs work » Needs review
jack_ry’s picture

Issue summary: View changes
jack_ry’s picture

Priority: Normal » Major
jack_ry’s picture

Priority: Major » Critical
jack_ry’s picture

Issue summary: View changes
Mario Steinitz’s picture

Priority: Critical » Normal
Status: Needs review » Needs work

Sorry, but pushing the priority won't help. The Git admins seem quite busy (the recent years)...

The module itself seems free from obvious code styling issues.

What bothers me is the function doc headers.

When implementing hooks, it's allright to just use "Implements hook_...().". But for your custom callbacks and forms, please add according parameters and return value descriptions.

Also, please add a brief summary to your submit callback field_import_info_form_submit doc comment block, telling what it does. So nobody has to read over the inline comments within its 100+ lines function body to understand what's going on inside.

Some nice-to-have extras:

I'd suggest placing the admin-link beyond Configuration/Development or Structure instead of the root of the admin menu.
Also, I'm wondering why you provide an *.xlsx file as template, whereas the form is accepting CSV only?

jack_ry’s picture

Mario,

Thanks for the suggestion. I have made the changes.

Regarding the xlsx file, I have explained it here

https://www.drupal.org/project/projectapplications/issues/2796315#commen...

jack_ry’s picture

Status: Needs work » Needs review
jack_ry’s picture

Issue summary: View changes
sleitner’s picture

Status: Needs review » Closed (outdated)

Stable releases for this project are already covered by the security advisory policy.

apaderno’s picture

Status: Closed (outdated) » Closed (duplicate)
Related issues: +#2948023: [D8] Webform Ip Tracking