Bug #86426
closedUnexpected f:translate error
0%
Description
I have tried to achieve a simple filter for items and wanted filter those items by a multiselect field of types.
After submitting the form with multiple values selected following error occured:
Either "key" or "id" must be provided for f:translate in TranslateViewHelper.php line 131
The necessary code is als following:
<?php namespace Vendor\Theme\Domain\Model; class Demand extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { /** * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Vendor\Theme\Domain\Model\Type> **/ protected $types; /** * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Vendor\Theme\Domain\Model\Type> The type of the demand * @return void */ public function setTypes($types) { $this->types = $types; } /** * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage */ public function getTypes() { return $this->types; } } ###Search.html### <f:form class="form" method="post" action="search" name="demand" object="{demand}"> <f:form.select property="types" options="{types}" optionLabelField="title" optionValueField="uid" multiple="1" size="10" /> <f:form.submit value="filter"/> </f:form>
The problem was solved when I deactivated the admin panel:
Seems to be an unwanted lang overlay for debugging issues???
Files
Updated by Claus Due almost 6 years ago
- Category changed from Fluid to Form Framework
This is almost surely not related to f:translate or Fluid - more likely, it concerns the form extension. I suspect it is caused by use of a dynamic variable used as "key" for f:translate in a case that only happens if you put a multi-select in a template.
If this is not related to the form extension, the most likely cause is that one or more templates involved in the (custom?) controller action either omits the argument or uses a dynamic variable that resolves to NULL (which it will if the variable is not transferred to partials, not assigned to template, or comes from a model with null as default value.
(Issue assigned to "Form Framework" category for evaluation by another dev)
Updated by Ralf Zimmermann almost 6 years ago
- File example.tar.gz example.tar.gz added
- Category changed from Form Framework to Fluid
@Claus The example ("<f:form />" and the extbase model snipped) looks like Extbase / Fluid to me.
@Robert Lemke Do you use ext:form to render the form? I can not reproduce your issue with extbase / fluid with a fresh TYPO3 9.5.2-dev. I use the attached test extension. Did i miss something?
Updated by Robert Winter almost 6 years ago
Hey Ralf,
it was just Extbase / Fluid and with activated admin panel the error occured. After turning off the admin panel
the form rendered as expected.
Updated by Benni Mack almost 3 years ago
- Status changed from New to Closed
Closing this issue, as this issue cannot be reproduced in TYPO3 v10/v11 anymore.