Bug #9504

Mapping objects with collection properties fails on empty request argument

Added by Karsten Dambekalns almost 5 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2010-08-30
Priority:Must have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:Property
Target version:TYPO3 Flow Base Distribution - 1.0 alpha 12 Estimated time:1.00 hour
PHP Version: Complexity:
Has patch: Affected Flow version:

Description

When an object contains a typed (non-literals only) collection property (array or Traversable) the PropertyMapper wants to fill that collection with the relevant objects. Now when a web form was used and there is nothing coming in (e.g. nothing selected in a select form element), this leads to foreach being used on an empty string - which results in an error.

Associated revisions

Revision e54f526d
Added by Karsten Dambekalns almost 5 years ago

[+BUGFIX] FLOW3 (Property): Fix mapping of empty traversables from request

When a property is a collection of objects map() tries to use foreach on
the values. If the value is an empty string foreach causes an error.
Avoid this by checking the type first.

Change-Id: I9368ad2a055a2aec19c74f986828ace886091633
Resolves: #9504

History

#1 Updated by Karsten Dambekalns almost 5 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF