0

I have a tx_form to create and edit items of a custom model. The form itself does not contain any Finisher. Within typoscript, I add the Finishers.

For the creation I add the SaveToDatabaseFinisher with mode=insert and a RedirectFinisher with use of {SaveToDatabase.insertedUids.0}. That works.

For the editing I add the SaveToDatabaseFinisher with mode=update and a whereClause, where I map the hidden and prefilled field uid and the pid from a constant. That does not work, the response is an empty page with the parameters ?tx_form_formframework[action]=perform &tx_form_formframework[controller]=FormFrontend

Where am I wrong?

['{$plugin.tx_extension.settings.formMode}' == 'insert']
plugin.tx_form {
    settings {
        formDefinitionOverrides {
            formid {
                finishers {
                    # savetodatabase insert
                    0 {
                        identifier = SaveToDatabase
                        options {
                            0 {
                                table = tx_extension_domain_model_item
                                mode = insert
                                databaseColumnMappings {
                                    pid {
                                        value = {$plugin.tx_extension.persistence.storagePid} 
                                    }
                                    tstamp {
                                        value = {__currentTimestamp}
                                    }
                                    crdate {
                                        value = {__currentTimestamp}
                                    }
                                }
                                elements {
                                    form-field {
                                        mapOnDatabaseColumn = field
                                    }
                                }
                            }
                        }
                    }
                    # redirect detail
                    1 {
                        identifier = Redirect
                        options {
                            pageUid = {$plugin.tx_extension.settings.listPid}
                            additionalParameters = tx_extension_pi1[action]=detail&tx_extension_pi1[controller]=Item&tx_extension_pi1[item]={SaveToDatabase.insertedUids.0}
                        }
                    }
                }
            }
        }
    }
}       
[end]

['{$plugin.tx_extension.settings.formMode}' == 'edit']
plugin.tx_form {
    settings {
        formDefinitionOverrides {
            formid {
                finishers {
                    # savetodatabase update
                    0 {
                        identifier = SaveToDatabase
                        options {
                            0 {
                                table = tx_extension_domain_model_item
                                mode = update
                                whereClause {
                                    uid = '{uid}'
                                    pid = {$plugin.tx_extension.persistence.storagePid}
                                }
                                databaseColumnMappings {
                                    tstamp {
                                        value = {__currentTimestamp}
                                    }
                                }
                                elements {
                                    form-field {
                                        mapOnDatabaseColumn = field
                                    }
                                }
                            }
                        }
                    }
                    # redirect detail
                    1 {
                        identifier = Redirect
                        options {
                            pageUid = {$plugin.tx_extension.settings.listPid}
                            additionalParameters = tx_extension_pi1[action]=detail&tx_extension_pi1[controller]=Item&tx_extension_pi1[item]={uid}
                        }
                    }
                }
            }
        }
    }
}
[end]

[request && traverse(request.getQueryParams(), 'item') > 0]
plugin.tx_form {
    settings {
        formDefinitionOverrides {
            formid {
                renderables {
                    # page
                    0 {
                        renderables {
                            # fieldset
                            0 {
                                renderables {
                                    # uid
                                    0 {
                                        defaultValue = CONTENT
                                        defaultValue {
                                            table = tx_extension_domain_model_item
                                            select.pidInList = {$plugin.tx_extension.persistence.storagePid}
                                            select.where.dataWrap = uid = {GP:item}
                                            renderObj = TEXT
                                            renderObj.required = 1
                                            renderObj.field = uid
                                        }
                                    }
                                    # form-field
                                    1 {
                                        defaultValue = CONTENT
                                        defaultValue {
                                            table = tx_extension_domain_model_item
                                            select.pidInList = {$plugin.tx_extension.persistence.storagePid}
                                            select.where.dataWrap = uid = {GP:item}
                                            renderObj = TEXT
                                            renderObj.required = 1
                                            renderObj.field = field
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
[end]

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.