CodersCare / gridelements

Be part of the future of TYPO3! Support Gridelements now and unlock exclusive early access to v13! The well-established Gridelements V12 elevates TYPO3 by bringing grid-based layouts to content elements, with powerful features like advanced drag & drop and real references. Supercharge your workflow and make daily tasks easier. Sponsor us here:
https://coders.care/for/crowdfunding/gridelements
GNU General Public License v3.0
5 stars 25 forks source link

TypeError substr(): Argument #1 ($string) must be of type string, int given when creating new CE Backend Layout #28

Closed dkochc closed 1 year ago

dkochc commented 1 year ago

When creating a new CE backend layout in the TYPO3 backend, the above error is thrown.

The error is in the GridelementsBackendLayoutWizardElement.php and GridelementsBackendLayoutWizardElement10.php when substr $contentType['key'] and/or $listType['key'] without checking the key is a string.

Bunnyfield commented 1 year ago

Thanks for the feedback - still there is the question, why there are CType or list_type fields containing integer values, since actually both of them are of type varchar(255) - anyway we could fix the issue by doing a type cast.

dkochc commented 1 year ago

For example, tt_news uses an integer as the plugin identifier when it adds itself as a content element. Since there is no restriction in the addPlugin implementation to use a string for the identifier, this error may occur repeatedly.

Bunnyfield commented 1 year ago

OK - so this might be happening with legacy extensions mostly, which is why no one noticed it on our testing server.