Bug #27810
ObjectManager returns Subclass sometimes
Status: | Closed | Start date: | 2011-07-02 | |
---|---|---|---|---|
Priority: | Must have | Due date: | ||
Assigned To: | Christopher Hlubek | % Done: | 0% |
|
Category: | Object | |||
Target version: | - | |||
PHP Version: | Complexity: | |||
Has patch: | Affected Flow version: |
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
History
#1 Updated by Karsten Dambekalns almost 4 years ago
- Category set to Object
- Status changed from New to Closed
- Assigned To set to Christopher Hlubek
Closed as duplicate of #30234.