Doctrine 1
  1. Doctrine 1
  2. DC-435

Doctrine_Table::__constructor() executes initIdentifier() before setUp()

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Can't Fix
    • Affects Version/s: 1.2.0, 1.2.1
    • Fix Version/s: None
    • Component/s: Record
    • Labels:
      None

      Description

      Doctrine_Table::__constructor() executes $this->initIdentifier() first and $this->record->setUp() after.
      This leads to the incorrect identifier initialization in cases when identifier is defined in a behavioural template.

      In the same time, Doctrine_Record_Generator::initialize() does these operations in reverse order:

      176         $this->setTableDefinition();
      177         $this->setUp();
      ...
      183         $this->_table->initIdentifier();
      

      For me personally, it results in the following message:

      Warning: Illegal offset type in /net/eugene.dev/data/ethel/apps/external-doctrine1/1.2/lib/Doctrine/Record.php on line 1892

      1. DC-435.patch
        0.5 kB
        Eugene Janusov
      2. DC435TestCase.php
        3 kB
        Eugene Janusov

        Activity

        Hide
        Eugene Janusov added a comment -

        Attached test case.

        Show
        Eugene Janusov added a comment - Attached test case.
        Hide
        Eugene Janusov added a comment -

        Attached proposed patch.

        Show
        Eugene Janusov added a comment - Attached proposed patch.
        Hide
        Eugene Janusov added a comment -

        Oh, I forgot to run all the test after applying the patch. It seems my changes terribly broke something else.

        Then I don't have a clue how to fix this problem.

        Show
        Eugene Janusov added a comment - Oh, I forgot to run all the test after applying the patch. It seems my changes terribly broke something else. Then I don't have a clue how to fix this problem.
        Hide
        Jonathan H. Wage added a comment -

        This is an unfortunate limitation. A behavior cannot alter the primary key without problems

        Show
        Jonathan H. Wage added a comment - This is an unfortunate limitation. A behavior cannot alter the primary key without problems

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Eugene Janusov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: