Bug #53425
closedForms with German Umlauts throws Exception
100%
Description
When you ar using a form with an model as object that will be persited after submitting and you have, for example, a property "firstname" then it is no more possible to submit the form in the case of "Jürgen".
You get then an exception: "Jürgen" is not a valid cache entry identifier.
In the case of "Jürgen Heinrich" all works fine.
The Problem is the new method: TypeHandlingUtility::isCoreType()
This is because it uses the PHP function: is_subclass_of
This function is known for calling the autoloader for loading this class (you can find hints of this behavior on php.net and stackoverflow.com).
A workaround could be you modify TYPO3\CMS\Extbase\Utility\TypeHandlingUtility from:
/** * Returns TRUE if the $type is a CMS core type object. * * @param string $type * @return boolean */ static public function isCoreType($type) { return is_subclass_of($type, 'TYPO3\\CMS\\Core\\Type\\TypeInterface'); }
to something like:
/** * Returns TRUE if the $type is a CMS core type object. * * @param string $type * @return boolean */ static public function isCoreType($type) { $reflectionType = new ReflectionClass($type); return $reflectionType->implementsInterface('TYPO3\\CMS\\Core\\Type\\TypeInterface'); }
BTW: Tested with PHP 5.3 and PHP 5.4
Files
Updated by Gerrit Code Review about 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25349
Updated by Tomita Militaru about 11 years ago
Michael Staatz wrote:
first i ran in an Namespace error and after using "new \ReflectionClass($type);" i get an class not found error...
for now i'm using the solution mentioned by christian.... will test it the hole day.
The namespace error is not from ReflectionClass as that's a PHP class, but I suspect it's from $type which must be a qualified name of the class.
Updated by Ralf Zimmermann about 11 years ago
- File stacktrace.txt stacktrace.txt added
The Patch https://review.typo3.org/#/c/25349/
$reflectionType = new \ReflectionClass($type);
return $reflectionType->implementsInterface('TYPO3\\CMS\\Core\\Type\\TypeInterface');
does not work for me. Look into the attached Stacktrace.
But Christian Kuhn's idea
return is_object($type) && is_subclass_of($type, 'TYPO3\\CMS\\Core\\Type\\TypeInterface');
works for me.
Updated by Gerrit Code Review about 11 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25349
Updated by Tomita Militaru about 11 years ago
Thanks for your input Ralf, I've changed the patch.
Updated by Gerrit Code Review about 11 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25349
Updated by Michael Staatz about 11 years ago
I have also successfully tested christian's code, like this:
return (is_object($type) && is_subclass_of($type, 'TYPO3\\CMS\\Core\\Type\\TypeInterface'));
Updated by Michael Staatz about 11 years ago
Because of Christian Kuhn's last review i came up here with some hints that i have found during my research:
TypeHandlingUtility::isCoreType($input) is also called from TYPO3\CMS\Extbase\Persistence\Generic\Backend->getPlainValue() during TYPO3\CMS\Extbase\Persistence\Generic\Backend->persistObject()
and this is new since TYPO3 6.2
The Problem is that every call to "isCoreType" end with a autoloader call because of the PHP function is_subclass_of except if you call it like:
is_subclass_of($type, FALSE)
Problem is that the second, optional, parameter is only valid as of PHP 5.3.9
...
best
Updated by Karsten Madsen almost 11 years ago
The solution in Comment_#7 works for me too. Thanks
Michael Staatz wrote:
I have also successfully tested christian's code, like this:
[...]
Updated by Gerrit Code Review over 10 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/25349
Updated by Gerrit Code Review over 10 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/25349
Updated by Gerrit Code Review over 10 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/25349
Updated by Gerrit Code Review over 10 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/25349
Updated by Gerrit Code Review over 10 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/25349
Updated by Tomita Militaru over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 3fa5989f3002080f136092ef0d07c0e208a5de3e.
Updated by Jonas Götze over 9 years ago
Is it correct that this will not be fixed for 6.2 branch?
In my case the issue occurs with a filter form (city: München), where nothing gets persisted but the value is used in a search query.
Solution in Comment_#7 works for me too so I have fixed it myself, but with the next update it will obviously be gone...
Updated by Urs Braem over 8 years ago
This bug also applies to the Powermail "Form Overview" module in TYPO3 6.2 – which becomes un-usable when there's an umlaut in a form or fieldset name