Doctrine 1
  1. Doctrine 1
  2. DC-861

Make sure doctrine uses the right connection when creating a query from a table object

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.2.3
    • Fix Version/s: None
    • Component/s: Connection
    • Labels:
      None
    • Environment:
      All

      Description

      Line# 1036
      When using Table::createQuery, null is specified as the connection when calling Doctrine_Query::create() which results in using the default connection while the "correct" connection can be know ($this->getConnection())

      here is the fix:

      — a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Table.php
      +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Table.php
      @@ -1033,7 +1033,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable

      $class = $this->getAttribute(Doctrine_Core::ATTR_QUERY_CLASS);

      • return Doctrine_Query::create(null, $class)
        + return Doctrine_Query::create($this->getConnection(), $class)
        >from($this>getComponentName() . $alias);
        }

        Activity

        There are no comments yet on this issue.

          People

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

            Dates

            • Created:
              Updated: