Open mediaessenz opened 1 year ago
As a temporary workaround for an installation, where I use gender value 2 for a neutral salutation, which should be the default in this case, I changed the gender partial this way:
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:femanager="http://typo3.org/ns/In2code/Femanager/ViewHelpers"
data-namespace-typo3-fluid="true">
<div class="femanager_fieldset femanager_gender form-group">
<label class="control-label">
<f:translate key="tx_femanager_domain_model_user.gender" />
<f:if condition="{femanager:Validation.IsRequiredField(fieldName:'gender')}">
<span>*</span>
</f:if>
</label>
<div class="form-check-inline">
<div class="radio">
<label>
<f:form.radio
id="femanager_field_gender1"
property="gender"
value="1"
checked="{user.gender} == 1"
additionalAttributes="{femanager:Validation.FormValidationData(settings:settings,fieldName:'gender')}" />
<f:translate key="tx_femanager_domain_model_user.gender.item1" />
</label>
</div>
<div class="radio">
<label>
<f:form.radio
id="femanager_field_gender0"
property="gender"
value="0"
checked="{user} && {user.gender} == 0"
additionalAttributes="{femanager:Validation.FormValidationData(settings:settings,fieldName:'gender')}" />
<f:translate key="tx_femanager_domain_model_user.gender.item0" />
</label>
</div>
<div class="radio">
<label>
<f:form.radio
id="femanager_field_gender2"
property="gender"
value="2"
checked="!{user} || {user} == 2"
additionalAttributes="{femanager:Validation.FormValidationData(settings:settings,fieldName:'gender')}" />
<f:translate key="tx_femanager_domain_model_user.gender.item2" />
</label>
</div>
</div>
</div>
</html>
has no effect of the gender radio boxes in the register new user form.
Always the radio element with value 0 (male) will be checked, independent of the defined prefill value.
The user object, which is used to compare the value inside the corresponding gender partial is null.