#102086AdminPanel - Data variable leads to Error "could not be converted to string"
Description
Hi,
when using the admin panel (it is activated), we got the error:
Object of class TYPO3\CMS\Core\Site\Entity\Site could not be converted to string in /var/www/html/vendor/typo3/cms-fluid/Classes/ViewHelpers/TranslateViewHelper.php line 147
I just looked into the issue and can give the following hint:
First we make the site available via typscript
page.10.dataProcessing {
13 = TYPO3\CMS\Frontend\DataProcessing\SiteProcessor
13 {
as = site
}
}
and now we have the variable available
..... site => TYPO3\CMS\Core\Site\Entity\Siteprototypeobject .....
In the Partial of AdminPanel “Data\TableKeyValue.html” on line 28 the translate viewhelper is called with all data variables
<pre class="typo3-adminPanel-dump typo3-adminPanel-dump-{typeClass}"><f:if condition="{val} != ''"><f:translate key="{val}" default="{val}" extensionName="adminpanel" languageKey="{languageKey}"/></f:if>
and then in TranslateViewHelper Line 147 the id should be parsed to string which causes the error
if ((string)$id === '') {
Possible Solution:
a) Add toString method to Site-Object.
b) Because a user can add every type via dataprocessor there should be a general check the type of the data.
Thanks and best Regards,
Harald
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 4
-
Filipe DA COSTA commented and changed TYPO3 Version
1110 PHP Version8.27.2 11/17/23, 16:13 -
Riccardo De Contardi commented and changed TYPO3 Version
1011 PHP Version7.28.2 05/11/24, 19:21I revert the version to 11 as I think it makes more sense.
Do you know if this issue still affects version 12 or 13?
-
Harald Holzmann commented 06/12/24, 07:45
Cannot reproduce this error anymore (11.5.38)
-
Garvin Hicking commented and changed status
NewClosed 06/14/24, 12:07Closing the issue then; if it re-appears please create a follow-up!
Having the same issue.
With adminPanel active and if we assign a Domain Model to the view in the Sitepackags ContenController, we get the same:
Makes it difficult when interacting with repositories.
Edit: I’m sorry Harald Holzmann, I added my Typo3 version and it changed the version you tagged :(