TYPO3 tx_form doesn't render submit button - typo3

I have a 10.4.18 installation, on another project that works fine (which i copy to the current). In my current project they render the submit button like this:
<span class="btn-group next submit">
Absenden
</span>
There is no button and not clickable, anyone have an idea? There are no template overrides or custom configuration, form is added in template (without I get an exception) so that works.
The yaml configuration:
renderingOptions:
submitButtonLabel: Absenden
identifier: kontakt
label: Kontakt
type: Form
prototypeName: standard
finishers:
-
options:
subject: 'Kontakt über Website'
recipients:
test#test.de: 'Test Webmailer'
senderAddress: '{email}'
senderName: '{vorname}'
attachUploads: true
translation:
language: default
useFluidEmail: true
title: 'Confirmation of your message'
addHtmlPart: true
identifier: EmailToReceiver
renderables:
-
renderingOptions:
previousButtonLabel: ''
nextButtonLabel: ''
identifier: page-1
label: Kontakt
type: Page
renderables:
-
properties:
options:
Anfrage: Anfrage
Lob: Lob
Kritik: Kritik
type: SingleSelect
identifier: singleselect-1
label: 'Ihr Anliegen'
defaultValue: Anfrage
-
defaultValue: ''
identifier: vorname
label: 'Ihr Name'
type: Text
properties:
fluidAdditionalAttributes: { }
elementDescription: ''
-
defaultValue: ''
identifier: email
label: 'Ihre E-Mail-Adresse'
type: Text
properties:
fluidAdditionalAttributes:
required: required
validators:
-
identifier: NotEmpty
-
identifier: EmailAddress
-
defaultValue: ''
identifier: nachricht
label: 'Ihre Nachricht'
type: Textarea
properties:
fluidAdditionalAttributes:
required: required
elementDescription: ''
validators:
-
identifier: NotEmpty
-
properties:
pageUid: '13'
linkText: 'Datenschutzerklärung anzeigen'
fluidAdditionalAttributes:
required: required
type: LinkedCheckbox
identifier: linkedcheckbox-1
label: 'Ja, ich habe die Datenschutzerklärung zur Kenntnis genommen.'
validators:
-
identifier: NotEmpty

Related

TYPO3 - cms-forms - Remove Input from Email

I am trying to remove an input field from the generated email. With Powermail it is relatively easy. There I can exclude fields in the typoscript. How could something like this look with cms-forms?
Example powermail
excludeFromPowermailAllMarker {
# On Confirmation Page (if activated)
confirmationPage {
# add some markernames (commaseparated) which should be excluded
excludeFromMarkerNames = datenschutzbestimmungen, agb
}
}
TYPO3 11.5.12
php 8.1.2
This is possible with the form variants introduced in TYPO3 version 9.
Hide a form element in certain finishers and on the summary step:
type: Form
identifier: test
prototypeName: standard
label: Test
finishers:
-
identifier: EmailToReceiver
options:
subject: Testmail
recipientAddress: tritum#example.org
recipientName: 'Test'
senderAddress: tritum#example.org
senderName: tritum#example.org
renderables:
-
type: Page
identifier: page-1
label: 'Page 1'
renderables:
-
type: Text
identifier: text-1
label: 'Text 1'
variants:
-
identifier: hide-1
renderingOptions:
enabled: false
condition: 'stepType == "SummaryPage" || finisherIdentifier in ["EmailToSender", "EmailToReceiver"]'
-
type: Text
identifier: text-2
label: 'Text 2'
-
type: SummaryPage
identifier: summarypage-1
label: 'Summary step'
The relevant part (which disables rendering of the field in the summary page, the email to sender finisher or the email to sender finisher) is
variants:
-
identifier: hide-1
renderingOptions:
enabled: false
condition: 'stepType == "SummaryPage" || finisherIdentifier in ["EmailToSender", "EmailToReceiver"]'

Extension form framework finisher not working

I have created custom finisher to call API and send data to the server. Here is the code for this.
Typoscript:
plugin.tx_form.settings.yamlConfigurations {
200 = EXT:ApiCall/Configuration/Yaml/BaseSetup.yaml
300 = EXT:ApiCall/Configuration/Yaml/FormEngineSetup.yaml
}
module.tx_form.settings.yamlConfigurations {
200 = EXT:ApiCall/Configuration/Yaml/BaseSetup.yaml
300 = EXT:ApiCall/Configuration/Yaml/FormEditorSetup.yaml
400 = EXT:ApiCall/Configuration/Yaml/FormEngineSetup.yaml
}
BaseSetup.yaml
TYPO3:
CMS:
Form:
prototypes:
standard:
finishersDefinition:
ApiCall:
implementationClassName:
'Vendor\ApiCall\Domain\Finishers\ApiCallFinisher'
FormEditorSetup.yaml
TYPO3:
CMS:
Form:
########### FORMEDITOR CONFIGURATION ###########
prototypes:
standard:
########### DEFAULT FORM ELEMENT DEFINITIONS ###########
formElementsDefinition:
Form:
formEditor:
editors:
900:
selectOptions:
60:
value: 'ApiCall'
label: 'ApiCall'
propertyCollections:
finishers:
90:
identifier: 'ApiCall'
editors:
__inheritances:
10: 'TYPO3.CMS.Form.mixins.formElementMixins.BaseCollectionEditorsMixin'
100:
label: "ApiCall"
110:
identifier: 'url'
templateName: 'Inspector-TextEditor'
label: 'url'
propertyPath: 'options.url'
propertyValidators:
10: 'NotEmpty'
### FORM ELEMENTS: INPUT ###
Text:
formEditor:
editors:
1000:
identifier: 'ApiCallname'
templateName: 'Inspector-TextEditor'
label: 'ApiCall field name'
propertyPath: 'properties.ApiCallname'
Password:
formEditor:
editors:
1000:
identifier: 'ApiCallname'
templateName: 'Inspector-TextEditor'
label: 'ApiCall field name'
propertyPath: 'properties.ApiCallname'
AdvancedPassword:
formEditor:
editors:
1000:
identifier: 'ApiCallname'
templateName: 'Inspector-TextEditor'
label: 'ApiCall field name'
propertyPath: 'properties.ApiCallname'
Hidden:
formEditor:
editors:
1000:
identifier: 'ApiCallname'
templateName: 'Inspector-TextEditor'
label: 'ApiCall field name'
propertyPath: 'properties.ApiCallname'
Textarea:
formEditor:
editors:
1000:
identifier: 'ApiCallname'
templateName: 'Inspector-TextEditor'
label: 'ApiCall field name'
propertyPath: 'properties.ApiCallname'
### FORM ELEMENTS: SELECT ###
Checkbox:
formEditor:
editors:
1000:
identifier: 'ApiCallname'
templateName: 'Inspector-TextEditor'
label: 'ApiCall field name'
propertyPath: 'properties.ApiCallname'
MultiCheckbox:
formEditor:
editors:
1000:
identifier: 'ApiCallname'
templateName: 'Inspector-TextEditor'
label: 'ApiCall field name'
propertyPath: 'properties.ApiCallname'
MultiSelect:
formEditor:
editors:
1000:
identifier: 'ApiCallname'
templateName: 'Inspector-TextEditor'
label: 'ApiCall field name'
propertyPath: 'properties.ApiCallname'
RadioButton:
formEditor:
editors:
1000:
identifier: 'ApiCallname'
templateName: 'Inspector-TextEditor'
label: 'ApiCall field name'
propertyPath: 'properties.ApiCallname'
SingleSelect:
formEditor:
editors:
1000:
identifier: 'ApiCallname'
templateName: 'Inspector-TextEditor'
label: 'ApiCall field name'
propertyPath: 'properties.ApiCallname'
### FORM ELEMENTS: CUSTOM ###
DatePicker:
formEditor:
editors:
1000:
identifier: 'ApiCallname'
templateName: 'Inspector-TextEditor'
label: 'ApiCall field name'
propertyPath: 'properties.ApiCallname'
### FORM ELEMENTS: UPLOADS ###
FileUpload:
formEditor:
editors:
1000:
identifier: 'ApiCallname'
templateName: 'Inspector-TextEditor'
label: 'ApiCall field name'
propertyPath: 'properties.ApiCallname'
ImageUpload:
formEditor:
editors:
1000:
identifier: 'ApiCallname'
templateName: 'Inspector-TextEditor'
label: 'ApiCall field name'
propertyPath: 'properties.ApiCallname'
### FINISHERS ###
finishersDefinition:
ApiCall:
formEditor:
iconIdentifier: 't3-form-icon-finisher'
label: 'A Label that seems to be never used...'
predefinedDefaults:
options:
url: ''
FormEngineSetup.yaml
TYPO3:
CMS:
Form:
prototypes:
standard:
finishersDefinition:
ApiCall:
FormEngine:
label: "When is this label used? And for what?"
elements:
# hier nochmal alle Felder
# ich habe keine Ahnung wofür diese sind aber ohne geht es nicht
# spontan würde ich behaupten das es tca configuration ist
# aber ich definiere keine Datenbank Felder ~ vielleicht ist das aber eine Option
url: {label: url, config: {type: input}}
Set finisher.
renderingOptions:
submitButtonLabel: send
type: Form
identifier: contactform
label: 'Drop us a line and we''ll get back to you ASAP! Yes, we''re fast!'
prototypeName: standard
finishers:
-
options:
subject: 'New Inquiry'
recipientAddress: example#gmail.com
recipientName: 'Admin'
senderAddress: '{email-1}'
senderName: ' {text-1}'
replyToAddress: '{email-1}'
carbonCopyAddress: ''
blindCarbonCopyAddress: ''
format: html
attachUploads: true
identifier: EmailToReceiver
-
options:
subject: 'Inquiry - sender'
recipientAddress: '{email-1}'
recipientName: '{text-1}'
senderAddress: test#gmail.com
senderName: 'Admin'
replyToAddress: test#gmail.com
carbonCopyAddress: ''
blindCarbonCopyAddress: ''
format: html
attachUploads: true
identifier: EmailToSender
-
options:
pageUid: '21'
additionalParameters: ''
identifier: Redirect
-
options:
url: 'https://api.example.com/setdata'
identifier: ApiCall
In my finisher file, I tried to debug form data, but this not working. here is my finisher file code
<?php
namespace Vendor\ApiCall\Domain\Finishers;
use TYPO3\CMS\Extbase\Utility\DebuggerUtility;
use TYPO3\CMS\Form\Domain\Finishers\AbstractFinisher;
class ApiCallFinisher extends AbstractFinisher
{
protected function executeInternal()
{
DebuggerUtility::var_dump($this);
$values = $this->finisherContext->getFormValues();
DebuggerUtility::var_dump($values);die;
}
}
both debug not showing, a form is being submitted. Can anyone tell me what's wrong?
Thanks an advance!
Your finisher must be moved before the redirect finisher.
After the redirect finisher is called, your code is being stopped to perform the redirect. ✌️

