Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-30

Doctrine\DBAL\Connection::query() method does not connect automatically to the database

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-BETA2
    • Fix Version/s: 2.0.0-BETA3
    • Component/s: None
    • Labels:
      None
    • Environment:
      Linux, PostgreSQL 8.4

      Description

      The database access methods in Doctrine\DBAL\Connection automatically connect to the database, if the connection has not been created yet. This is not true in case of Doctrine\DBAL\Connection::query() - if we forget to connect manually, we get:

      Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in /.../Doctrine/DBAL/Connection.php on line 608
      

      The problem is caused by the lack of

      $this->connect();
      

      line within the method body.

        Activity

        Hide
        Benjamin Eberlei added a comment -

        fixed

        Show
        Benjamin Eberlei added a comment - fixed

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Tomasz Jędrzejewski
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: