Bug #27810

ObjectManager returns Subclass sometimes

Added by Johannes K over 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Must have
Category:
Object
Target version:
-
Start date:
2011-07-02
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

I have extended the original DateTimeConverter, to add some special time handling, simplified example

namespace F3\Events\Property\TypeConverter

class DateTimeConverter extends \F3\FLOW3\Property\TypeConverter\DateTimeConverter {
    protected $priority = 3;

    protected function overrideTimeIfSpecified(\DateTime $date, array $source) {
        return parent::overrideTimeIfSpecified($date, $source);
    }
}

Now the strange part: The Object-Manager returns my subclass:

get_class($this->objectManager->get('F3\Events\Property\TypeConverter\DateTimeConverter')) === 'F3\Events\Property\TypeConverter\DateTimeConverter';
get_class($this->objectManager->get('F3\FLOW3\Property\TypeConverter\DateTimeConverter')) === 'F3\Events\Property\TypeConverter\DateTimeConverter';

This finally leads to an exception from the propertymapper:

#1297951378: There exist at least two converters which handle the conversion from "string" to "DateTime" with priority "3": F3\Events\Property\TypeConverter\DateTimeConverter and F3\Events\Property\TypeConverter\DateTimeConverter 

This is not 100% reproducible and seems to depend on cache, but I haven't found the magic setting to make it always reproducible.

Chatlog: http://www.rvantwisk.nl/flow3-irc-log/2011/july/2.html


Related issues

Has duplicate TYPO3.Flow - Bug #30234: Compiled proxies override parent instanceClosedChristopher Hlubek2011-09-23

Actions
#1

Updated by Karsten Dambekalns about 10 years ago

  • Category set to Object
  • Status changed from New to Closed
  • Assignee set to Christopher Hlubek

Closed as duplicate of #30234.

Also available in: Atom PDF