This project is no longer maintained and no further public releases are planned.

No further support will be given.

Feel free to fork the git repository.

PreProcessor\LoadDB

Prefills form fields with values from configured database fields. Config is done for each step and for each form field.

Version added

1.0.0

TypoScript path

plugin.Tx_Formhandler.settings.preProcessors.x copy to clipboard

Example code

preProcessors {
    1.class = PreProcessor\LoadDB
    1.config {
        
        #Fields shown in the first step of the form
        1 {

            #Format is: [field].mapping = [db_field]
            contact_via.mapping = email
        }
        
        select {
            table = my_table_name
            #selectFields = *
			#where =
			#groupBy =
			#orderBy =
        }
    }
}

Properties

.[step].[field].mapping

Maps a DB field to a form field.

Data type

String | cObj

Version added

1.0.0

.[step].[field].separator

The field separator, e.g. comma

Data type

String | cObj

Version added

1.0.0

.[step].[field].preProcessing

Preprocesses the values before loading them into the session.

Data type

cObj

Version added

1.0.0

Example code

fields {
  header {
    preProcessing = USER
    preProcessing.userFunc = user_helper->appendSomething
    mapping = firstname
  }
}

.[step].[field].postProcessing

Postprocesses the values before loading them into the session. With this you can override the processing of Formhandler, if you are not satisfied with it.

Data type

cObj

Version added

1.0.0

Example code

fields {
  header {
    postProcessing = USER
    postProcessing.userFunc = user_helper->appendSomething
    mapping = firstname
  }
}

.[step].[field].type

Specifies the type of the field.

Currently this is only used for file upload fields.

This setting is mandatory for file upload fields preloaded from the DB!

Data type

String | cObj

Version added

1.0.0

Example code

type = upload

.select.

Since version 2.0, select is a pure TypoScript select. This way, you can configure joins for your select.

The only difference is, that Formhandler doesn't require a pidInList to be set.

Data type

Array

Version added

2.0.0

.select.table

The table to fetch data from. Required.

Data type

String | cObj

Version added

1.0.0