Issue Feature Closed

#12886Add possibility to send multiple objects (object storage) to action

Simon Schaufelberger 02/08/11, 23:46 updated 03/24/20, 17:52

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

  1. Sebastian Kurfuerst changed category target version 05/30/11, 10:43

  2. Alexander Schnitzler changed target version 11/18/12, 19:24

  3. Alexander Schnitzler changed status New On Hold 11/18/12, 19:24

  4. Anja Leichsenring changed project id category target version 01/02/13, 13:37

  5. Anja Leichsenring changed status On Hold New 09/25/14, 15:55

  6. Alexander Opitz changed project id category 09/25/14, 15:59

  7. Susanne Moog changed Sprint Focus PRC 08/07/15, 10:26

  8. Claus Due commented and changed status New Closed 09/26/15, 16:53

    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”.

  9. Simon Schaufelberger commented 09/26/15, 17:43

    ok, thank you for your answer. How could a DTO solution look like?

  10. Benni Mack changed Sprint Focus PRC Needs Decision 03/24/20, 17:52