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

Virtual Columns is mapped wrongly. #1969

Open
vitaliiShveider opened this issue Jun 19, 2023 · 0 comments
Open

Virtual Columns is mapped wrongly. #1969

vitaliiShveider opened this issue Jun 19, 2023 · 0 comments

Comments

@vitaliiShveider
Copy link

For example:
We have entity_state and entity_order

one state with id 1
and 3 orders with this state.
orders with ids 1, 2, 3

Pseudo code:

StateQuery::create()
            ->useOrderQuery()
                ->filterByIdOrder_In($salesOrderItemIds)
            ->endUse()
            ->addAsColumn(
                'idOrder',
                OrderTableMap::COL_ID_SALES_ORDER,
            )->find();

we expect to have 3 items with virtual column idOrder
FE:

{
    "state_id": 1,
    "virtual_columns": {
        "idOrder":  1
    }
},
{
    "state_id": 1,
    "virtual_columns": {
        "idOrder":  2
    }
},
{
    "state_id": 1,
    "virtual_columns": {
        "idOrder":  3
    }
}

But propel map it next way:

{
    "state_id": 1,
    "virtual_columns": {
        "idOrder":  3
    }
},
{
    "state_id": 1,
    "virtual_columns": {
        "idOrder":  3
    }
},
{
    "state_id": 1,
    "virtual_columns": {
        "idOrder":  3
    }
}

Looks like virtualColumns is mapped by primary key

@vitaliiShveider vitaliiShveider changed the title Virtual Columns Maps wrong. Virtual Columns Map wrong. Jun 19, 2023
@vitaliiShveider vitaliiShveider changed the title Virtual Columns Map wrong. Virtual Columns is mapped wrongly. Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant