Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-172

QueryBuilder joins are omitted if the table alias is not present in the "from" clause

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1.5
    • Component/s: None
    • Security Level: All
    • Labels:
      None
    • Environment:
      MySQL

      Description

      When using the QueryBuilder, joins that refer to table aliases from other joins get omitted. Only those joins that refer to table aliases from the "from" clause get included.

      See http://stackoverflow.com/questions/7331117/doctrines-dbal-query-builder-omitts-some-joins

        Activity

        Hide
        Anush Ramani added a comment -

        Just realized that there is a way to solve the issue with omitted joins. Essentially, we'd always need to use one of the FROM table aliases as the $fromAlias for the join() methods. While this works quite well, it seems un-intuitive.

        If this is expected behavior, I can close the ticket, but again, seems a bit un-intuitive.

        Show
        Anush Ramani added a comment - Just realized that there is a way to solve the issue with omitted joins. Essentially, we'd always need to use one of the FROM table aliases as the $fromAlias for the join() methods. While this works quite well, it seems un-intuitive. If this is expected behavior, I can close the ticket, but again, seems a bit un-intuitive.
        Hide
        Benjamin Eberlei added a comment -

        fixed.

        An exception is now thrown when this occurs with details on how to fix it.

        Show
        Benjamin Eberlei added a comment - fixed. An exception is now thrown when this occurs with details on how to fix it.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Anush Ramani
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: