Project

General

Profile

Actions

Bug #62656

closed

Proberty mapping with sti

Added by Eike Starkmann about 10 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2014-11-03
Due date:
% Done:

0%

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

Description

Hi,

i have a strange behaviour in 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:if condtion="a.type=tx_..._a">
    <f:form.textfield property="a" />
</if>
<f:if condtion="a.type=tx_..._b">
    <f:form.textfield property="b" />
</if>

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

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

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 "...\Wall\Domain\Model\AInterface" was not
found and thus can not be reflected.

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

When i delete the "missing" property everything works fine and the types are correct.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #59620: Strange property mapping when using subclasses Rejected2014-06-17

Actions
Actions #1

Updated by Eike Starkmann about 10 years ago

A workaround would also be to add all properties to the superclass and the getter/setter in the child classes.
But i found that also not very handy.

Actions #2

Updated by Riccardo De Contardi over 8 years ago

  • Status changed from New to Closed

I am really sorry for this very late answer; I am closing this issue in favor of #59620 so, please continue the discussion there (I add a relation).

If you think this is the wrong decision, then let us know (on Slack for example - https://typo3.slack.com/ ) or open a new ticket and add a relation to this ticket number. Thank you

Actions

Also available in: Atom PDF