yiisoft / yiisoft/active-record

Ignore unnecessary joinWiths

Open
#54 3 comments 0 reactions 1 assignee View on GitHub

@dynasource is already working on this.

Since Jul 21, 2017.

Dominant language
PHP
Stars
119
Forks
38
Avg merge
1h 11m
Merged PRs (30d)
1

Description

Currently, \yii\db\ActiveQuery allows you to join the same relations twice (or more) with joinWith. Because of that, the DBMS will complain as you are doing multiple joins on the same table.

I am wondering why this isnt fixed with a simple patch to

in which $joinWith gets the relations mapped by their relation $key. This prevents double insertions and those problematic and unnecessary exceptions when you are ensuring that a joinWith is executed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.