Doctrine 1
  1. Doctrine 1
  2. DC-966

Default Order By incorrectly propagating to relations

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows 7 WAMP, PHP 5.3, MySQL 5.1.36, Apache 2.2.11

      Description

      Symfony Version 1.4.9 ORM: Doctrine

      Schema.yml:

      Table1:
      actAs:
      Timestampable: ~
      options:
      orderBy: sort_order ASC
      columns:
      name:

      { string(255), notnull: true }

      sort_order:

      { string(255), notnull: true }

      Table2:
      columns:
      table1_id:

      { integer, notnull: true }

      value:

      { string(255), notnull: true }

      relations:
      Table1:

      { local: table1_id, foreign: id, foreignAlias: Table2 }

      This generates models and I can see the following: BaseTable?1.class.php: $this->option('sort_order', 'sort_order ASC');

      BaseTable?2.class.php: No option for sort_order

      But when I run the following, I get errors: Doctine::getTable('Table1')>createQuery('t')>leftJoin('t.Table2 t2').execute();

      Error: Column not found: 1054 Unknown column 't2.sort_order' in 'order clause'

      Looking at the sql executed, it included t1.sort_order ASC, but also incorrectly added t2.sort_order ASC as well even though it was never defined anywhere.

      I am unsure if this is a Doctrine problem or a symfony one, so I will post i on both bug tracking systems.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Jason Yang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: