Bug #45876

Exception in TypeHandling with PHP < 5.3.7

Added by Mattias Nilsson over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Must have
Category:
Utility
Target version:
-
Start date:
2013-02-27
Due date:
% Done:

100%

Estimated time:
PHP Version:
5.3
Has patch:
No
Complexity:

Description

When adding new content in Neos an exception is thrown. Refrencing to the file: TYPO3.Flow/Classes/TYPO3/Flow/Utility/TypeHandling.php

ExtDirect error: Uncaught exception #1 (ref 2013022708244558d7f1) - Warning: Unknown class passed as parameter in /Applications/MAMP/htdocs/phoenix.dev/Base/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Utility/TypeHandling.php line 118


Files


Related issues

Related to TYPO3.Flow - Bug #44535: Subclasses of SplObjectStorage, ArrayObject, Collection not considered collection typeResolvedKarsten Dambekalns2013-01-15

Actions
#1

Updated by Mattias Nilsson over 8 years ago

  • Tracker changed from Task to Bug
  • Project changed from Base Distribution to 22
#2

Updated by Mattias Nilsson over 8 years ago

The same error occurs when entering the Site Management Module. Url: neos/administration/sites/edit?moduleArguments[site][__identity]=indentitykey

#1: Warning: Unknown class passed as parameter in /Applications/MAMP/htdocs/phoenix.dev/Base/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Utility/TypeHandling.php line 118 (More information)

#3

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18556

#4

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18556

#5

Updated by Gerrit Code Review over 8 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18556

#6

Updated by Gerrit Code Review over 8 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18556

#7

Updated by Benno Weinzierl over 8 years ago

The current patchset fails in my installation (LAMP) because the following Type is not recognized as Collection:
Doctrine\ORM\PersistentCollection

IMHO is_subclass_of is not enough, it should also be checked for interfaces

#8

Updated by Gerrit Code Review over 8 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18556

#9

Updated by Karsten Dambekalns over 8 years ago

Benno Weinzierl wrote:

The current patchset fails in my installation (LAMP) because the following Type is not recognized as Collection:
Doctrine\ORM\PersistentCollection

IMHO is_subclass_of is not enough, it should also be checked for interfaces

Not needed after 5.3.7:

php -a
Interactive shell

php > var_dump(is_subclass_of('ArrayObject', 'ArrayAccess'));
bool(true)

The question is, when can we finally raise the minimum required PHP version to something sane?

#10

Updated by Karsten Dambekalns over 8 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Karsten Dambekalns

What PHP version are you running?

#11

Updated by Benno Weinzierl over 8 years ago

Karsten Dambekalns wrote:

What PHP version are you running?

Jup! I am running 5.3.6...

#12

Updated by Karsten Dambekalns over 8 years ago

  • Project changed from 22 to TYPO3.Flow
#13

Updated by Karsten Dambekalns over 8 years ago

  • Subject changed from Exception when adding new content to Exception in TypeHandling with PHP < 5.3.7
  • Category set to Utility
  • PHP Version set to 5.3
  • Has patch set to No
#14

Updated by Karsten Dambekalns over 8 years ago

  • Status changed from Needs Feedback to Under Review
#15

Updated by Gerrit Code Review over 8 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18556

#16

Updated by Gerrit Code Review over 8 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18556

#17

Updated by Ottmar Biebersdorf over 8 years ago

Karsten Dambekalns wrote:

The question is, when can we finally raise the minimum required PHP version to something sane?

I hope not as long as many production servers are using the current Debian (Squeeze) which uses PHP 5.3.3 at the moment. It would exclude many production servers from beeing able to run Flow or Neos. So please wait a little longer. Thanks.

#18

Updated by Mattias Nilsson over 8 years ago

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

Updated by Benno Weinzierl over 8 years ago

not fixed in my installation. Get Error:

#1: Warning: class_implements() [<a href='function.class-implements'>function.class-implements</a>]: Class string does not exist and could not be loaded in .../Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Utility/TypeHandling.php line 128

Should look like this:


    static public function isCollectionType($type) {
        if (in_array($type, self::$collectionTypes, TRUE)) {
            return TRUE;
        }

        if (class_exists($type) === TRUE) {
            foreach (self::$collectionTypes as $collectionType) {
                if (is_subclass_of($type, $collectionType) === TRUE) {
                    return TRUE;
                }
            }

                // is_subclasss_of does not check for interfaces in PHP < 5.3.7
            if (version_compare(PHP_VERSION, '5.3.7', '<') === TRUE) {
                foreach (self::$collectionTypes as $collectionType) {
                    if (in_array($collectionType, class_implements($type)) === TRUE) {
                        return TRUE;
                    }
                }
            }
        }

        return FALSE;
    }

#20

Updated by Adrian Föder over 8 years ago

  • Status changed from Resolved to Under Review

reopened on behalf of Benno

#21

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18900

#22

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18900

#23

Updated by Benno Weinzierl over 8 years ago

  • Status changed from Under Review to Resolved
#24

Updated by Gerrit Code Review over 8 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 2.0 has been pushed to the review server.
It is available at https://review.typo3.org/19055

#25

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch 2.0 has been pushed to the review server.
It is available at https://review.typo3.org/19056

#26

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch FLOW3-1.1 has been pushed to the review server.
It is available at https://review.typo3.org/19057

#27

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch FLOW3-1.1 has been pushed to the review server.
It is available at https://review.typo3.org/19058

#28

Updated by Benno Weinzierl over 8 years ago

  • Status changed from Under Review to Resolved
#29

Updated by Gerrit Code Review over 8 years ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch FLOW3-1.1 has been pushed to the review server.
It is available at https://review.typo3.org/19058

#30

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch FLOW3-1.1 has been pushed to the review server.
It is available at https://review.typo3.org/19057

#31

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch composer has been pushed to the review server.
It is available at https://review.typo3.org/19349

#32

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch composer has been pushed to the review server.
It is available at https://review.typo3.org/19352

#33

Updated by Benno Weinzierl over 8 years ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF