#12886Add possibility to send multiple objects (object storage) to action
Description
spoken in the case of blog_example, it is not possible to edit multiple blogs at the same time.
What i would like to do is the following:
<f:form controller="Blog" action="multipleedit" name="blog"> <input type="checkbox" value="1" name="tx_blogexample_pi1[blog][]"> <input type="checkbox" value="2" name="tx_blogexample_pi1[blog][]"> <input type="checkbox" value="3" name="tx_blogexample_pi1[blog][]"> <f:form.submit value="Edit"/> </f:form>
and have an Action like this in BlogController:
public function multipleeditAction(Tx_Extbase_Persistence_ObjectStorage $blog){
[...]
}Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 10
-
Sebastian Kurfuerst changed category target version 05/30/11, 10:43
-
Alexander Schnitzler changed target version 11/18/12, 19:24
-
Alexander Schnitzler changed status
NewOn Hold 11/18/12, 19:24 -
Anja Leichsenring changed project id category target version 01/02/13, 13:37
-
Anja Leichsenring changed status
On HoldNew 09/25/14, 15:55 -
Alexander Opitz changed project id category 09/25/14, 15:59
-
Susanne Moog changed Sprint Focus PRC 08/07/15, 10:26
-
Claus Due commented and changed status
NewClosed 09/26/15, 16:53 -
Simon Schaufelberger commented 09/26/15, 17:43
ok, thank you for your answer. How could a DTO solution look like?
-
Benni Mack changed Sprint Focus
PRCNeeds Decision 03/24/20, 17:52
The solution is to use a proper DTO or rely on arrays (which can still be validated), not to turn ObjectStorage into a DTO. For more flexibility, use DTO. For ease, use arrays.
Extbase can map ObjectStorages, of course, but won’t do so as root controller action arguments – with good reason: ObjectStorages aren’t persistable or validatable themselves – only the contained objects are. Although we could make this possible it would require adding special handling in many contexts right from argument validation to persistence – when the proper response is “use the framework’s features: an unpersisted DTO or a plain array”.
It sounds like what you need here is a proper DTO.
Closing as “edge case, has multiple workarounds, not indented framework usage”.