Project

General

Profile

Actions

Bug #53425

closed

Forms with German Umlauts throws Exception

Added by Michael Staatz over 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2013-11-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
hard
Is Regression:
No
Sprint Focus:

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

stacktrace.txt (19.5 KB) stacktrace.txt Ralf Zimmermann, 2013-11-13 11:00

Related issues 2 (0 open2 closed)

Has duplicate TYPO3 Core - Bug #60669: String value in objects to persist will trigger the class autoloaderClosedTobias Liebig2014-07-30

Actions
Has duplicate TYPO3 Core - Bug #53560: #1233058486: "someStringWithUmlautsLikeÄ" is not a valid cache entry identifier.Closed2013-11-12

Actions
Actions #1

Updated by Gerrit Code Review over 10 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

Actions #2

Updated by Tomita Militaru over 10 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.

Actions #3

Updated by Ralf Zimmermann over 10 years ago

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.

Actions #4

Updated by Gerrit Code Review over 10 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

Actions #5

Updated by Tomita Militaru over 10 years ago

Thanks for your input Ralf, I've changed the patch.

Actions #6

Updated by Gerrit Code Review over 10 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

Actions #7

Updated by Michael Staatz over 10 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'));
Actions #8

Updated by Michael Staatz over 10 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

Actions #9

Updated by Karsten Madsen over 10 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:

[...]

Actions #10

Updated by Gerrit Code Review over 9 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

Actions #11

Updated by Gerrit Code Review over 9 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

Actions #12

Updated by Gerrit Code Review over 9 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

Actions #13

Updated by Gerrit Code Review over 9 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

Actions #14

Updated by Gerrit Code Review over 9 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

Actions #15

Updated by Tomita Militaru over 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #16

Updated by Jonas Götze almost 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...

Actions #17

Updated by Urs Braem over 7 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

Actions #18

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF