Skip to content

Joins are duplicated in comparison to v4 #280

@hrach

Description

@hrach

Because the key was not sufficient to unify the "same" joins.

I knew there must have been a reason behind it.

Anyway upgrade to v5 breaks some our grids under specific conditions (when joining the same table multiple times)

// Ublaboo\DataGrid

// sorting
$this->addColumnText('billingEntity', 'Billing Entity')
    ->setSortableCallback(function (DbalCollection $source, $order) {
        $source->getQueryBuilder()
            ->joinLeft('company co', 'co.id = c.billing_entity_id')
            ->orderBy($order);
    });
// filtering
this->addFilterMultiSelect('billingEntity', 'Billing Entity', $billingEntityCompanies)
    ->setCondition(function (DbalCollection $source, ArrayHash $values) {
        // omitted code...
        $source->getQueryBuilder()
            ->joinLeft('company co', 'co.id = c.billing_entity_id')
            ->andWhere($query, ...$params);
    });

Originally posted by @mskocik in #724

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions