Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On aggregate roots with referenced entities, it is not possible to add multiple objects and then save it #22

Open
samir-plusb opened this issue Aug 2, 2016 · 5 comments
Labels

Comments

@samir-plusb
Copy link

Say we have an aggregate root with a field, which references another entity and the field can contain multiple objects. The aggregate_root.xml will look something like this:

<?xml version="1.0" encoding="utf-8" ?>
<type_schema namespace="IDM\WelcomeApp\Topic\Model\Aggregate"
    xmlns:xi="http://www.w3.org/2001/XInclude"
    xmlns="http://berlinonline.net/trellis/1.0/schema">
    <type_definition name="Topic">

        [...]

        <!-- attribute definitions -->
        <attributes>
            <attribute name="topic_option" type="entity-reference-list">
                <option name="min_count">0</option>
                <option name="entity_types">
                    <option>TopicOption</option>
                </option>
            </attribute>
        </attributes>
    </type_definition>
    <reference_definitions>
        <reference_definition name="TopicOption">
            [...]
        </reference_definition>
    </reference_definitions>
</type_schema>

Then edit/create an object of the aggregate root type Topic and add multiple (more than one) TopicOption objects and then click on "Save",. The effect is that only one of the added objects will get saved, even when the ajax call for the suggest list is finished correctly.

@graste graste added the bug label Aug 2, 2016
@graste
Copy link
Member

graste commented Aug 2, 2016

Probably a bug related to the js widget and the payload being sent or used for command building.

@MrHash
Copy link
Contributor

MrHash commented Aug 2, 2016

I've reproduced in tests and can confirm as a bug... fix coming up. Although the entity is saved the mirrored attribute is missing.

@MrHash
Copy link
Contributor

MrHash commented Aug 2, 2016

Ok so i looked a bit further and it seems that my test case was slightly wrong and it does actually work as expected, so i suspect @graste is right and the issue is arising from somewhere else..

@graste
Copy link
Member

graste commented Aug 16, 2016

@Pictor13
Copy link
Member

Pictor13 commented Apr 26, 2017

Is it bffd50c fixing it? Maybe we can close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants