[TYPO3-mvc] Extbase / Fluid Form Viewhelper: Only want to change one property of object

Søren Andersen hacksaw at zpeed.dk
Sat Apr 20 09:55:08 CEST 2013


Hello Till

I'm quite new to Extbase, but I have models in which I only update 1
property. I do use a DTO which carries the models I want to change, but the
models I want to change one property of are the actual models (with all
properties) attached to the DTO. I wonder why this works, if your approach
doesn’t.

I can think of two things:
(1) Extbase seems to validate only the parent model. Thus my "invalid"
models with only one property set passes through because no validation
occurs. If that is the case, you should be able to put @dontvalidate as an
annotation to the update function. This has its downsides and it might not
be the solution.
(2) Do you have __identity as a hidden field in your form? You probably do
since you lose the other properties.

One final thing that could affect why this is working for me. I seem to be
using the old property mapper. It was set by default when I made the
extension with extension builder. I made a quick test where I changed to the
new one, instantly several parts of my extension failed, and I decided to
postpone transition to the new property mapper, because I didn't have time
to understand why it didn't work.

Sincerely,
Søren Andersen

-----Oprindelig meddelelse-----
Fra: typo3-project-typo3v4mvc-bounces at lists.typo3.org
[mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] På vegne af
g4-lisz at tonarchiv.ch
Sendt: 17. april 2013 19:32
Til: TYPO3 v4 MVC project
Emne: Re: [TYPO3-mvc] Extbase / Fluid Form Viewhelper: Only want to change
one property of object

On 04/17/2013 07:17 PM, Georg Ringer wrote:
> Hi,
>
> IMO the best solution would be to create a 2nd DTO which is just for
handling the simplified form.
>
> Georg
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4m
> vc
Hi Georg,

i wanted to avoid this solution because it makes things quite complicated. I
also do store the Demand in the user session and hand it to a lot of
function calls, so this approach would double all this logic.

I was just hoping that there is another way...

Till
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc



More information about the TYPO3-project-typo3v4mvc mailing list