ProcessWire icon indicating copy to clipboard operation
ProcessWire copied to clipboard

[ProcessFieldExportImport] Long Functions (?)

Open LimeWub opened this issue 8 years ago • 0 comments

Hello there :)

This is more of a question than an issue.

I am currently working on a module to import a set of preset templates/fields for every new PW installation; so as to speed up development time at the beginning of a project.

I am looking into the wire/ProcessTemplate/ProcessTemplateExportImport.php (and the ProcessField equivalent) and I can see I could make use of some of the functionality in there -in particular ___buildImport() -.

However, this function expects get and post input to work. I think if I were to provide a json string instead (as a method parameter) this should be working fine. Am I wrong to think that? Looking at the method it's also 150-ish lines long.

Basically is there a reason this is one method or would it be ok for me to break it down into at least 2 (Data Aquisition + Processing) methods and commit this back?

LimeWub avatar Oct 02 '17 11:10 LimeWub