Trac

How to report a bug in trac

Register for Trac Account

In order to report a bug you must register for a Trac account. You can register by following this url http://trac.phpdoctrine.org/register. Once you register and login, you will use the "New Ticket" link at the top right navigation bar. Below are instruction on what you should include in your ticket description. Also, writing a failing test case in our test suite is our preferred way for conveying the error to us. Using our test suite for the failing test case will increase the speed in which the bug can be fixed. Learn how to use and write test cases here: http://trac.phpdoctrine.org/wiki/TestCases

Important: Before you report a bug make sure it has not been fixed yet. That means you need to check against HEAD.

In order to make your bug understandable and reproducible to others you should write a general description on what is wrong. Then you should include version information for php, the webserver and the database server. Examples from #615

jschaefe@Kamelradde:~/src$ php -v
PHP 5.2.3-1ubuntu6 (cli) (built: Oct  5 2007 01:20:58) 
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
jschaefe@Kamelradde:~/src$ apache2ctl status
Apache Server Status for localhost
Server Version: Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6
jschaefe@Kamelradde:~/src$ mysql -V
mysql  Ver 14.12 Distrib 5.0.45, for pc-linux-gnu (x86_64) using readline 5.2

The version of doctrine used should also be mentioned. Write r3123 (for revision 3123) or specify a release tarball.

Also make sure to mention if you are using sfDoctrine.

Proceed with one of the two following options:

With commit access and knowledges on testing

If you have commit access it is preferred to add a TestCase to the Ticket folder in tests and add it to run.php. Refer to this test case in the bug report.

Include the part of the testcase that concerns your failing test case in the report.

Without commit access

Create a set of code to reproduce your error. This code should contain all the models in question and the query if a query is the issue at hand. It should also contain the result of the test script.

An example from #615

require_once('doctrine/lib/Doctrine.php');
spl_autoload_register(array('Doctrine', 'autoload'));
$manager = Doctrine_Manager::getInstance();
$manager->setAttribute(Doctrine::ATTR_EXPORT, Doctrine::EXPORT_ALL);
$conn = Doctrine_Manager::connection('mysql://root:@localhost/test_doctrine');

echo "connection is set up\n";

class BaseEntity extends Doctrine_Record
{
    public function setTableDefinition()
    {
        $this->hasColumn('name', 'string', 30);
        $this->hasColumn('username', 'string', 20);
        $this->hasColumn('password', 'string', 16);
        $this->hasColumn('created', 'integer', 11);

        // this column is used for column
        // aggregation inheritance
        $this->hasColumn('type', 'integer', 11);
        $this->setSubclasses(array(
            'User'  => array('type' => 1),
            'Group' => array('type' => 2)
        ));
    }
}

class Entity extends BaseEntity { }
class BaseUser extends Entity { }
class User extends BaseUser { }
class Group extends Entity { }

echo "going to create tables\n";
Doctrine::createTablesFromArray(array('BaseEntity'));

An echo statement printing the table name at the beginning of Table.initDefinition() produces the following output:

jschaefe@Kamelradde:~/src$ ./testinheritance.php 
connection is set up
going to create tables
initDefinition: BaseEntity
initDefinition: User
initDefinition: BaseUser
initDefinition: User
initDefinition: BaseUser
initDefinition: User
initDefinition: BaseUser
initDefinition: User
initDefinition: BaseUser
initDefinition: User
initDefinition: BaseUser
initDefinition: User
[...]
initDefinition: User
initDefinition: BaseUser
Segmentation fault (core dumped)