Another module https://www.drupal.org/project/bulk_user_registration has a useful feature which is to provide a sample CSV, so that (1) i know i'm entering the columns correctly and (2) i don't have to type it up manually.

Would be a great feature to add to this module

Comments

AaronBauman created an issue. See original summary.

aaronbauman’s picture

Status: Active » Needs review
StatusFileSize
new3.13 KB

This patch adds a "Generate Sample" button to the form, which when clicked sends a CSV response based on the selected fields.

aaronbauman’s picture

StatusFileSize
new2.98 KB

Fixed path

eahonet’s picture

StatusFileSize
new11.19 KB

@AaronBauman very cool patch. Adds a simple button, generates a csv.

The concern I have is the unneeded columns in the CSV. When I tested the code, it generates a lot of columns with the title "0" (one for each field NOT selected). See attached.

aaronbauman’s picture

Status: Needs review » Needs work
aaronbauman’s picture

Status: Needs work » Needs review
StatusFileSize
new2.97 KB
new964 bytes

Good catch - thanks for the feedback.

array_filter to the rescue, and removed some cruft

  • AaronBauman authored 48130a8 on 2.0.x
    Issue #3215680 by AaronBauman: Feature request: Provide a CSV example /...
eahonet’s picture

Status: Needs review » Fixed
eahonet’s picture

Status: Fixed » Closed (fixed)