Support

Home Forums Event Espresso Premium Consider adding a filter to change the delimiter for your fputcsv2 function

Consider adding a filter to change the delimiter for your fputcsv2 function

Posted: February 23, 2015 at 2:52 am

Viewing 2 reply threads


tigerton

February 23, 2015 at 2:52 am

Hi!

I’m currently creating a complete custom CSV export plugin for EE since our client has some specific requirements for the output.

However in the meantime I figured I’d have them use the builtin registration export in EE. The only problem is that you have a hardcoded delimiter value in your custom fputcsv2 function in EE_CSV.class.php to “,” which is fine for US but not for us. If we open a CSV with , as delimiter everything ends up in a single cell. We use ; (not sure how widespread it is but I’m pretty sure that it applies for most of europe at least).

I’ve changed the hardcoded value but you should consider adding a filter for it so it can be altered without messing with core. Gravity forms have implemented this solution which lets me change it easily:


add_action("gform_export_separator", "change_separator", 10, 2);
	function change_separator($separator, $form_id){
	    return ";";
	}

Also, I’m considering letting others in the EE community take advantage of the addons I’ve created for this project. What’s the policy on that?


Josh

  • Support Staff

February 23, 2015 at 8:16 am

Hi Jonathan,

We welcome pull requests for adding filters like this one over on our Github repository. Remember that any new FEATURES in a pull request should be based off of the master branch.

We currently do not have a policy for releasing add-ons, so you’re welcome to release your add-ons. Please note that Event Espresso support staff will not be able to offer support for your add-ons if you choose to release them.


tigerton

February 23, 2015 at 8:47 am

Hi Josh,

Ah yeah of course. I might make a pull request out of it if I can find the time. I just figured it would be something noteworthy for you as well 🙂

Viewing 2 reply threads

The support post ‘Consider adding a filter to change the delimiter for your fputcsv2 function’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso