Project

General

Profile

Actions

Bug #59620

closed

Strange property mapping when using subclasses

Added by Eike Starkmann almost 10 years ago. Updated over 7 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2014-06-17
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi,

i have a strange behaviour with the property mapping.

Situation:

Model:

class A{
    protected aThing;
}

class B extends A{
    protected bThing;
}

Now i have an edit mask in FE. I want to use just one editAction for
both types:

public editAction(\Something\A $a){.....}

public updateAction(\Something\A $a){....}

In fuild I have template like this:

....

<f:form.textfield property="aThing" />

<f:if condtion="{a.type}=tx_..._b">
    <f:form.textfield property="bThing" />
</if>
....

But when i edit type b and press edit "Save" button i get this error:

Exception while property mapping at property path "":Property "bThing" was
not found in target object of type "...\Wall\Domain\Model\A"

Which i right because A doesn't have a "bThink". But why is fuild using the wrong type?

I try to avoid that by using an Interface:

interface AInterface{}

class A implements AInterface{
    protected aThing;
}

class B extends A {
    protected bThing;
}

public editAction(\Something\AInterface $a){.....}

public updateAction(\Something\AInterface $a){....}

But then i get the error that the class AInterface can not be found:

#1278450972: The classname "...\...\Domain\Model\AInterface" was not
found and thus can not be reflected.

A workaround would be to have different actions for each type but since
i have more than just one subclass i don't want to do that.

Using name="" and value="" instead of property might also help.

Any ideas?


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #62656: Proberty mapping with stiClosed2014-11-03

Actions
Actions

Also available in: Atom PDF