TYPO3: Form properties.fluidAdditionalAttributes.placeholder translation

I'm working on translating my Typo3 page.
Now I've come to my contact form which I want to translate. From the Typo3 Documentation I've found that I need something like this:
contact.element.subject.properties.fluidAdditionalAttributes.placeholder
...as the translation ID inside my locallang.xlf file. I've linked my CustomFormSettings.yaml via TypoeScript, in there set the translation path to my extension and created a contact form.
I was actually able to translate the submit button for example and other buttons. But I can't get the placeholder inside my contact form to get translated, they all fallback to the value set in the contact form not the translation.
I'm guessing I'm handling the fluidAdditionalAttributes property wrong but I've tested lots of other combinations then the above.
What is the exact line I have to type inside my translation ID?
Here is my complete contact form:
renderingOptions:
submitButtonLabel: Submit
identifier: contact
label: Contact
type: Form
prototypeName: frameform
finishers:
-
options:
subject: 'Your message: {subject}'
recipientAddress: mail#mail.com
recipientName: 'Recipient Name'
senderAddress: '{email}'
senderName: '{name}'
replyToAddress: ''
carbonCopyAddress: ''
blindCarbonCopyAddress: ''
format: html
attachUploads: true
translation:
language: ''
identifier: EmailToReceiver
-
options:
subject: 'We have received: {subject}'
recipientAddress: '{email}'
recipientName: '{name}'
senderAddress: mail#mail.com
senderName: 'Sender Name'
replyToAddress: ''
carbonCopyAddress: ''
blindCarbonCopyAddress: ''
format: html
attachUploads: true
identifier: EmailToSender
-
options:
pageUid: '7'
additionalParameters: ''
identifier: Redirect
renderables:
-
renderingOptions:
previousButtonLabel: 'Previous step'
nextButtonLabel: 'Next step'
identifier: mainPage
type: Page
renderables:
-
defaultValue: ''
identifier: name
label: Name
type: Text
properties:
fluidAdditionalAttributes:
placeholder: Name
required: required
validators:
-
identifier: NotEmpty
-
defaultValue: ''
identifier: subject
label: Subject
type: Text
properties:
fluidAdditionalAttributes:
placeholder: Subject
required: required
validators:
-
identifier: NotEmpty
-
defaultValue: ''
identifier: email
label: Email
type: Text
properties:
fluidAdditionalAttributes:
placeholder: 'Email address'
required: required
validators:
-
identifier: NotEmpty
-
identifier: EmailAddress
-
defaultValue: ''
identifier: message
label: Message
type: Textarea
properties:
fluidAdditionalAttributes:
placeholder: Message
required: required
minlength: '10'
maxlength: '512'
validators:
-
identifier: NotEmpty
-
options:
minimum: '10'
maximum: '512'
identifier: StringLength
-
renderingOptions:
previousButtonLabel: 'Previous step'
nextButtonLabel: 'Next step'
identifier: summarypage
label: 'Summary page'
type: SummaryPage
You can override your placeholders in a locallang.xlf like this: element.<field-identifier>.properties.placeholder
example:
<trans-unit id="element.firstname.properties.placeholder">
<source>Your first name</source>
<target>Ihr Vorname</target>
</trans-unit>

