Project

General

Profile

Actions

Feature #12886

closed

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

Added by Simon Schaufelberger about 13 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2011-02-08
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:
Needs Decision

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){
    [...]
}
Actions #1

Updated by Sebastian Kurfuerst almost 13 years ago

  • Category set to 963
  • Target version deleted (Extbase 1.4)
Actions #2

Updated by Alexander Schnitzler over 11 years ago

  • Target version set to 1910
Actions #3

Updated by Alexander Schnitzler over 11 years ago

  • Status changed from New to On Hold
Actions #4

Updated by Anja Leichsenring over 11 years ago

  • Project changed from 534 to 2559
  • Category changed from 963 to Fluid: ViewHelpers
  • Target version deleted (1910)
Actions #5

Updated by Anja Leichsenring over 9 years ago

  • Status changed from On Hold to New
Actions #6

Updated by Alexander Opitz over 9 years ago

  • Project changed from 2559 to TYPO3 Core
  • Category changed from Fluid: ViewHelpers to Fluid
Actions #7

Updated by Susanne Moog over 8 years ago

  • Sprint Focus set to PRC
Actions #8

Updated by Claus Due over 8 years ago

  • Status changed from New to Closed

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

Actions #9

Updated by Simon Schaufelberger over 8 years ago

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

Actions #10

Updated by Benni Mack about 4 years ago

  • Sprint Focus changed from PRC to Needs Decision
Actions

Also available in: Atom PDF