Typo3 Form Finisher

Hello I have make a form finisher, but I have some Problem.
in BE I can select in, but no fields are loaded.
Here the code from the BaseSetup.yaml
TYPO3:
CMS:
Form:
prototypes:
standard:
formElementsDefinition:
Form:
renderingOptions:
translation:
translationFile:
'10': 'EXT:form/Resources/Private/Language/locallang.xlf'
'20': 'EXT:formfinisher/Resources/Private/Language/locallang.xlf'
finishersDefinition:
EmailPdf:
implementationClassName: 'IL\Formfinish\Domain\Finishers\EmailPdfFinisher'
And this is the Code FormEditorSetup.yaml
TYPO3:
CMS:
Form:
########### FORM MANAGER CONFIGURATION ###########
formManager:
translationFile:
10: 'EXT:form/Resources/Private/Language/Database.xlf'
20: 'EXT:formfinisher/Resources/Private/Language/Database.xlf'
########### FORMEDITOR CONFIGURATION ###########
prototypes:
standard:
formEditor:
translationFile:
10: 'EXT:form/Resources/Private/Language/Database.xlf'
20: 'EXT:formfinisher/Resources/Private/Language/Database.xlf'
########### DEFAULT FORM ELEMENT DEFINITIONS ###########
formElementsDefinition:
Form:
formEditor:
editors:
900:
selectOptions:
1491637029:
value: 'EmailPdf'
label: 'Email with Pdf'
propertyCollections:
finishers:
50:
identifier: 'EmailPdf'
editors:
__inheritances:
10: 'TYPO3.CMS.Form.mixins.formElementMixins.BaseCollectionEditorsMixin'
100:
label: 'Email with Pdf'
200:
identifier: 'subject'
templateName: 'Inspector-TextEditor'
label: 'formEditor.elements.Form.finisher.EmailToSender.editor.subject.label'
propertyPath: 'options.subject'
enableFormelementSelectionButton: true
propertyValidators:
10: 'NotEmpty'
20: 'FormElementIdentifierWithinCurlyBracesInclusive'
300:
identifier: 'pdfOrt'
templateName: 'Inspector-TextEditor'
label: 'Pdf Ort'
propertyPath: 'options.subject'
enableFormelementSelectionButton: true
propertyValidators:
10: 'NotEmpty'
20: 'FormElementIdentifierWithinCurlyBracesInclusive'
400:
identifier: 'pdfAddress'
templateName: 'Inspector-TextEditor'
label: 'Pdf Address'
propertyPath: 'options.subject'
enableFormelementSelectionButton: true
propertyValidators:
10: 'NotEmpty'
20: 'FormElementIdentifierWithinCurlyBracesInclusive'
500:
identifier: 'recipientAddress'
templateName: 'Inspector-TextEditor'
label: 'formEditor.elements.Form.finisher.EmailToSender.editor.recipientAddress.label'
propertyPath: 'options.recipientAddress'
enableFormelementSelectionButton: true
propertyValidatorsMode: 'OR'
propertyValidators:
10: 'NaiveEmail'
20: 'FormElementIdentifierWithinCurlyBracesExclusive'
fieldExplanationText: 'formEditor.elements.Form.finisher.EmailToSender.editor.recipientAddress.fieldExplanationText'
600:
identifier: 'recipientName'
templateName: 'Inspector-TextEditor'
label: 'formEditor.elements.Form.finisher.EmailToSender.editor.recipientName.label'
propertyPath: 'options.recipientName'
enableFormelementSelectionButton: true
propertyValidators:
10: 'FormElementIdentifierWithinCurlyBracesInclusive'
fieldExplanationText: 'formEditor.elements.Form.finisher.EmailToSender.editor.recipientName.fieldExplanationText'
700:
identifier: 'senderAddress'
templateName: 'Inspector-TextEditor'
label: 'formEditor.elements.Form.finisher.EmailToSender.editor.senderAddress.label'
propertyPath: 'options.senderAddress'
enableFormelementSelectionButton: true
propertyValidatorsMode: 'OR'
propertyValidators:
10: 'NaiveEmail'
20: 'FormElementIdentifierWithinCurlyBracesExclusive'
fieldExplanationText: 'formEditor.elements.Form.finisher.EmailToSender.editor.senderAddress.fieldExplanationText'
800:
identifier: 'senderName'
templateName: 'Inspector-TextEditor'
label: 'formEditor.elements.Form.finisher.EmailToSender.editor.senderName.label'
propertyPath: 'options.senderName'
enableFormelementSelectionButton: true
propertyValidators:
10: 'FormElementIdentifierWithinCurlyBracesInclusive'
fieldExplanationText: 'formEditor.elements.Form.finisher.EmailToSender.editor.senderName.fieldExplanationText'
900:
identifier: 'replyToAddress'
templateName: 'Inspector-TextEditor'
label: 'formEditor.elements.Form.finisher.EmailToSender.editor.replyToAddress.label'
propertyPath: 'options.replyToAddress'
enableFormelementSelectionButton: true
propertyValidatorsMode: 'OR'
propertyValidators:
10: 'NaiveEmailOrEmpty'
20: 'FormElementIdentifierWithinCurlyBracesExclusive'
1000:
identifier: 'carbonCopyAddress'
templateName: 'Inspector-TextEditor'
label: 'formEditor.elements.Form.finisher.EmailToSender.editor.carbonCopyAddress.label'
propertyPath: 'options.carbonCopyAddress'
enableFormelementSelectionButton: true
propertyValidatorsMode: 'OR'
propertyValidators:
10: 'NaiveEmailOrEmpty'
20: 'FormElementIdentifierWithinCurlyBracesExclusive'
1100:
identifier: 'blindCarbonCopyAddress'
templateName: 'Inspector-TextEditor'
label: 'formEditor.elements.Form.finisher.EmailToSender.editor.blindCarbonCopyAddress.label'
propertyPath: 'options.blindCarbonCopyAddress'
enableFormelementSelectionButton: true
propertyValidatorsMode: 'OR'
propertyValidators:
10: 'NaiveEmailOrEmpty'
20: 'FormElementIdentifierWithinCurlyBracesExclusive'
1200:
identifier: 'format'
templateName: 'Inspector-SingleSelectEditor'
label: 'formEditor.elements.Form.finisher.EmailToSender.editor.format.label'
propertyPath: 'options.format'
selectOptions:
10:
value: 'plaintext'
label: 'formEditor.elements.Form.finisher.EmailToSender.editor.format.1'
20:
value: 'html'
label: 'formEditor.elements.Form.finisher.EmailToSender.editor.format.2'
1300:
identifier: 'attachUploads'
templateName: 'Inspector-CheckboxEditor'
label: 'formEditor.elements.Form.finisher.EmailToSender.editor.attachUploads.label'
propertyPath: 'options.attachUploads'
finishersDefinition:
EmailPdfFinisher:
formEditor:
iconIdentifier: 't3-form-icon-finisher'
label: 'A Label that seems to be never used...'
predefinedDefaults:
options:
subject: ''
pdfOrt: ''
pdfAddress: ''
recipientAddress: ''
recipientName: ''
senderAddress: ''
senderName: ''
replyToAddress: ''
carbonCopyAddress: ''
blindCarbonCopyAddress: ''
format: 'html'
attachUploads: true
And the FormEnginSetup looks like this
TYPO3:
CMS:
Form:
prototypes:
standard:
formEngine:
translationFile:
10: 'EXT:form/Resources/Private/Language/Database.xlf'
20: 'EXT:formfinisher/Resources/Private/Language/Database.xlf'
### FINISHERS ###
finishersDefinition:
# Flexform
EmailPdf:
FormEngine:
label: 'Pdf dings'
elements:
subject:
label: 'tt_content.finishersDefinition.EmailToSender.subject.label'
config:
type: 'input'
eval: 'required'
recipientAddress:
label: 'tt_content.finishersDefinition.EmailToSender.recipientAddress.label'
config:
type: 'input'
eval: 'required'
recipientName:
label: 'tt_content.finishersDefinition.EmailToSender.recipientName.label'
config:
type: 'input'
senderAddress:
label: 'tt_content.finishersDefinition.EmailToSender.senderAddress.label'
config:
type: 'input'
eval: 'required'
senderName:
label: 'tt_content.finishersDefinition.EmailToSender.senderName.label'
config:
type: 'input'
pdfOrt:
label: 'Pdf Ort'
config:
type: 'input'
eval: 'required'
pdfAddress:
label: 'Pdf Address'
config:
type: 'input'
eval: 'required'
replyToAddress:
label: 'tt_content.finishersDefinition.EmailToSender.replyToAddress.label'
config:
type: 'input'
carbonCopyAddress:
label: 'tt_content.finishersDefinition.EmailToSender.carbonCopyAddress.label'
config:
type: 'input'
blindCarbonCopyAddress:
label: 'tt_content.finishersDefinition.EmailToSender.blindCarbonCopyAddress.label'
config:
type: 'input'
format:
label: 'tt_content.finishersDefinition.EmailToSender.format.label'
config:
type: select
renderType: 'selectSingle'
minitems: 1
maxitems: 1
size: 1
items:
10:
0: 'tt_content.finishersDefinition.EmailToSender.format.1'
1: 'html'
20:
0: 'tt_content.finishersDefinition.EmailToSender.format.2'
1: 'plaintext'
and in the frontend I get the following error message
The finisher preset identified by "EmailPdf" could not be found, or the implementationClassName was not specified.
I had a similar Problem. BE just worked fine, but de FE ended up in errors as i added the finisher.
In my case the FE typoscript didn't get loaded the correct way. You can check that in the template -> typoscript object browser.
I had the same error. Benjamin Quandts answer took me to the solution.
Take a look at other installed extensions.
Form:
formEditor:
editors:
900:
selectOptions:
1491637029:
value: 'EmailPdf'
label: 'Email with Pdf'
propertyCollections:
finishers:
50:
identifier: 'EmailPdf'
Maybe the Number "50" is used twice. The same Problem could be in the Typoscript-Integration.

How to add number validation in Neos form?

I have to validate a textbox in Neos form. I want to validate a number between 7 to 90.
Here is my code, but it is not working:
type: 'TYPO3.Form:SingleLineText'
identifier: liednummer
label: 'Die Nummer meines Lieblingsliedes'
validators:
- identifier: 'TYPO3.Flow:NotEmpty'
- identifier: 'TYPO3.Flow:NumberRange'
properties:
placeholder: 'Liednummer'
validation:
'TYPO3\Flow\Validation\Validator\NumberRangeValidator':
minimum: 7
maximum: 90
defaultValue: ''
What is wrong? Empty is working, but number and number range is not working.
Quite old question, so you have probably solved that problem, but maybe it will help someone else:
type: 'TYPO3.Form:SingleLineText'
identifier: liednummer
label: 'Die Nummer meines Lieblingsliedes'
validators:
-
identifier: 'TYPO3.Flow:NumberRange'
options:
minimum: '8'
maximum: '22'
-
identifier: 'TYPO3.Flow:NotEmpty'
properties:
placeholder: 10
defaultValue: ''